Prompt Evaluation Metrics: Measuring What Matters
Prompt evaluation metrics explained: accuracy, faithfulness, format compliance, plus cost and latency — and how to build a lightweight eval harness.
You cannot improve a prompt you cannot measure. Prompt evaluation is the discipline of scoring your prompt on real inputs and using the numbers to decide what to change. The metrics that matter fall into five buckets: accuracy, faithfulness, format compliance, and the two everyone forgets — cost and latency.
Accuracy: is the answer right
Accuracy is how often the model returns the correct answer. It needs ground truth: a set of test inputs with known-correct outputs. Measure exact match for structured answers, and semantic similarity or an LLM judge for open-ended ones. Track accuracy against your test set after every prompt change — it is the guardrail that stops sounds better from becoming works worse.
Faithfulness: is the answer grounded
Faithfulness is whether the answer is supported by the provided context — critical for RAG and document work where the model should answer from sources, not from memory. The classic check is an NLI-style evaluation: does the answer contradict the source or lack support in it? Hallucination is not just an accuracy problem; a confident wrong answer can look accurate and still be unfaithful.
Format compliance: does it parse
- Valid JSON or output matching the declared schema.
- All required fields present with the right types.
- No extra prose wrapped around a structured output.
- Enum values drawn from the allowed set.
- Items correctly ordered when order matters.
Cost and latency: the forgotten metrics
A prompt that scores two points better but costs three times more and adds a second of latency is a bad trade at volume. Measure tokens per request — input, output, and total — and time-to-first-token on your real infrastructure. Normalize quality per dollar and per millisecond, and let that ratio, not raw accuracy, pick the winner between two similar prompts.
Building a lightweight eval harness
- Collect 30-50 real requests with ground truth where it exists.
- Run them against the current prompt and the candidate prompt.
- Score accuracy, faithfulness, and format automatically.
- Log tokens and latency for every run.
- Compare on a scorecard and pick the prompt that wins the ratio, not just accuracy.
- Re-run the suite on every prompt edit and every model upgrade.
FAQ
What metrics should I use to evaluate prompts?+
Accuracy against ground truth, faithfulness to provided context, format compliance, plus tokens per request and latency. Judge by quality per dollar, not accuracy alone.
How do I evaluate a prompt without ground truth?+
Use an LLM judge with clear rubrics, or human review on a small sample. For faithfulness, compare answers against their source context.
How many test examples do I need?+
Thirty to fifty well-chosen examples usually surface the meaningful differences between prompt versions. More helps, but the setup should stay cheap to run.
Related posts
Aug 13, 2026 · Prompt engineering
How to Evaluate LLM Prompts: A Systematic ApproachHow to evaluate LLM prompts systematically: build an eval set, score output, run regressions, and know when a prompt change is actually better.
Jul 30, 2026 · Prompt engineering
Best Prompt Engineering Practices for Teams in 2026Team-ready prompt engineering practices: versioning, review, shared libraries, model comparison, and cost guardrails that scale.
Aug 11, 2026 · Prompt engineering
Structured Outputs: Getting Reliable JSON From LLMsStructured outputs and JSON mode for LLMs: guaranteed JSON, schemas, validation, and patterns to make model output parseable and reliable.