Eval
A repeatable test that scores a model or an agent on a fixed set of tasks, so a prompt change or a model swap can be judged by a number instead of a hunch. Evals are to AI features what unit tests are to code: unglamorous, and the only thing that catches a silent regression.
At a glance
- Parts
- Fixed inputs, a runner, a grader
- Output
- A score or pass rate
- Graders
- Tests, exact match, rubric, model judge
- Used for
- Prompt changes and model swaps
- Public version
- A benchmark, such as SWE-bench
How it works
An eval has three parts: a fixed set of inputs, a way to run the model or agent on each one, and a grader that turns each output into a score. For a coding agent the input might be a repo snapshot plus a task, the run is the agent working in a scratch checkout, and the grader is a hidden test suite that passes or fails. For a summarizer, the grader might be a rubric scored by another model.
Model output varies between runs, so a single pass can mislead. Running each case several times and reporting the pass rate gives a steadier number. Store the results with the prompt and model version that produced them, so a later run has something to compare against.
Why it matters
Prompts and model versions change often, and the effects are rarely obvious from a few examples tried by hand. A change that fixes the case you were looking at can quietly break five others. Running the eval before and after shows that directly, which turns prompt tweaks and model swaps into decisions you can defend.
Eval vs. unit test vs. benchmark
A unit test is deterministic and should pass every time; an eval expects some failures and tracks the rate. A benchmark is a public eval, such as SWE-bench for coding agents, used to compare models in general. Your own eval measures what a benchmark cannot: how a model does on your codebase and your definition of correct.
Public leaderboards are also exposed to contamination, since benchmark tasks can end up in training data. A private set drawn from your own bugs avoids that, and it keeps measuring the work you actually care about as models change underneath it.
Example
{
"id": "fix-timezone-bug",
"repo_ref": "a1b2c3d",
"task": "Dates in the invoice PDF show the server timezone. Render them in the customer timezone.",
"grader": "pnpm test tests/hidden/invoice-timezone.test.ts",
"runs": 5
}Common mistakes
- Starting with a thousand synthetic cases nobody has read instead of twenty real failures.
- Grading with a model and never checking its scores against human judgment.
- Tuning the prompt on the same cases you report, which inflates the score; keep a held-out set.
Related terms
Frequently asked questions
Is an eval the same as a benchmark?
A benchmark is a public, shared eval used to compare models. An eval is any repeatable scored test, and the most useful ones are private sets built from your own tasks.
How many cases does an eval need?
Enough to cover the failures you care about. A few dozen real cases is a practical start, grown as new failures appear.
Can an LLM grade an eval?
Yes, for outputs a test cannot check, but spot check its scores against human judgment so you know the grader measures what you think.