Evaluating Language Models
Benchmarks, contamination and human judgment.
A benchmark score is an estimate from a finite sample, of a quantity that may not be the one you care about, computed on a model that may have seen the test. Each of these gaps has its own mathematics: sampling variance, contamination detection, and the statistics of pairwise judgments by people and by models.
What you’ll learn
- Compute standard errors for benchmark scores, including repeated sampling and clustered items, and judge when a difference between models is real.
- Define contamination, compare n-gram and likelihood-based detection, and frame membership inference with the Neyman–Pearson lemma.
- Fit Bradley–Terry ratings to pairwise votes, prove when the maximum-likelihood estimate exists, and show that Elo updates are stochastic gradient steps on the same likelihood.
- Identify the documented biases of LLM judges, and the design principles of holistic evaluations such as HELM.
A score is an estimate
Treat a benchmark as a sample of items from a population of possible questions. Item is answered correctly with probability , random when the model samples at temperature . The reported accuracy averages graded samples per item, , and its variance has two sources (Miller, 2024):
Items are often not independent: several questions about one passage, or variants of one template, form clusters. With clusters of size and intra-cluster correlation , the variance is inflated by the design effect (Kish, 1965), and the naive standard error is too small. To compare two models, score them on the same items and use a paired test (Experimental Design & Statistical Testing); for what adaptive reuse of a test set does to these intervals, see Measuring Intelligence & AGI.
A model scores 80% on independent items, each graded once. What is the half-width of the normal-approximation 95% confidence interval, in percentage points?
Show the answer
2.5 points
. Two models 2 points apart on such a benchmark are not clearly different from their scores alone; a paired analysis on the same items does better, because the two models tend to fail on the same hard items.
Scores also move with choices that are not about the model: prompt format, few-shot examples, answer extraction, decoding settings. Sclar et al. (2024) found large accuracy swings across semantically equivalent prompt formats. A score reported without its prompt, decoding settings and grader is half a measurement.
Contamination
With access to the training data, the standard check is overlap. GPT-3 flagged test items sharing any 13-gram with the training set (Brown et al., 2020); the GPT-4 report searched for three random 50-character substrings of each item (OpenAI, 2023). Overlap misses paraphrases and translations: rephrased test items passed n-gram decontamination yet still inflated the scores of models trained on them (Yang et al., 2023). Benchmarks can protect themselves with canary strings that training pipelines filter out (BIG-bench embeds one), private held-out sets, and items written after a model's training cutoff.
Without the training data, detecting contamination is a membership inference problem: decide from the model alone whether a text was trained on. Every method computes a statistic from the model's likelihoods and thresholds it: the loss itself (Yeom et al., 2018); the loss relative to a reference model or to zlib compression (Carlini et al., 2021); or Min-K% Prob, the average log-probability of the least likely tokens (Shi et al., 2024). What is the best possible such test?
In practice and are unknown, and likelihood-based statistics are rough proxies for , confounded by how predictable a text is in the first place; a reference model or a compressor partly corrects for that. Careful evaluations found membership inference on large pretraining corpora close to chance in many settings, partly because earlier benchmarks drew members and non-members from different time periods, so detectors learned the date rather than membership (Duan et al., 2024). Time-split evaluation, comparing performance on items published before and after a model's training cutoff, is often more informative.
Pairwise preference: Bradley–Terry and Elo
Open-ended answers have no reference answer, so many evaluations ask people which of two anonymous responses is better and aggregate the votes. Chatbot Arena (Zheng et al., 2023; Chiang et al., 2024) crowdsources such battles on users' own prompts. The aggregation model is again Bradley–Terry: model has a strength and , usually reported on the Elo scale , on which a 400-point gap means 10-to-1 odds.
is concave, because is, and unchanged by , so fix :
Necessity. If some beat but never lost to it, raise every with by : the terms for wins of over increase toward 0 and no term decreases, so the likelihood keeps rising and no maximizer exists. If and never met, is flat in that direction and the maximizer is not unique.
Sufficiency. For a direction , , let be the indices where is largest. Some beat some , and that term tends to along while no term is positive. So is coercive on the hyperplane and attains its maximum, and the Hessian is negative definite there when the comparison graph is connected, so the maximizer is unique:
One game between and , with if wins and otherwise, contributes
Take one stochastic gradient step of size on this game and rewrite it on the Elo scale, where the expected score is :
This is Elo's rating rule (Elo, 1978). With a constant step it never settles: final ratings depend on the order of the games and keep fluctuating. A batch maximum-likelihood fit uses all games at once, ignores their order and pairs naturally with bootstrap confidence intervals, and arena leaderboards moved to it for these reasons (Chiang et al., 2024).
Two models differ by 100 Elo points. What is the probability that the higher-rated one wins a battle, in percent?
Show the answer
64 %
. Gaps of a few dozen points mean the "better" model wins little more than half of head-to-head votes, which is why confidence intervals belong next to every rating.
Bradley–Terry assumes a single scalar strength. Votes also depend on style: longer and more heavily formatted answers win more often, so arena analyses add length and formatting as covariates in the logistic regression to estimate style-controlled strengths. The voters and their prompts are self-selected, so a rating measures preference on that traffic, not overall quality, and critics have argued that private testing of many model variants before public release biases arena rankings (Singh et al., 2025).
Language models as judges, and holistic evaluation
Human votes are slow, so strong models serve as judges: given a question and two answers, or one answer and a rubric, they output a verdict. Zheng et al. (2023) found that strong LLM judges agreed with human preferences over 80% of the time, about as often as humans agreed with each other, and documented three biases: position bias (favoring the answer shown first, or second), verbosity bias (favoring longer answers) and self-enhancement bias (favoring answers written by the judge itself). Judges were also unreliable at grading math and reasoning they could not do themselves.
Model the judge's probability of preferring answer A as when A is shown first and when it is shown second, with true quality gap and position bias . Judge both orders and average:
The term linear in cancels, and for equally good answers the average is exactly by symmetry. Pairs whose verdict flips under the swap are usually recorded as ties.
Other mitigations: grade against a reference answer, ask for reasoning before the verdict, use several judges from different model families, and calibrate judges against held-out human labels. A judge that is optimized against becomes a reward model, with the same overoptimization dynamics (RLHF & Preference Optimization).
HELM (Liang et al., 2022) argued that single accuracy numbers on a few datasets hide most of what matters. It evaluated many models under the same conditions on a grid of scenarios (use cases) and metrics: accuracy, calibration, robustness, fairness, bias, toxicity and efficiency. Before HELM, the models it covered had on average been evaluated on 17.9% of its core scenarios, often with incomparable prompts; HELM raised that to 96.0%.
| Method | Measures | Main threats |
|---|---|---|
| Reference-based benchmarks (multiple choice, exact match, unit tests) | capability on fixed tasks | contamination, saturation, prompt sensitivity |
| Pairwise human preference | perceived quality on real prompts | style effects, self-selected traffic, cost |
| LLM as judge | a scalable approximation of human judgment | position, verbosity and self-enhancement biases; limited skill on hard items |
| Red-teaming and safety evaluations | failure modes under adversarial use | coverage, and targets that move as models change |
Key takeaways
- A benchmark score is an estimate: , inflated by clustered items; compare models on the same items with paired tests.
- Contamination turns generalization into recall. N-gram checks miss paraphrases, and without training data membership inference is limited by Neyman–Pearson: likelihood scores are noisy proxies for an unknown likelihood ratio.
- Pairwise votes are aggregated with Bradley–Terry; the MLE exists iff the win graph is strongly connected, and Elo is constant-step stochastic gradient ascent on the same likelihood.
- LLM judges scale human judgment but show position, verbosity and self-enhancement biases; judging both orders cancels position bias to first order. Holistic evaluation (HELM) reports many metrics under standardized conditions.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
A benchmark has items, and you grade samples per item instead of one. Which part of the score's variance does that reduce?
- Both parts, by a factor of 10
- Only the within-item sampling term ; the between-item term needs more items
- Only the between-item term
- Neither: resampling reduces bias, not variance
Show the answer
B. Only the within-item sampling term ; the between-item term needs more items
. More samples average away the model's sampling noise on each item, but the benchmark is still only 500 draws from the population of questions.
A test set was decontaminated by removing every item that shares a 13-gram with the training data. What contamination can remain?
- Paraphrases, translations and reformatted copies of test items
- None: 13-gram overlap catches all leakage
- Only items whose answers are numbers
- Only multiple-choice items
Show the answer
A. Paraphrases, translations and reformatted copies of test items
Exact n-gram matching misses anything reworded. Rephrased test sets passed such filters and still inflated scores when trained on, which is why semantic and time-split checks complement overlap.
In an arena, model A has won every one of its battles against the other models. What happens to its Bradley–Terry maximum-likelihood rating?
- It is finite: simply the highest rating
- It equals the average rating
- It is undefined only if A played fewer than 10 battles
- It diverges to : the win graph is not strongly connected, so no finite maximizer exists
Show the answer
D. It diverges to : the win graph is not strongly connected, so no finite maximizer exists
Take : A never lost to the rest, so raising always increases the likelihood. Practical fits add a weak prior (an penalty) or pseudo-games, which makes the estimate finite but dependent on the prior.
An LLM judge prefers answer A when A is shown first, and answer B when B is shown first. What is the best reading?
- A is better
- B is better
- The verdict follows position, not quality: treat it as a tie or inconclusive
- The judge is broken, and all of its verdicts should be discarded
Show the answer
C. The verdict follows position, not quality: treat it as a tie or inconclusive
Under the model , a verdict that follows position means the position bias outweighs the quality gap : the judge cannot reliably separate these answers. Judging both orders and averaging cancels the bias to first order.
Further reading
- R. A. Bradley & M. E. Terry, "Rank analysis of incomplete block designs: I. The method of paired comparisons," Biometrika 39 (1952).
- L. Zheng et al., "Judging LLM-as-a-judge with MT-Bench and Chatbot Arena," NeurIPS Datasets and Benchmarks Track (2023).
- W.-L. Chiang et al., "Chatbot Arena: An open platform for evaluating LLMs by human preference," ICML (2024).
- P. Liang et al., "Holistic evaluation of language models," Transactions on Machine Learning Research (2023); arXiv:2211.09110 (2022).
- W. Shi et al., "Detecting pretraining data from large language models," ICLR (2024).