Tool
Sample size and error bars
Every score on a test set is an estimate. How far it could move if you had drawn different items depends mostly on how many items you used. This page shows how to put numbers on that, and how many items you need before a comparison means anything.
The short version
- A score on 200 items is a range, not a point. For 200 items scored at 80%, the Wilson 95% interval runs from 73.9% to 85.0%.
- Halving the margin of error takes about four times as many items. As planning figures, ±10 points takes about 97 items, ±5 about 385, and ±3 about 1,068 (normal approximation, accuracy near 50%, the cautious case).
- Telling two systems apart needs far more items than measuring one. Detecting 80% against 85% on two separate samples takes about 906 items per system by the standard formula, or about 945 with a continuity correction. On the same items, if the systems disagree on 10% of them, about 312 by the normal approximation; an exact test needs about 337.
- If the gap between two systems is within what the choice of items could produce, the test has not shown that they differ. See No Error Bars, No Result.
- A single run of a single prompt is also a sample. See Once Is Not Reliable and Prompt Sensitivity.
Interval by test-set size
| Items (n) | Observed accuracy 50%: points either side | Observed accuracy 90%: points below / above |
|---|---|---|
| 50 | ±13.4 | −11.4 / +5.7 |
| 100 | ±9.6 | −7.4 / +4.5 |
| 200 | ±6.9 | −4.9 / +3.4 |
| 500 | ±4.4 | −2.9 / +2.3 |
| 1,000 | ±3.1 | −2.0 / +1.7 |
| 5,000 | ±1.4 | −0.9 / +0.8 |
These are Wilson 95% intervals, in percentage points. At 50% the interval is symmetric and is the widest it gets, so the first column is the worst case. Near 0% or 100% it is not symmetric, so the second column gives the points below and above 90%. For example, 45 correct out of 50 gives 78.6% to 95.7%, not a symmetric ± figure. The usual symmetric formula, 1.96 × √(p(1−p)/n), is too narrow there. Assumes independent items scored right or wrong, so the intervals cover which items were drawn and nothing else.
Calculators
These run in your browser and send nothing anywhere. They give planning figures from standard formulas, listed under Sources; read the assumptions before relying on them.
Worked examples
- Is 82% vs 79% a win? On 200 items, a score of 80% has a 95% interval of 73.9% to 85.0%, roughly five to six points either side. If the two systems are scored on separate samples of 200 items, the 95% interval for a 3-point gap is about ±7.8 points, so the gap is well within noise. Running both systems on the same items gives a sharper test, but a 3-point gap on 200 items is a net of 6 items, and it passes a 5% test only if the systems disagree on few items: at most 8 (4%) by the McNemar normal-approximation test, or at most 6 (3%) by the exact McNemar test. If they disagree on more items than that, the gap is within what the choice of items could produce.
- Same items, small disagreement. To detect a 5-point gap with 80% power when the systems disagree on 10% of items you need about 312 items by the normal approximation, or about 337 by an exact test. If they disagree on 20% of items, about 626 (exact: about 658). More disagreement means more noise in the comparison, so you need more items.
- Different items. The same 5-point gap on two separate samples needs about 906 items per system by the standard formula without a continuity correction, or about 945 with it, because nothing is cancelled out by sharing items.
- Do not know the disagreement rate? Run both systems on a pilot first and count the items where exactly one is right. A pilot of 50 to 100 items gives only a rough rate. If 5 of 50 items disagree (10%), the 95% Wilson range for the true rate is 4.3% to 21.4%, and the items needed for a 5-point gap run from about 155 to about 669. With 10 of 100, the range is 5.5% to 17.4% and the items needed run from about 172 to about 546. The disagreement rate cannot be below the gap itself, so where the Wilson range reaches below 5%, as it does for 5 of 50, the low end is raised to 5%. Plan with the upper end of the range if you want to be safe.
The main figures on this page are generated from build/sample_stats.py and checked by build/test_sample_size.py in the site repository. That test reads the built page and checks every number in the interval table, the short version, and these worked examples against separate calculations, including exact power for the sample-size figures. It does not check the wording of the assumptions below or the sources, and it checks formulas, not whether they suit your data.
What the numbers assume, and where they fail
- Independent items. The formulas treat each item as an independent draw. Items that come in groups (several questions about one document, or many prompts from one user) are correlated, and the true interval is wider. Miller (2024) gives a clustered standard error for this. With strong clustering, count the groups, not the items.
- Items are a sample from what you care about. The interval only covers the luck of which items you drew. It says nothing about whether the test items resemble real use. See Distribution Shift and The Construct Gap.
- Judge noise is extra. If an AI model grades the answers, its errors and preferences add to the uncertainty and can bias the score in one direction. The interval above does not include that. Check the grader against people (Judge Bias).
- Model randomness is separate, and the intervals are over items. Running each item several times reduces noise from the model’s own variation, but not noise from which items you picked. The intervals on this page describe the choice of items; repeating runs on the same items does not make them narrower, and the run-to-run variation is an additional source of uncertainty. Both matter (Once Is Not Reliable).
- Approximations. Wilson intervals have much better coverage than the usual symmetric formula at small n and for accuracy near 0% or 100%, though they are still approximate (Brown, Cai and DasGupta, 2001). The sample-size formulas are normal approximations, and an exact test can need more items. As a rough guide, not a sharp cut-off, treat the figures as rough below about 30 items, or with fewer than about 25 disagreements in a paired comparison, and consider an exact method.
- Many comparisons. The calculators cover one comparison. If you test many variants against one test set and report the best, the best will look better than it is (Adaptive Overfitting). This page does not cover corrections for multiple comparisons.
- Point of the plan. The sample size depends on the smallest difference that would change your decision. Decide that first and write it down (see the eval plan template).
Related patterns
- No Error Bars, No Result: every score is an estimate; show the interval.
- Once Is Not Reliable: one run, or one prompt, is a single draw.
- The Averaging Trap: an average needs enough items in each slice to carry its own interval.
For real examples, see the case studies. For a reporting layout that includes intervals, see the results template.
Sources
- Wilson, E. B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22(158), 209–212. https://doi.org/10.1080/01621459.1927.10502953
The Wilson score interval. - Brown, L. D., Cai, T. T., & DasGupta, A. (2001). Interval estimation for a binomial proportion. Statistical Science, 16(2), 101–133. https://doi.org/10.1214/ss/1009213286
Compares intervals by coverage; recommends Wilson or Jeffreys for small samples and Agresti–Coull for larger ones. - Miller, E. (2024). Adding error bars to evals: A statistical approach to language model evaluations. arXiv:2411.00640. https://arxiv.org/abs/2411.00640
Standard errors (including clustered), paired differences between models (eq. 7), and power analysis for evals (section 5). - Fleiss, J. L., Levin, B., & Paik, M. C. (2003). Statistical Methods for Rates and Proportions. Wiley. https://doi.org/10.1002/0471445428
Sample size for comparing two independent proportions, with and without a continuity correction. - Connor, R. J. (1987). Sample size for testing differences in proportions for the paired-sample design. Biometrics, 43(1). https://doi.org/10.2307/2531961
Sample size when both systems are scored on the same items (the McNemar setting).
The formulas in the calculators are standard textbook results; this page applies them to eval data and does not add to them. The sample-size formulas in 3a and 3b are normal approximations. Figures for an exact test, and the pilot ranges, are computed on this site by enumerating the exact distributions and applying the Wilson interval; they are not from the sources above. Miller’s worked example for detecting a 3-point difference, under the assumptions in his paper, comes to roughly 1,000 questions.
Planning aid, not a statistical consultation. For a high-stakes decision, have someone with statistics training check the design. The figures in the table and worked examples are checked by build/test_sample_size.py in the site repository.