Practical technical guides / AI engineering: evaluation (prompt selection and holdout)

Picking the Best of Twenty Prompts on One Eval Set Overstates Its Score: Hold Out a Split and Measure the Gap

Twenty equally good prompts scored on 100 cases: the winner reported 0.78 and scored 0.70 held out. Measure selection bias, keep a held-out split and stop reusing it.

By Sandeep Belgavi · Published 2026-11-10

Twenty equally good prompts scored on 100 cases: the winner reported 0.78 and scored 0.70 held out. Measure selection bias, keep a held-out split and stop reusing it.

A twenty-prompt afternoon

Jenya is improving the instructions for the help-desk agent at Belgavi's Book Store. Jenya writes twenty variants of the system prompt, runs each on the team's eval set of 100 recorded cases, and picks the one that scores highest: 79 of 100 cases graded as correct, against 70 for the current prompt. The release note says "new prompt improves resolution accuracy from 70 to 79 percent".

The comparison looks fair. Every variant saw the same cases and the same grader. The problem is the word "picks". The score of the variant you chose because it scored highest is not an estimate of how it will score next week. It is the maximum of twenty noisy measurements, and the maximum of noisy measurements is biased upward even when nothing improved.

This article measures that bias with a seeded simulation, explains where its size comes from, and sets out the fix: keep a held-out split that plays no part in choosing, report that score with an interval, and stop reusing the held-out split once it has been used to choose.

How big the bias is when nothing improved

Start with the worst case for intuition: all twenty variants are equally good, with a true pass rate of 0.70. Each run on 100 cases is a binomial draw, so a single variant's score has a standard deviation of about 0.046. The companion example repeats the afternoon 2,000 times.

QuantityMean over 2,000 trials
Score reported for the winner on the 100 tuning cases0.7833
Same winner on 300 held-out cases0.7002
True pass rate of the winner0.70

The winner's reported score is 8.3 points too high on average, with no real improvement at all. The held-out split gets the right answer because it played no part in the choice.

The size of the bias is predictable. The expected maximum of 20 independent standard normal variables is about 1.87, so the winner of 20 equal variants should exceed the true rate by roughly 1.87 times the standard deviation of one score: 1.87 times 0.046 is 0.086, close to the simulated 0.083. Two consequences follow directly. The bias grows with the number of variants, slowly (the expected maximum of 100 normals is about 2.5). And it shrinks with more cases, because the standard deviation falls with the square root of the case count.

When one variant really is better

Now make one variant genuinely better, at 0.75 against 0.70 for the other nineteen. This is the situation the team hopes it is in.

Tuning casesWinner is the truly better variantWinner's reported scoreWinner's held-out score
10022.9 percent of trials0.7890.712
40062 percent of trials0.7550.731

With 100 tuning cases, the better variant wins less than a quarter of the time; most of the time one of the nineteen equal variants gets lucky. Its reported score still looks like a nine-point gain. With 400 tuning cases the better variant wins most of the time and the reported score is much closer to the truth, but still about 2.4 points above it. The held-out column is the honest one in both rows: it says the expected gain from this procedure is about one point with 100 tuning cases and about three points with 400.

The procedure

The fix is old and simple. It is the same rule that machine learning uses for model selection, applied to prompts.

  1. Split the eval cases once, before any variant is written: a tuning set for comparing variants and a held-out set for the final measurement. Stratify the split by case type so both halves cover the same mix.
  2. Compare variants only on the tuning set. Iterate as much as you like there.
  3. Run only the chosen variant, and the current production prompt, on the held-out set. Report those two numbers.
  4. Attach an interval. The example reports a Wilson score interval: 210 of 300 correct is 0.70 with a 95 percent interval from 0.646 to 0.749.
  5. Treat the held-out result as spent. If it disappoints and you go back to try more variants, the next measurement on the same held-out cases is a selection again.
# simplified from holdout.py in the companion example
def experiment(true_rates, n_tune=100, n_hold=300, trials=2000, seed=11):
    rng = random.Random(seed)
    for _ in range(trials):
        tune = [binomial_score(rng, t, n_tune) for t in true_rates]
        best = max(range(len(true_rates)), key=lambda i: (tune[i], -i))
        hold = binomial_score(rng, true_rates[best], n_hold)
        ...  # record the reported score, the held-out score and the true rate of the pick

A paired comparison on the held-out set (both prompts on the same cases) is more sensitive than comparing two independent scores, because case difficulty cancels. Report the number of cases where the new prompt wins, loses and ties, not only the two rates.

How many held-out cases

The held-out set has to be large enough to answer the question you will ask of it. For a pass rate near 0.7, a 95 percent interval with a half-width of about 5 points needs about 323 cases; 3 points needs about 897. Those numbers come from the normal approximation and are a planning guide, not a guarantee. If the improvement you hope to detect is two points, an eval set of 100 cases cannot detect it at all, however you split it.

Where cases are scarce, two tactics help. Use cross-validation over the tuning set for the comparison phase, so that every case contributes to choosing, and keep a smaller held-out set only for the final number. Or collect new cases after the decision, from recent traffic, and treat them as the held-out set; this also tests whether the improvement survives a shift in what customers ask.

Reusing the held-out set

The most common way to lose the benefit is gradual. The held-out score comes back at 72, the team tries ten more variants, checks each on the held-out set and keeps the best. The held-out set has quietly become a second tuning set. In the example, ten rounds of twenty new variants evaluated on the same 300 held-out cases inflate the best score by 7 points, almost as much as the original problem.

Practical defences, in increasing order of effort:

  • Log every evaluation run on the held-out set with the variant identifier. A count above one per decision is a warning.
  • Restrict who can run the held-out set, for example only the release pipeline.
  • Refresh the held-out set on a schedule from new, labelled traffic.
  • For high-stakes decisions, keep a final test set that is used once per quarter.

Failure modes beyond selection

  • Leaking cases into the prompt. Few-shot examples copied from the eval set make the tuning score meaningless for those cases. Deduplicate examples against both splits.
  • A grader that changes between runs. If an LLM grader is involved, freeze its model and instructions for the whole comparison, or the variants are measured with different rulers.
  • Correlated cases. Real cases share topics and difficulty. Correlation changes the size of the bias but not its direction; it also makes the interval from independent-case formulas too narrow, so cluster cases by conversation or customer when computing intervals.
  • Optimising the metric instead of the outcome. A variant that learns to satisfy the grader's phrasing can score well on both splits and still help customers less. Read a sample of held-out transcripts before release.

What to write in the release note

With illustrative numbers: "New prompt: 0.73 (95 percent interval 0.68 to 0.78) on 300 held-out cases, against 0.70 (0.65 to 0.75) for the current prompt; wins 31, losses 22, ties 247 on the same cases. Chosen from 20 variants on a separate 100-case tuning set." That sentence is longer than "79 percent", and it is the one that will still be true next month.

Primary references and authorship

Original explanation and synthetic examples by Sandeep Belgavi. Companion code: Sandeep-BA/agent-decision-lab/examples/python/prompt_selection_holdout. Views are my own and do not represent any employer, past or present.