Topic 2 of 5 · 5 min read
How many eval cases you need
Goal: Estimate how many cases an eval needs to detect a given improvement.
Decide the smallest difference you care about first; the number of cases follows from it. Asking "how many cases do I need?" has no answer until you say "to detect what?"
Check yourself · 1 of 3
What do you need to choose before you can say how many eval cases are enough?
Why it matters
A set of 50 cases can only detect a swing of 20 points or more. If your prompt changes usually move the score by 2 to 5 points, a 50-case eval will say "no difference" almost every time, and you will conclude that your changes do nothing. That is a power problem, not a model problem.
How to estimate it
Pick three numbers:
- Baseline pass rate
p, for example 80 percent. - Minimum detectable difference
d, the smallest gain or loss that would change a decision. - Power and confidence. The usual choice is 80 percent power (you catch a real gap of size
dfour times in five) at a 5 percent false-alarm rate.
For two independent samples the rule of thumb is n per version = 15.7 * p * (1 - p) / d^2, with p and d as fractions.
| Baseline | Smallest gap | Cases per version |
|---|---|---|
| 80% | 10 pts | about 250 |
| 80% | 5 pts | about 1,000 |
| 80% | 2 pts | about 6,300 |
Halving the gap you want to detect quadruples the cases. This is why chasing 1 or 2 point improvements on a small set is mostly noise. Online calculators such as Evan Miller's give the same answer.
If both versions run on the same cases and you compare them case by case, you need fewer cases, often far fewer, because question difficulty cancels out. See the paired comparison topic.
Before and after
Before: "We built 60 cases because that was what we had time to label."
After: "We care about 5 point changes at an 80 percent baseline. That needs roughly 1,000 cases for independent runs. With 60 cases we can only detect gaps of about 20 points, so we will use it as a smoke test and grow the set from production failures."
What goes wrong
- Reading "no significant difference" as "no difference". With too few cases, a real 5 point gain looks the same as nothing.
- Sizing from the wrong baseline. Rates near 50 percent need the most cases; rates near 95 percent need fewer for the same gap.
- Forgetting cost. Cases with human labels or an LLM judge are not free. Compute the cost of 1,000 cases before promising a 2-point detector.
Examples
The 100-case eval
A team has 100 cases at an 80 percent baseline and tests a prompt tweak worth about 3 points. Detecting 3 points needs on the order of 2,800 cases per version. With 100 cases the result is a coin flip. They either accept they can only see large changes or build more cases.
Picking d from a decision
A product owner says a change is worth shipping only if the pass rate rises at least 4 points, or falls under 2 points. The team sizes the eval for 4 points, not for the tiniest gap they could imagine.
Key points
- Choose the smallest difference that would change a decision before choosing the number of cases.
- Cases needed grow with 1 over d squared: halving the detectable gap needs four times the cases.
- At an 80 percent baseline, detecting a 5 point change between independent runs takes roughly 1,000 cases per version.
- A small eval is still useful as a smoke test for large regressions, but it cannot rank two close versions.
- A paired, per-case comparison needs fewer cases than comparing two independent averages.
Common mistakes
- Collecting cases until the team gets bored, with no target difference.
- Concluding a change does nothing because a small eval showed no significant gap.
- Using the same case count for a 50 percent task and a 95 percent task.
- Ignoring labeling and judge cost when choosing n.
Check yourself · 2 of 3
You want to detect a gap half as large as before. About how many more cases do you need?
Check yourself · 3 of 3
An eval with 40 cases shows 'no significant difference' between two prompts. What is the safest reading?
Practice items, not counted towards your mastery.
Start here
- A statistical approach to model evaluations (Anthropic) (opens in a new tab)ArticleFree
Standard errors, paired differences, clustering and power analysis applied to model evals, in plain terms.
- Adding Error Bars to Evals (Miller, 2024) (opens in a new tab)PaperFree
The paper behind the article: formulas for clustered errors, paired tests, resampling and power.
- A/B test sample size calculator (Evan Miller) (opens in a new tab)ToolFree
Enter a baseline rate and the smallest difference you care about, and read off the sample size.