- Archived full text: Full archived text, with credits
- Link: https://dev.to/maya_andersson_dev/calibration-set-size-for-llm-as-judge-when-50-traces-is-enough-and-when-200-is-mandatory-d1d
What it says
The author explains that the human-labeled calibration set for an LLM-as-judge does not have a fixed size; the right size depends on the label marginals. Roughly balanced binary criteria with no heavy tail need ~50 stratified traces for a kappa interval within about plus-minus 0.10 to 0.15. Rare-but-expensive classes (e.g. safety violations at 6% base rate) need 200 or more, because the number of minority-class examples drives kappa variance. He recommends decomposing ordinal scales into binary criteria, reporting Wilson intervals on small per-class counts instead of normal approximations, using bootstrap kappa intervals, stratifying across weekly time windows with oversampling of rare classes, and McNemar’s test for paired comparisons.
Claims drawn from this source
- Balanced binary criteria need about 50 stratified traces. For a roughly balanced binary label (each class in the 30-70% range) with no rare tail, 50 stratified traces usually pin Cohen’s kappa to within a bootstrap interval of about plus or minus 0.10 to 0.15.
- Rare-but-expensive classes need 200+ traces. At a 6% base rate, 50 traces contains about three minority examples in expectation; 200 gives about 12 and 400 about 24. Pick the rarest class, decide how many minority examples you need, then back out the total n from the base rate.
- Class imbalance is what collapses kappa’s denominator. When one class is rare (a near 0.95), chance agreement p_e pushes close to 1, the denominator collapses toward zero, and kappa becomes a ratio of two small numbers. Kappa is not broken on imbalanced data; it is higher-variance and you pay with sample size.
- Ordinal scales hide the problem; decompose into binary criteria. A 5-class Likert scale gave kappa 0.47 with a wide bootstrap interval on 80 examples; splitting the same traces into three binary criteria (factually supported, relevant, complete) gave kappa 0.78 on 50 examples.
- Use Wilson intervals, not the normal approximation, on small per-class counts. The normal approximation fails exactly when you need it most (small counts, proportions near 0 or 1), producing intervals that run below zero or above one; Wilson stays inside [0, 1] and centers on a value pulled toward 0.5.
- Stratify across time windows to detect drift. Naive sampling breaks over time: a factual-accuracy judge went from kappa 0.61 on dev to 0.39 three weeks later after the input distribution shifted. Pull traces in weekly strata, sample within each week proportionally, and oversample rare classes so a kappa outside last week’s interval is a drift signal.
- Judge performance claims without uncertainty are noise rounded to two decimals. Reporting ‘the judge has 0.81 recall on hallucinations’ from a sample with seven hallucinations is noise, not measurement. Bootstrap the variance and quote the percentile CI; resample pairs, not labels.
- Use McNemar’s test for paired judge-prompt comparisons. When you changed the judge prompt and want to know whether agreement improved on the same traces, McNemar’s test looks only at the discordant pairs and tests whether the split between the two kinds of disagreement is significant.