Level 3 In-Depth AI · Transformers and Language Models
Evaluating LLMs and Benchmarks
How we measure what language models can do, from multiple-choice exams like MMLU to human preference arenas and LLMs grading other LLMs, and why every benchmark eventually leaks, saturates or gets gamed.
- Level
- ●●●●● Intermediate
- Reading
- 12 min
- To learn it well
- 1 hour to read, an afternoon to practise
- Builds on
- 34 concepts →
- Quiz
- 5 questions ↓
This leads to
—The full path from zero — 34 concepts before this one
- What Is AI?
- Vectors
- Derivatives and Slopes
- Probability Basics
- Python for AI
- How Machines Learn
- Partial Derivatives and Gradients
- Matrices and Matrix Multiplication
- The Chain Rule
- Dot Product, Norms and Similarity
- Tokenization
- Supervised, Unsupervised and Reinforcement Learning
- Gradient Descent
- Language Modeling and Next-Token Prediction
- Supervised Learning
- Linear Regression
- Training, Validation and Test Sets
- The Perceptron
- Logistic Regression
- Evaluation Metrics
- Neural Networks
- Recurrent Neural Networks
- Backpropagation
- Activation Functions
- Vanishing and Exploding Gradients
- Normalization Layers: BatchNorm and LayerNorm
- LSTMs and GRUs
- Residual Connections
- Sequence-to-Sequence Models
- Attention
- Self-Attention and Multi-Head Attention
- Positional Encodings
- The Transformer
- GPT and Decoder-Only Models
- Evaluating LLMs and Benchmarks
Read them roughly in this order. See it on the concept map →
Why it matters
When a new model is released, it arrives with a table of numbers: 88% on this, 62% on that, first place on some leaderboard. Those numbers drive which model companies buy, which research gets attention, and how the public understands progress. But a language model can be asked anything, and its answers are open-ended text. Measuring "how good" it is turns out to be one of the hardest problems in the field.
This chapter covers the main ways LLMs are evaluated (benchmarks with known answers, human preference arenas, and LLMs judging LLMs) and the ways each one fails: contamination, saturation, sensitivity to small details, and Goodhart's law. If you build with LLMs, you will need your own evaluations too (Evaluating LLM Applications). The lessons here apply directly.
The intuition
Think about how we judge people. A multiple-choice exam is cheap and objective but tests a narrow slice of ability, and once the questions leak, it measures memorisation. A job interview is richer but subjective and expensive. A customer review reflects what people actually like, which may be charm more than competence.
LLM evaluation has the same three flavours, with the same strengths and weaknesses:
No single method is enough. Serious evaluation combines several, reports uncertainty, and always asks: does this number measure what I actually care about?
Key idea A benchmark score is an estimate from a sample of questions, under particular prompt and scoring choices, on data the model may have seen. Treat it as evidence, not truth: check the error bars, the setup, and whether the test still discriminates between models.
How it works
Benchmarks with reference answers
A benchmark is a fixed set of tasks with known correct answers and a scoring rule. Some of the most cited:
| Benchmark | Year | What it tests | Scoring |
|---|---|---|---|
| MMLU | 2020 | 57 subjects of multiple-choice exam questions, from high-school maths to law | accuracy |
| GSM8K | 2021 | about 8,500 grade-school maths word problems | exact final answer |
| HumanEval | 2021 | 164 Python functions to write from a docstring | unit tests pass (pass@k) |
| GPQA | 2023 | 448 hard science questions written by PhD experts | accuracy |
| SWE-bench | 2023 | real GitHub issues in Python projects | repository tests pass |
MMLU (Hendrycks et al., 2020) is a good example of how scoring works. Each question has four options, so random guessing scores 25%. GPT-3 (175B, few-shot) scored about 44% in the original paper. A few years later, frontier models scored around 90%, and differences between top models on it became too small to mean much.
For code, the standard metric is pass@k: the probability that at least one of sampled programs passes the hidden tests. With samples per problem of which are correct, an unbiased estimate (from the Codex paper, 2021) is
where is the number of ways to choose items from . For this is simply .
The details that change the score
The same model on the same benchmark can get noticeably different scores depending on choices that seem minor:
- Few-shot evaluation versus zero-shot: are there worked examples in the prompt, and how many?
- Scoring method: compare the model's probabilities for the options "A/B/C/D", or let it write an answer and parse it?
- Prompt wording and formatting, the order of options, the chat template (Instruction Tuning and Chat Models).
- Sampling: greedy decoding or temperature sampling (Decoding: Temperature, Top-k and Top-p); one attempt or majority vote over many.
- Reasoning budget: for Reasoning Models and Test-Time Compute, how long it may think.
That is why comparisons are only fair when everything is run through the same harness with the same settings. Open tools such as EleutherAI's lm-evaluation-harness, Stanford's HELM and the UK AI Security Institute's Inspect exist to make evaluations reproducible.
Uncertainty: scores have error bars
A benchmark is a sample of questions, so its score is an estimate. For accuracy on independent questions, the standard error is , and a 95% confidence interval is about standard errors.
Worked example. A model scores 80% on 500 questions. The standard error is , so the 95% interval is about points. A rival at 78% on the same test is not clearly worse. On GPQA's 198-question "Diamond" subset, the interval at 50% accuracy is about points. Many leaderboard differences are within noise. (Because both models answer the same questions, a paired comparison is more sensitive than comparing two independent intervals, but the point stands.)
Data contamination
Data contamination means the test questions, or their answers, appeared in the model's training data. Benchmarks are published on the web; web text is scraped for Pretraining Large Language Models; so test items leak in, sometimes with their answers. A contaminated model may recall answers rather than work them out, inflating its score.
Ways to detect or reduce it:
- Overlap checks: search the training data for long n-gram matches with test items (the GPT-3 paper did this).
- Canary strings: unique codes embedded in benchmark files so that model trainers can filter them out, and so that a model that can reproduce the canary has evidently seen the data.
- Fresh or private test sets: new questions written after a model's training cutoff (LiveBench, LiveCodeBench), or held-out sets never published. When Scale AI wrote GSM1k (2024), a fresh set of problems in the style of GSM8K, some model families scored noticeably lower on it than on the original, suggesting overfitting to the public set.
- Perturbation: change names and numbers in a problem; real skill transfers, memorised answers don't.
Saturation and Goodhart's law
Benchmark saturation happens when top models score near the ceiling, or near the level of label noise in the benchmark itself, so the test no longer separates them. MMLU, HellaSwag, GSM8K and HumanEval all saturated within a few years of release. The response is harder benchmarks (MMLU-Pro with ten options, GPQA, SWE-bench, FrontierMath, Humanity's Last Exam), which themselves start to saturate.
Behind this is Goodhart's law: "when a measure becomes a target, it ceases to be a good measure." Once a benchmark matters, labs tune data, prompts and training towards it, and the score drifts away from the general ability it was meant to represent. The same dynamic appears as reward hacking in RLHF and Preference Optimization.
Human preference arenas
Some qualities, such as helpfulness, clarity and tone, have no reference answer. Chatbot Arena (LMSYS, launched in 2023, later renamed LMArena and, in January 2026, Arena) collects them at scale: a user types any prompt, two anonymous models answer side by side, and the user votes for the better one. Only after voting are the names revealed.
Votes are turned into a ranking with the Bradley–Terry model, the same model used for reward models in RLHF and Preference Optimization: each model gets a strength , and
The strengths are fitted by maximum likelihood to all the votes and reported on an Elo rating scale borrowed from chess, where a 100-point gap means the higher-rated model is expected to win about 64% of head-to-head comparisons.
Arenas measure what real users prefer on real prompts, which no fixed benchmark does. But they reward style as well as substance (length, formatting, confident tone, flattery), they depend on who the voters are and what they ask, and they can be gamed: a 2025 analysis ("The Leaderboard Illusion") argued that some providers privately tested many model variants and published only the best. The arena added "style control" to adjust ratings for length and formatting.
LLM-as-judge
LLM-as-judge uses a strong model to grade answers, either on a scale ("rate 1 to 10 for helpfulness") or by picking the better of two. It is fast and cheap and handles open-ended outputs. The MT-Bench paper (Zheng et al., 2023) found that GPT-4's judgements agreed with human experts' about as often (over 80%) as the human experts agreed with each other.
But judges have systematic biases, documented in that paper and since:
- Position bias: preferring the first (or second) answer shown. Fix: judge both orders and average.
- Verbosity bias: preferring longer answers.
- Self-preference: favouring outputs that resemble the judge's own style or come from its own family.
- Limited ability: a judge can't reliably grade answers to questions it can't solve itself, such as hard maths. Give it a reference answer or use a checker instead.
Clear rubrics, reference answers, swapped order, and spot checks against human labels make judges much more trustworthy.
In code
Two small calculations every evaluator should be able to do: a confidence interval for a benchmark score, and a Bradley–Terry arena ranking from pairwise votes.
import numpy as np
rng = np.random.default_rng(0)
# 1) A benchmark score is an estimate: report it with an error bar
def accuracy_with_ci(correct):
p, n = correct.mean(), len(correct)
se = np.sqrt(p * (1 - p) / n) # standard error of a proportion
return p, 1.96 * se # 95% confidence half-width
a = rng.random(500) < 0.80 # model A: truly right ~80% of the time
b = rng.random(500) < 0.77 # model B: truly ~77%
for name, res in [("A", a), ("B", b)]:
p, h = accuracy_with_ci(res)
print(f"model {name}: {100*p:.1f}% ± {100*h:.1f}")
# 2) An arena: rank models from pairwise votes with a Bradley-Terry model
true_strength = {"model-x": 1.0, "model-y": 0.5, "model-z": 0.0}
names = list(true_strength)
battles = []
for _ in range(3000):
i, j = rng.choice(3, 2, replace=False)
p_i = 1 / (1 + np.exp(-(true_strength[names[i]] - true_strength[names[j]])))
battles.append((i, j) if rng.random() < p_i else (j, i)) # (winner, loser)
s = np.zeros(3)
for _ in range(2000): # gradient ascent on the log-likelihood
grad = np.zeros(3)
for w, l in battles:
p = 1 / (1 + np.exp(-(s[w] - s[l])))
grad[w] += 1 - p; grad[l] -= 1 - p
s += 0.5 * grad / len(battles)
elo = 1000 + 400 / np.log(10) * (s - s.mean()) # the familiar Elo-style scale
for n, e in sorted(zip(names, elo), key=lambda t: -t[1]):
print(f"{n}: {e:.0f}")
# model A: 76.6% ± 3.7
# model B: 78.0% ± 3.6
# model-x: 1096
# model-y: 996
# model-z: 909
Look at the first two lines. Model A is truly the better model (80% versus 77%), yet on this sample of 500 questions it scored lower. The intervals overlap heavily. That happens all the time with real benchmarks. In the arena part, the fitted ratings recover the true ordering and roughly the true gaps (a strength difference of 0.5 corresponds to about 87 Elo points).
For real models, run standard benchmarks with lm-evaluation-harness, for example lm_eval --model hf --model_args pretrained=Qwen/Qwen2.5-0.5B-Instruct --tasks gsm8k --num_fewshot 5 (this downloads the model and dataset).
Common pitfalls
- Comparing numbers from different setups. Scores from different papers often use different prompts, shots and scoring. Rerun under one harness.
- Ignoring error bars. A one- or two-point difference on a few hundred questions is usually noise.
- Trusting a single number. A model can top one leaderboard and be poor at your task. Look at many evaluations, and build your own (Evaluating LLM Applications).
- Assuming a benchmark measures what its name says. Read some of the questions. Many benchmarks contain mislabelled items, ambiguous questions or shortcuts.
- Evaluating with the same model family that generated your training data or answers. Self-preference and shared blind spots inflate scores.
Watch out Never tune prompts, data or model choices on your test set and then report results on it. You will overfit it just as models overfit public benchmarks. Keep a held-out set that you look at rarely (Training, Validation and Test Sets).
Where it leads
- Evaluating your own application: test sets from real traffic, rubrics, automated checks and human review: Evaluating LLM Applications.
- Factuality and hallucination need their own measures: Hallucinations.
- Safety evaluations (dangerous capabilities, refusals, bias) are a field of their own: AI Risks and Safety, Bias and Fairness.
- Reasoning and agents are evaluated with long, multi-step tasks such as SWE-bench: Reasoning Models and Test-Time Compute, AI Agents.
- Tracking progress over time: organisations such as Epoch AI and the Stanford AI Index publish trend data across benchmarks (Staying Current).
A bit of history
NLP evaluation started with task-specific metrics such as BLEU for translation (2002) and suites such as GLUE (2018) and SuperGLUE (2019), which BERT-era models saturated within about a year. GPT-3 (2020) shifted evaluation to few-shot prompting across dozens of tasks. In late 2020 Dan Hendrycks and colleagues released MMLU, which became the headline number for the next few years, alongside Google's crowd-sourced BIG-bench (2022) and Stanford's HELM (2022), which argued for measuring many metrics (calibration, robustness, fairness, efficiency) beyond accuracy.
In 2023, LMSYS launched Chatbot Arena and published MT-Bench with its study of LLM judges, and preference-based evaluation went mainstream. As models saturated the older tests, harder ones followed: GPQA (2023), SWE-bench (2023, and the human-validated SWE-bench Verified subset in 2024), FrontierMath (2024) and Humanity's Last Exam (2025). Each cycle repeats the same story: a benchmark is built to be hard, becomes a target, and is saturated faster than its authors expected.
Try it
- A model scores 62% on GPQA Diamond (198 questions). Compute its 95% confidence interval. Could a model scoring 58% be equally good?
- In the code, change both models to 1,000 questions and then 10,000. At what size does model A reliably score above model B?
- Using the Elo scale in the code, convert a 200-point rating gap into a win probability.
Hint for 3: a gap of Elo points means a strength difference of ; plug that into the logistic function.
Learn more
Hand-picked courses, books, videos and tutorials for going deeper. See all resources →
Measuring Massive Multitask Language Understanding (MMLU)
The 57-subject multiple-choice exam that became the default headline benchmark for LLMs from 2021 to about 2024.
Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena
Shows strong LLMs agree with human preferences about as often as humans agree with each other, and catalogues judge biases (position, verbosity, self-preference).
Chatbot Arena: An Open Platform for Evaluating LLMs by Human Preference
Crowdsourced pairwise battles between anonymous models, turned into a ranking with a Bradley-Terry model.
Language Model Evaluation Harness
An open-source framework for running hundreds of standard benchmarks on any model in a reproducible way.
Holistic Evaluation of Language Models (HELM)
Evaluates many models on many scenarios and many metrics (accuracy, calibration, robustness, fairness, efficiency) under one standard setup.
GPQA: A Graduate-Level Google-Proof Q&A Benchmark
Hard science questions written by PhD experts that non-experts with web access still mostly get wrong.
SWE-bench: Can Language Models Resolve Real-World GitHub Issues?
Real GitHub issues from Python projects, scored by whether the model's patch makes the project's tests pass.
Epoch AI
Data and research on trends in AI compute, data, models and hardware.
Facts checked as of 30 November 2026. Fast-moving details (products, prices, laws) change often. · Source: content/entries/llm/llm-evaluation.md