Sub topic 13
Reporting judge metrics with confidence intervals
This chapter assumes you can read Python, know what a pass rate is, and have a judge that returns a pass or fail verdict for each item in an evaluation set.
Why a single number misleads
Say your judge passes 70% of answers. That figure comes from a limited sample of inputs. A different sample of the same size from the same system would give a different rate. If you compare two prompt versions at 70% and 74% and the set has 50 items, the gap may be noise.
A confidence interval states the range of pass rates that the data supports. It makes the uncertainty visible, so readers can see when a difference is too small to act on.
A bootstrap interval
The percentile bootstrap needs no formulas. You resample your verdicts with replacement many times, compute the pass rate each time, and read off the middle 95% of those rates.
import random
def bootstrap_ci(passes, n_boot=2000, alpha=0.05, seed=0):
rng = random.Random(seed)
n = len(passes)
rates = sorted(sum(rng.choices(passes, k=n)) / n for _ in range(n_boot))
lo = rates[int((alpha / 2) * n_boot)]
hi = rates[int((1 - alpha / 2) * n_boot) - 1]
return lo, hi
print(bootstrap_ci([1, 1, 0, 1, 1, 0, 1, 1, 1, 0] * 5))The input has 50 verdicts and a pass rate of 0.70. The printed interval will be close to 0.57 to 0.83. Fixing seed makes the result repeatable, so report it alongside the data.
How set size changes the width
Interval width shrinks with the square root of the sample size. For a pass rate near 0.70, the approximate 95% half-width is:
| Items | Half-width |
|---|---|
| 50 | about 0.13 |
| 200 | about 0.06 |
| 800 | about 0.03 |
Quadrupling the set size only halves the width. Detecting a 2-point improvement therefore needs far more items than detecting a 10-point one.
Comparing two systems
Overlapping intervals are a rough guide, not a test. When both systems are judged on the same items, resample item indices and compute the difference in pass rates on each resample. If the 95% interval of that difference excludes zero, the gap is unlikely to be sampling noise. Using the same items for both systems is the better design because it cancels out differences in item difficulty.
What to report
- The pass rate and its 95% interval, for example "0.70 (0.57 to 0.83)".
- The number of items.
- The judge model and version, and the rubric version.
- The kappa against human labels, from the earlier validation step.
If the judge is nondeterministic, run it several times per item and either average the verdicts per item or include each run in the resample. Otherwise the interval understates the variance.
Exercise
Version A passes 36 of 50 items. Version B passes 40 of 50 items, on the same items. A teammate says B is clearly better. What would you do before agreeing, and what does the interval not tell you?
Show answer
Compute the paired bootstrap interval for the difference in pass rates by resampling item indices and taking each item's A and B verdicts together. A gap of 4 items out of 50 (8 points) is likely inside the noise at this size, so B is probably not clearly better unless the interval excludes zero. Even if it does, the interval says nothing about judge bias or disagreement with humans, so check kappa against human labels too.