May 16, 2026 · Updated November 14, 2026 ·
What is prompt evaluation? How to test and improve LLM prompts
Prompt evaluation scores a prompt against a fixed dataset of example inputs before you ship it. You gather a set of representative inputs, write down metrics that define what a good output looks like, run the prompt over every input, and grade each result. The output is a score, one you can hold up against last week's score to see whether a change helped or hurt. That is the whole idea: it turns "this feels better" into a number you can actually compare.
It exists because the obvious alternative (reading the outputs yourself) doesn't scale. Eyeballing five responses after a prompt tweak is fine. Eyeballing them after every tweak, across fifty inputs, while staying honest about the cases you didn't think to check, is not. People stop doing it, or they do it badly, and either way the prompt drifts. A fixed dataset and a defined metric make scoring cheap enough to run on every change, which is the only way scoring actually keeps happening.
Why one prompt change needs several scores
A prompt rarely gets better or worse all at once. An edit fixes the thing you were looking at and nudges something you weren't. Here are some of the ways it goes:
- The answers get shorter and drop a detail the user needed.
- The tone gets friendlier and the replies start bending a policy.
- The prose improves and the JSON stops matching the schema your code parses.
- The common inputs go better and the edge cases go worse.
- The edit helps on the model you tested and hurts on the one you fall back to.
Reading a handful of outputs catches the first half of each of those and misses the second. A scored run over the same inputs gives the second half somewhere to show up.
Prompt evaluation is not observability
The two get conflated constantly, so it's worth being precise. LLM observability watches live production traffic. It tells you what already happened: how long requests took, what they cost, which ones errored, and a trace of each one so you can debug it. It's a rear-view mirror, and a good one; you need it.
Prompt evaluation happens before any of that. It runs against a fixed dataset you control, not live traffic, and it answers a different question: is this version of the prompt safe to ship? It's a test drive, not a rear-view mirror. Observability tells you a regression went out yesterday and is annoying real users. Evaluation tells you the regression exists this morning, while it's still a diff on your screen. Most serious teams run both, but they are different tools solving different problems, and a dashboard of production latency graphs is no substitute for a scored test run.
The two also feed each other. A failure you spot in production is a new row for the dataset, and once it is there every later version of the prompt has to handle it before it ships.
An old idea with a new subject
Prompt evaluation didn't appear with large language models. It inherits its core move, the held-out test set, from decades of classical machine learning. The rule there is old and unbending: never measure a model on the same data it learned from, or it will score perfectly by memorising and tell you nothing about the unseen case. So you hold a portion of your data back, untouched, and judge the model only on that. A prompt's evaluation dataset is exactly this held-out set, repurposed: a fixed bank of inputs the prompt has to perform on, kept stable so the score means something across versions.
The specifically prompt-shaped version of the idea crystallised on March 14, 2023, the day OpenAI launched GPT-4 and, alongside it, open-sourced a framework called Evals. Evals let anyone build a dataset of prompts, run a model over it, and measure the quality of the completions, and it gave the activity its now-ubiquitous short name. There was a telling detail in the launch: OpenAI offered GPT-4 access to people who contributed high-quality evals. They were, in effect, paying for test cases. That's a clear signal of how the field already valued the thing: not the model on its own, but a trustworthy way to measure it.
The anatomy: datasets, runs, and metrics
Three pieces do the work, and the vocabulary is worth getting straight because every prompt-eval tool uses some version of it.
- A dataset is your held-out set: a collection of example inputs, each row one case the prompt has to handle. Good datasets over-represent the awkward cases (the empty input, the hostile user, the edge case that caused last quarter's incident) because those are the cases an edit tends to break first. Our guide to building a prompt eval dataset covers where the rows come from.
- A run is one execution of a prompt over every row of the dataset. It produces one output per row, all under the same conditions, so the run as a whole is a single comparable snapshot of how that prompt version behaves. Two runs over the same dataset, with only the prompt changed between them, can be compared row by row as well as in total, which is how you catch an average that went up while one important case fell over.
- A metric is one named criterion the outputs are graded against: "stays faithful to the source", "returns valid JSON", "never promises a refund". A run carries several metrics, each scored independently. That independence is the point: a single blended "is this good?" number can tell you something dropped but never what. Separate metrics turn a regression into a pointer straight at the broken behaviour.
How to score prompt evaluation results
Some outputs grade themselves. If the prompt has to return JSON, you can check that it parses. If it has to pick one of five labels, you can compare its pick with the expected one. These are deterministic checks: the answer is pass or fail, and no model is involved in deciding it.
Open-ended outputs (summaries, answers, rewrites) are harder. A correct reply rarely matches a reference answer word for word, so comparing strings tells you almost nothing. The common answer is to use a model as the grader: an LLM judge reads each output against a written rubric and gives it a score. In CompletionKit that score runs from 1 to 5, where 5 means the output fully meets the rubric, and the judge writes down why it landed there.
The rubric does most of the work. "Is this response good?" leaves the judge to guess what you meant. "Does the reply answer the customer's question without promising anything the refund policy doesn't allow?" gives it a task it can do the same way every time. Even a good rubric needs checking, though, because a judge can be consistently wrong in a direction you share. The fix is to grade a sample yourself and see where you and the judge disagree. Our guide to LLM-as-a-judge goes into how to set that up so the score is one you can trust.
How to improve a prompt with evaluation
A single run tells you where a prompt stands. The improvement comes from running it again after each change, and the loop is short:
- Run the current prompt over the dataset to get a baseline.
- Read the outputs that scored low, along with the judge's reasons.
- Look for a pattern. Several failures with one cause are worth more than one odd failure.
- Make one targeted change aimed at that cause. If the prompt keeps inventing missing details, tell it what to say when the information isn't there, rather than telling it to "be more accurate".
- Run the same dataset again with the same model and metrics.
- Compare both runs: did the metric you aimed at move, and did any other metric or row get worse?
- Keep the change or revert it, on the scores rather than on how the outputs read.
When production turns up a failure the dataset didn't cover, add it as a row. Each failure you add stays there, so every later version has to pass every case that has ever caught the prompt out. That is prompt regression testing, and it is most of the long-run value. The middle steps can also be handed to a model; the automated prompt optimization loop covers how that works and where it goes wrong.
The build loop and the maintenance loop
The reason prompt evaluation pays off isn't really the first version of a prompt. It's everything after.
Shipping a prompt the first time is the easy part: you wrote it, you tried it, it looked good, it went out. The hard part is the year that follows: the model gets deprecated and you swap it, a customer hits a case you never imagined, you tighten the tone, you add a new instruction, you trim it to save tokens. Every one of those changes is a chance to quietly break a case that used to work. Without a dataset to run against, you simply won't know; the new behaviour looks fine, the regression is two rows you didn't re-check.
This is the distinction between a build loop and a maintenance loop. The build loop is getting to the first good version. The maintenance loop is keeping it good through every later change. Prompt evaluation matters in both, but it's indispensable in the second, because that's where regressions hide and where eyeballing fails most quietly. A prompt without an eval dataset isn't finished; it's just untested. The maintenance loop is also the half you can hand off: point a coding agent such as Claude Code or Cursor at the MCP server and it runs the evaluate-revise-rescore cycle for you, against metrics your team wrote.
Prompt evaluation in CompletionKit
CompletionKit runs that loop end to end. You give it a prompt and a dataset, it runs the prompt over every row, and it scores each output against your metrics: a 1–5 LLM judge for the open-ended qualities, deterministic checks for the pass-or-fail ones (valid JSON, a regex, a required phrase, a length limit). You grade a sample yourself to see whether the judge agrees with you, and it suggests prompt edits based on the run's scores and the judge's reasons. Each change to a prompt with runs becomes a new version, and your app fetches the published version over the API, so the prompt that won the comparison is the one in production.
The same work is open to people in the browser, to scripts over the REST API, and to coding agents over MCP. Plans are a flat price for the team rather than a charge per seat (see pricing), and the engine underneath is source-available under BSL 1.1, so you can run it on your own servers. The docs walk through setting up datasets, runs, and metrics step by step.
FAQ
What is prompt evaluation?
Scoring a prompt against a fixed dataset of example inputs before you ship it. You collect representative inputs, define metrics for what a good output looks like, run the prompt over every input, and grade the results, producing a score you can compare against the previous version.
What's the difference between prompt evaluation and LLM observability?
Observability watches live production traffic and reports what already happened: latency, cost, errors, traces. Prompt evaluation runs before you ship, against a fixed dataset you control, and tells you whether a change is safe to release. A rear-view mirror versus a test drive. Most teams need both.
What is a run and what is a metric?
A run is one execution of a prompt over every row of a dataset, producing one output per row. A metric is a single named criterion the outputs are scored against. A run carries several metrics, each scored independently, so a drop in one of them points straight at what regressed.
Do I need prompt evaluation if I only have one prompt?
Yes. A single prompt is rarely edited only once, and every later tweak, model swap, or new edge case can quietly break a case that already worked. Evaluation earns its keep across the year of changes after the first version, not on the first version itself.
What makes a good prompt evaluation?
Three things held steady: inputs that look like real traffic and include the awkward cases, metrics written specifically enough that two graders would agree, and the same model and settings on every run. Change only the prompt between runs and the difference in scores belongs to the prompt.
Score your prompts free Why we built CompletionKit
Built by Homemade Software. Disagree with any of this? support@completionkit.com or r/completionkit.