How many eval cases before you trust a prompt change? Simulated numbers

A prompt that truly passes 85% against one that passes 80%: on 30 test cases the better one scored higher only 63% of the time, and the worse one was ahead 25% of the time. The intervals and the simulation behind that.

Prakhar

Backend engineer · Pressentify

Published

3 min read 704 words
A grid of 80 circles, most blue for pass and some amber for fail, arranged in 8 rows of 10.

You change a prompt, run your 30 test cases, and the score goes from 80% to 87%. Do you ship it? A small test set gives noisy scores, and noise looks exactly like improvement when you only look at one run. Here is how big the noise is, computed two ways, so you can decide how many cases you need.

A score is an estimate, not a fact

If a prompt truly passes 90% of the kinds of requests you care about, a run of 30 cases will not report exactly 90% every time. It will report 27 out of 30 often, and 25 or 29 not rarely. What you want to know is the range the true pass rate could plausibly be in. For pass or fail counts a standard answer is the Wilson score interval, which behaves better than the textbook one when the sample is small or the rate is near 100%.

import math

def wilson(k, n, z=1.96):          # 95% interval for k passes out of n
    p = k / n
    d = 1 + z * z / n
    c = (p + z * z / (2 * n)) / d
    m = z * math.sqrt(p * (1 - p) / n + z * z / (4 * n * n)) / d
    return c - m, c + m

wilson(27, 30)    # (0.743, 0.966): 74% to 97%

Here is the 95% interval around an observed 90% pass rate for different test set sizes:

n=  20: 70% to 97%  (width 27 points)
n=  30: 74% to 97%  (width 22 points)
n=  50: 79% to 96%  (width 17 points)
n= 100: 83% to 94%  (width 12 points)
n= 200: 85% to 93%  (width  8 points)
n= 500: 87% to 92%  (width  5 points)
n=1000: 88% to 92%  (width  4 points)
Chart of 95 percent Wilson intervals around an observed 90 percent pass rate: 20 cases 70 to 97 percent, 30 cases 74 to 97, 50 cases 79 to 96, 100 cases 83 to 94, 200 cases 85 to 93, 500 cases 87 to 92.
On 30 cases a 90% score is consistent with a true rate anywhere from 74% to 97%. It takes about 500 cases to get within five points.

How often the better prompt wins

The interval says how well you know one number. The question you actually face is comparing two prompts. We simulated a case where prompt B is truly better: it passes 85% and prompt A passes 80%. We scored each on its own set of n fresh cases, 40,000 times for each size, and counted how often B scored higher.

import random
rnd = random.Random(1)
n, trials = 30, 40_000
wins = ties = 0
for _ in range(trials):
    a = sum(rnd.random() < 0.80 for _ in range(n))   # prompt A truly passes 80%
    b = sum(rnd.random() < 0.85 for _ in range(n))   # prompt B truly passes 85%
    wins += b > a; ties += b == a
Cases per promptB scores higherTiedA scores higher
2058%16%26%
3063%12%25%
5070%8%21%
10080%5%15%
20089%2%8%
50098%0%2%
Bar chart of how often the truly better prompt scores higher: 20 cases 58 percent, 30 cases 63, 50 cases 70, 100 cases 80, 200 cases 89, 500 cases 98.
With 30 cases per prompt, a real five-point improvement shows up as a higher score only about two times in three. One time in four the worse prompt is ahead.

That last column is the one to read twice. At 30 cases, a quarter of the time you would see the worse prompt win and might ship it. The better prompt wins clearly (more than 4 times in 5) only from 100 cases up.

Limits of this simulation

We scored the two prompts on separate sets of cases, which is the harder case. If both are scored on the same cases, much of the case-to-case noise cancels, and looking at only the cases where the two disagree (the idea behind McNemar’s test) gives a sharper comparison. We did not simulate that, so do not read the table as the best you can do. An LLM judge also adds its own error on top, which none of this models.

What to do with this

  1. Report a score with its interval, not alone: “27 of 30 (74% to 97%)” tells a different story than “90%”.
  2. Decide before the run what difference matters. By our table a five-point change needs a few hundred cases to show reliably; a much bigger change is easier to see with fewer, though we did not simulate that.
  3. Score old and new on the same cases, and read the cases that changed. A prompt that fixes 6 and breaks 4 is not the same as one that fixes 2 and breaks 0.
  4. Keep a growing set. Add every real failure you meet to it, so the set gets bigger where it matters.
  5. Do not tune the prompt against the same cases you then report on. Keep some cases back.

Sources & Credits

  • Edwin B. Wilson, “Probable Inference, the Law of Succession, and Statistical Inference,” Journal of the American Statistical Association, 1927, the source of the Wilson interval.
  • “Binomial proportion confidence interval,” Wikipedia, for the formula: en.wikipedia.org
  • “McNemar’s test,” Wikipedia: en.wikipedia.org

The intervals, the simulation, the tables and the charts are our own work (Python 3, 40,000 trials per row, seed 1, run on 17 November 2026). The prompts and the 80% and 85% pass rates are made up to show the effect; they are not from a real system. Last verified 2026-11-17. Spotted a mistake? Tell us and we will correct it here with the date.

Share this article

Written by

Prakhar

Backend engineer · Pressentify

Backend engineer building Pressentify — interactive cheatsheets, handbooks and a job-hunt workspace.

Get the next one in your inbox

One practical backend article at a time. No spam; unsubscribe in one click.

Occasional. One-click unsubscribe.