◆ AI All-in-One

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
↗ Plan a path here

Read first

GPT and Decoder-Only ModelsEvaluation Metrics

This leads to

—
The full path from zero — 34 concepts before this one
  1. What Is AI?
  2. Vectors
  3. Derivatives and Slopes
  4. Probability Basics
  5. Python for AI
  6. How Machines Learn
  7. Partial Derivatives and Gradients
  8. Matrices and Matrix Multiplication
  9. The Chain Rule
  10. Dot Product, Norms and Similarity
  11. Tokenization
  12. Supervised, Unsupervised and Reinforcement Learning
  13. Gradient Descent
  14. Language Modeling and Next-Token Prediction
  15. Supervised Learning
  16. Linear Regression
  17. Training, Validation and Test Sets
  18. The Perceptron
  19. Logistic Regression
  20. Evaluation Metrics
  21. Neural Networks
  22. Recurrent Neural Networks
  23. Backpropagation
  24. Activation Functions
  25. Vanishing and Exploding Gradients
  26. Normalization Layers: BatchNorm and LayerNorm
  27. LSTMs and GRUs
  28. Residual Connections
  29. Sequence-to-Sequence Models
  30. Attention
  31. Self-Attention and Multi-Head Attention
  32. Positional Encodings
  33. The Transformer
  34. GPT and Decoder-Only Models
  35. 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:

Benchmarksfixed questions, known answers Q: 2 + 2 × 3 = ?A) 8 B) 12 ✓ A + strengths cheap, repeatable objective scoring − weaknesses narrow skills leaks into training data saturates Human arenapeople vote on two answers answer 1 | answer 2user prefers: 2 + strengths real prompts captures helpfulness − weaknesses slow, costly rewards style, length voters ≠ your users LLM-as-judgea strong model grades judge: answer B isbetter; score 8/10 + strengths fast, cheap, scalable handles open answers − weaknesses position, length bias favours its own style can't grade beyond itself
Fig. 1 Three ways to evaluate a language model. Benchmarks with reference answers are cheap and repeatable but narrow and can leak into training data. Human preference arenas capture what people like but reward style and are slow. LLM judges scale cheaply but inherit biases of their own.

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 kk sampled programs passes the hidden tests. With nn samples per problem of which cc are correct, an unbiased estimate (from the Codex paper, 2021) is

pass@k=1−(n−ck)(nk)\text{pass@}k = 1 - \frac{\binom{n-c}{k}}{\binom{n}{k}}

where (ab)\binom{a}{b} is the number of ways to choose bb items from aa. For k=1k = 1 this is simply c/nc/n.

The details that change the score

The same model on the same benchmark can get noticeably different scores depending on choices that seem minor:

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 pp on nn independent questions, the standard error is p(1−p)/n\sqrt{p(1-p)/n}, and a 95% confidence interval is about ±1.96\pm 1.96 standard errors.

Worked example. A model scores 80% on 500 questions. The standard error is 0.8×0.2/500=0.00032=0.0179\sqrt{0.8 \times 0.2 / 500} = \sqrt{0.00032} = 0.0179, so the 95% interval is about 80%±3.580\% \pm 3.5 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 ±7\pm 7 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 mm gets a strength sms_m, and

P(model i beats model j)=11+e−(si−sj)P(\text{model } i \text{ beats model } j) = \frac{1}{1 + e^{-(s_i - s_j)}}

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.

3,000 anonymous votesBradley–Terry fitratings (95% bootstrap interval) model-x ✓ model-y vs model-y ✓ model-z vs model-x ✓ model-z vs model-z ✓ model-y vs model-y ✓ model-x vs model-x ✓ model-z vs … ✓ = the answer the user preferred P(i beats j) =σ(sᵢ − sⱼ)fit s by max likelihood model-x 1096 model-y 996 model-z 909 900 1000 1100 Elo-style rating (simulated votes)
Fig. 2 Pairwise battles in an arena are converted into ratings. Each vote is a comparison between two anonymous models; a Bradley–Terry model turns many such votes into one strength score per model, shown on an Elo-style scale with confidence intervals.

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

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

  1. A model scores 62% on GPQA Diamond (198 questions). Compute its 95% confidence interval. Could a model scoring 58% be equally good?
  2. 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?
  3. Using the Elo scale in the code, convert a 200-point rating gap into a win probability.

Hint for 3: a gap of DD Elo points means a strength difference of Dln⁡(10)/400D \ln(10)/400; plug that into the logistic function.

Check your understanding

5 quick questions. Pick an answer to see whether you were right and why. Your best score is saved on this device.

  1. Model A scores 80% and model B 78% on the same 500-question benchmark. What should you conclude?

  2. A model family scores much lower on GSM1k, a fresh set of similar problems, than on the public GSM8K. What is the likely explanation?

  3. You use a strong LLM to judge which of two answers is better, always showing your model's answer first. What bias should you correct?

  4. Top models all score about 90% on a benchmark, close to its label-noise ceiling. What is this called?

  5. In Chatbot Arena, model X is rated 100 Elo points above model Y. What does that mean?

Finished this chapter?

Learn more

Hand-picked courses, books, videos and tutorials for going deeper. See all resources →

Paper

Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena

Zheng et al. (LMSYS) · 2023 · Intermediate · Free

Shows strong LLMs agree with human preferences about as often as humans agree with each other, and catalogues judge biases (position, verbosity, self-preference).

Tool

Language Model Evaluation Harness

EleutherAI · Intermediate · Free

An open-source framework for running hundreds of standard benchmarks on any model in a reproducible way.

Paper

Holistic Evaluation of Language Models (HELM)

Liang et al. (Stanford CRFM) · 2022 · Intermediate · Free

Evaluates many models on many scenarios and many metrics (accuracy, calibration, robustness, fairness, efficiency) under one standard setup.

Article

Epoch AI

Epoch AI · Intermediate · Free

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