Forty scenarios with ten variants each: the naive 95 percent interval covered the true pass rate 78 percent of the time. Design effect, cluster-robust intervals and pairing.
Four hundred rows, forty scenarios
Tanishka builds the evaluation set for the help-desk agent at Belgavi's Book Store. To make the set harder to game, each of 40 scenarios (a late return, a damaged parcel, a duplicate charge, and so on) is written ten ways: different phrasing, a different customer tone, an extra irrelevant detail. That gives 400 rows, and the latest run passes 275 of them, 68.8 percent.
The reporting script prints a 95 percent interval of 64.2 to 73.3 percent, the usual binomial interval for 400 independent trials. The next model version scores 72 percent, inside the old interval but close to its edge, and someone asks whether that is a real improvement.
The interval is the problem. The 400 rows are not 400 independent trials. Variants of the same scenario tend to pass or fail together, because the thing being tested, whether the agent handles a damaged-parcel CASE correctly, is the same in all ten. The real number of independent observations is much closer to 40 than to 400, and the honest interval for this run is 61.5 to 76.0 percent: more than one and a half times as wide.
Measuring it on a seeded simulation
The companion simulates the situation exactly. Each of 40 scenarios gets a pass probability drawn from a beta distribution with mean 0.7 and concentration 4, which implies a true rho of 1 / (4 + 1) = 0.2. Each scenario then has ten variants that pass independently with that scenario's probability.
One simulated run gives:
| Quantity | Value |
|---|---|
| Pass rate | 0.688 |
| Estimated rho (one-way ANOVA) | 0.174 |
| Design effect | 2.57 |
| Effective rows | 156 |
| Naive normal interval | 0.642 to 0.733 |
| Wilson interval | 0.640 to 0.731 |
| Cluster-robust interval | 0.615 to 0.760 |
| Cluster bootstrap interval | 0.613 to 0.755 |
The naive and Wilson intervals agree with each other, and both are too narrow. The Wilson interval fixes a different problem, poor behaviour near 0 or 1 for small samples; it does nothing about correlation.
One run cannot show that an interval is wrong. The coverage check can: repeat the whole experiment 500 times and count how often each 95 percent interval contains the true mean pass probability, 0.7.
| Design | Naive | Wilson | Cluster-robust | Cluster-robust with t | Cluster bootstrap |
|---|---|---|---|---|---|
| 40 scenarios x 10 variants, rho 0.2 | 0.776 | 0.766 | 0.938 | 0.940 | 0.936 |
| 400 scenarios x 1 variant | 0.948 | 0.942 | 0.948 | 0.948 | 0.950 |
| 10 scenarios x 40 variants, rho 0.2 | 0.478 | 0.472 | 0.902 | 0.940 | 0.896 |
With independent rows every method is close to 95 percent, as it should be. With ten variants per scenario, the naive 95 percent interval covers the truth only about 78 percent of the time. With 10 scenarios of 40 variants, it covers it less than half the time: the interval is about as wide as before, because it still sees 400 rows, but the information is that of a few dozen.
Three ways to compute an honest interval
Cluster-robust standard error. With equal cluster sizes, compute each scenario's pass rate, take the standard deviation of those scenario means, and divide by the square root of the number of scenarios. That is the standard error of the overall mean, and it already includes the between-scenario variation.
import math
def cluster_robust_interval(clusters, z=1.96):
k = len(clusters)
means = [sum(c) / len(c) for c in clusters]
p = sum(means) / k
var = sum((m - p) ** 2 for m in means) / (k - 1)
se = math.sqrt(var / k)
return p - z * se, p + z * seWith unequal cluster sizes, use the general clustered (sandwich) estimator that weights clusters by size; most statistics packages provide it.
Use a t value with few clusters. The standard error is estimated from k scenarios, so with small k the normal 1.96 is too small. With 10 scenarios the t critical value for 9 degrees of freedom is 2.262, and the table shows it raises coverage from 0.902 to 0.940.
Cluster bootstrap. Resample whole scenarios with replacement, recompute the pass rate each time and take the 2.5th and 97.5th percentiles. Resampling rows instead of scenarios would reproduce the naive interval, so the unit of resampling is the whole point. The bootstrap has the same small-k weakness as the plain robust interval: 0.896 coverage with 10 scenarios.
Comparing two model versions
The same correction applies to differences. When two versions run on the same scenarios, compute the difference per scenario (version B's pass rate minus version A's on that scenario's variants), then take the mean and standard error of those differences. Pairing by scenario removes the scenario difficulty from the comparison and usually narrows the interval a lot, while still respecting the clustering. Comparing two independent row-level proportions does neither.
For Tanishka's question, the move from 68.8 to 72 percent is a difference of about 3 points with a cluster-robust standard error of roughly 3.7 points per run before pairing. That is not evidence of improvement on its own. A paired per-scenario comparison is the right next step.
More scenarios or more variants
The design effect also tells you how to spend an evaluation budget. With rho = 0.2 and a budget of 400 rows:
| Design | DEFF | Effective rows |
|---|---|---|
| 400 scenarios x 1 variant | 1.0 | 400 |
| 80 scenarios x 5 variants | 1.8 | 222 |
| 40 scenarios x 10 variants | 2.8 | 143 |
| 10 scenarios x 40 variants | 8.8 | 45 |
Variants are not useless: they test robustness to phrasing, which a single wording cannot, and they let you measure rho at all. But each new scenario adds far more information about the pass rate than another variant of an existing one. A reasonable default is a few variants per scenario and as many scenarios as you can write well.
A checklist for eval reports
- Record the cluster of every row: the scenario id, the source document, the conversation.
- Report the number of clusters next to the number of rows.
- Estimate rho for each run and report the design effect.
- Use cluster-robust intervals or a cluster bootstrap, with a t value when there are fewer than about 30 clusters.
- Compare versions per cluster, paired.
- Treat grader repeats separately. If each output is graded several times, those repeats are another level of clustering; average them per output first.
Limits
The simulation assumes equal cluster sizes, a beta distribution of scenario difficulty and variants that are independent within a scenario. Real evaluation sets have unequal clusters, variants that differ in difficulty in structured ways, and graders with their own noise. The coverage numbers come from 500 simulated repetitions each and carry their own sampling error of about one percentage point. The method, not the exact numbers, is the point.