Evaluation lab · San Francisco · London · Zürich
Reinforced Labs Request a briefing
Research note

How many test cases does an LLM eval need?

An eval suite is an experiment, and an experiment has a resolution. We worked out how many cases it takes to see a regression of a given size, how often a common gating rule fires when nothing changed, and how much pairing helps in practice.

The question a release gate is really asking#

A typical release gate compares a candidate against production on a fixed suite and blocks the merge if a category's pass rate falls. Two things can go wrong. The gate can miss a real regression because the suite is too small to see it (a false negative), or it can block a harmless change because sampling noise looked like a drop (a false alarm). Both are a direct function of the number of cases per category, and both can be calculated before you write a single test.

The unit that matters is the category, not the suite. A 10,000-case suite with 40 categories has about 250 cases per category, and the gate's resolution is set by those 250. That one fact explains most noisy eval dashboards we're asked to look at.

Resolution of a single measurement#

Treat each case as a Bernoulli trial with success probability . With passes out of cases, the naive estimate is with standard error . Near the pass rates that matter for safety (95–99%), the normal-approximation interval behaves badly: it can exceed 100% and under-covers. The Wilson score interval [2] fixes both problems:

The interval is , with for 95% coverage. Figure 1 plots the half-width against for four pass rates.

p = 0.80p = 0.90p = 0.95p = 0.99
±0±3±5±8±10501002004008001,6003,2006,400±2 ptsCases in the category (log scale)95% interval half-width (pts)
Figure 1. Half-width of the 95% Wilson interval as a function of category size. At a 95% pass rate the interval is ±3.1 points at 200 cases and drops below ±2 points only past roughly 500 cases (±1.5 at 800, ±1.1 at 1,600). Computed analytically in eval_sample_size.py.

Read it as a resolution limit. With 200 cases at a 95% pass rate, anything you say finer than about ±3 points is noise. The width scales as , so halving it costs four times the cases. That is why the curves flatten so slowly.

Detecting a regression: power#

For a gate we care about a difference between two versions. For two independent samples of size each, with pass rates and , the sample size for a one-sided test at level with power is approximately

Plugging in , , , gives per version. A 5-point drop needs about 340. The term is the whole story: detecting a regression half as large costs four times as many cases.

Does pairing save you?

Running both versions on the same cases allows a paired test. McNemar's test [3] uses only the discordant cases: where the old version passed and the new one failed, and the reverse. Under the null hypothesis each discordant case is equally likely to go either way:

The common advice is that pairing dramatically reduces the required sample. It reduces the variance of the difference by , which is large when per-case outcomes are strongly correlated across versions: easy cases pass for both, hard cases fail for both. Miller [1] makes the same argument for LLM evals and recommends paired analysis and clustered standard errors. We wanted to know how big the effect is under a realistic difficulty distribution, so we simulated it.

Simulation: paired vs. unpaired, and the naive rule#

Setup. Each case has a latent baseline success probability , mean . Most cases are easy and a long tail is hard, which matches the shape we see in production safety suites. The candidate model shifts every case by the same amount on the logit scale, , with solved numerically so the mean drops by exactly . Each version is run once per case. We ran 2,000 replications per cell, with a one-sided throughout.

2-pt drop, paired (McNemar)2-pt drop, unpaired (z-test)5-pt drop, paired
0%20%40%60%80%100%2004008001,6003,20080% powerCases per model (log scale)Power (probability of detection)
Figure 2. Probability of detecting a true regression. A 2-point drop reaches 80% power at roughly 1,600–1,700 cases (paired 83%, unpaired 79%). A 5-point drop needs about 400. Monte Carlo, 2,000 replications per point.
Cases / modelPower, 2-pt drop (paired)Power, 2-pt drop (unpaired)Power, 5-pt drop (paired)False alarms, naive 2-pt rule
20018%19%65%16%
40034%32%91%9.3%
80055%51%100%2.3%
1,60083%79%100%0.1%
3,20098%97%100%0.0%

Finding 1: pairing helped less than the folklore says. At 1,600 cases the paired test's power was 83% against 79% unpaired, a few points better. The reason is in the setup: with one sample per case and most close to 1, the two versions' outcomes on a case are only weakly correlated, because an easy case mostly passes for both whether or not they share anything. Pairing pays off when per-case outcomes are close to deterministic: temperature 0, or several seeds averaged per case. Even then you should still run the paired test, since it is never worse and it is the correct analysis for the design.

Finding 2: the "block on any 2-point drop" rule is a coin flip at small n. With no real change at all, the naive rule fired in 16% of runs at 200 cases and 9.3% at 400 (Figure 3). A team running ten categories at 200 cases each sees at least one spurious block on about of merges. That is how gates get disabled. The paired test held its nominal rate (3.2%–4.7%) at every size.

Naive rule: block if drop ≥ 2 ptsPaired test, α = 0.05
0%5%10%15%2004008001,6003,200nominal 5%Cases per model (log scale)False-alarm rate (no real change)
Figure 3. False-alarm rate when the candidate is identical to production. The naive threshold rule is badly miscalibrated below about 800 cases; the paired test stays near 5%.

Many categories: the multiple-comparisons tax#

A suite with independent categories, each gated at level , fires at least one false alarm with probability . With and that is 64%. Two standard fixes:

  • Bonferroni: gate each category at . Simple and conservative. It raises the required by roughly the factor , which is about 2.2× for at 80% power.
  • Tiering: apply strict, individually powered gates only to the handful of high-severity categories (injection, tool misuse, data egress), and track the rest as warnings with a false-discovery-rate procedure. In practice this is the better trade.

A sizing recipe you can use today#

  1. For each high-severity category, decide the smallest regression you would block a release for, and the baseline pass rate .
  2. Compute from the formula above (or run eval_sample_size.py with your own , and difficulty distribution).
  3. Run both versions on the same cases and use McNemar's test. Use several seeds per case if outputs are stochastic. This is where pairing earns its keep.
  4. Correct for the number of strictly gated categories.
  5. Report every category with its interval, and flag categories whose interval is wider than as under-powered rather than "passing".
Rule of thumbNear a 95% pass rate: about 340 cases per category to catch a 5-point drop, about 1,700 to catch a 2-point drop, about 6,400 to catch a 1-point drop, all at 80% power. If you can't afford that, gate on a larger and say so out loud.

Limitations#

Outcomes are simulated, not taken from a real model. Results depend on the assumed difficulty distribution (Beta(3.8, 0.2)) and on the uniform logit shift; real regressions often hit a subset of cases, which makes paired tests relatively more powerful. Each version was run once per case; multi-seed designs change the pairing result. Grader error is ignored here; see our note on judge error, which widens all intervals. Code and seeds: methods.

Frequently asked questions#

How many test cases do I need for an LLM evaluation?

It depends on the regression you need to detect. Near a 95% pass rate, roughly 340 cases per category detect a 5-point drop and roughly 1,700 detect a 2-point drop with 80% power at a one-sided 5% level.

What confidence interval should I use for an LLM eval pass rate?

Use the Wilson score interval. It stays inside [0, 1] and has much better coverage than the normal approximation at the high pass rates typical of safety evals.

Should I use a paired test to compare two models?

Yes. Run both models on the same cases and use McNemar's test. It is never less powerful than an unpaired test, and its advantage grows when per-case outcomes are stable, for example at temperature 0 or with several seeds averaged per case.

Sources#

  1. E. Miller. Adding Error Bars to Evals: A Statistical Approach to Language Model Evaluations. arXiv:2411.00640, 2024. arxiv.org
  2. E. B. Wilson. Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association 22(158):209–212, 1927. doi.org
  3. Q. McNemar. Note on the sampling error of the difference between correlated proportions or percentages. Psychometrika 12(2):153–157, 1947. doi.org

Know the number before you ship.

A 45-minute working session with an evaluation engineer. Bring one use case; leave with a threat model, a draft eval plan with sample sizes, and an honest read on where you stand.