Evaluating LLMs
Benchmarks, arenas, judges — and the eval set that actually matters: yours
You cannot improve what you cannot measure, and with LLMs almost everything is hard to measure: outputs are open-ended, public benchmarks leak into training data, and the cheapest grader — another LLM — has biases of its own. Every later decision (prompt changes 8.4 Prompting as programming, fine-tuning 8.2 Fine-tuning and PEFT, RAG design 9.8 Evaluating and observing LLM apps, agent reliability 10.9 Evaluating agents) is only as good as the evaluation behind it. This lesson gives you the benchmark landscape, the statistics from 1.8 Statistics essentials applied to leaderboards, and a method for building your own evals.
You'll be able to
- Interpret perplexity and explain why it stops tracking usefulness after alignment
- Map the major benchmark families to the capabilities they measure and know which are saturated
- Explain how human-preference arenas produce ratings and what biases they carry
- Design an LLM-as-judge protocol that controls position, verbosity and self-preference bias
- Quantify statistical noise and contamination, and build a task-specific eval set
Key ideas
- Public benchmarks tell you what to try; your own eval set tells you what to ship.
- Perplexity = exp(mean NLL); it tracks pretraining but decouples from usefulness after alignment and is only comparable with the same tokenizer and text.
- Benchmark families cover knowledge (MMLU, GPQA), math (GSM8K, competition sets), code (HumanEval, SWE-bench), long context, multimodal, agents and safety — many are saturated or contaminated.
Show 4 more key ideas
- Arenas turn pairwise human votes into Bradley–Terry ratings; they favor long, well-formatted, confident answers.
- LLM judges are cheap and roughly human-level in agreement, but need position swapping, rubrics, different judge models and calibration against human labels.
- A score is an estimate with SE = √(p(1−p)/n): 200-question benchmarks have confidence intervals of several points.
- Build evals from real inputs, automate deterministic checks first, run on every change, and read your failures.
Suggested path through this lesson
Why evaluation is the hardest part
Classical ML evaluation (3.5 Evaluating models: metrics, validation and the bias–variance trade-off) assumes a label per example and a metric that compares them. LLM outputs are free text; many answers are acceptable; the same question has a different "right" answer depending on audience and format. Meanwhile, public benchmarks saturate within a year or two and leak into pretraining corpora. The consequence is a rule you will hear from every experienced builder: your own eval set is the asset. Public numbers tell you which models to try; only your eval tells you which to ship.
Intrinsic quality: perplexity
For a held-out token sequence of length ,
the exponential of the average cross-entropy (1.9 Information theory: entropy, cross-entropy and KL divergence). Lower is better; it tracks pretraining progress closely and is the quantity scaling laws predict (7.9 Scaling laws and compute-optimal training). But it is only comparable between models with the same tokenizer on the same text, and after instruction tuning and RL it decouples from usefulness: aligned models are often worse language models of the web and far better assistants.
The benchmark landscape
| family | examples | measures | status (2026) |
|---|---|---|---|
| knowledge / exam QA | MMLU (57 subjects, 4-choice), MMLU-Pro, GPQA (graduate-level, "Google-proof") | recall, reading, multi-step QA | MMLU saturated; GPQA still discriminative but tiny |
| math | GSM8K (grade school), MATH, AIME-style competition sets | multi-step quantitative reasoning | GSM8K/MATH saturated by reasoning models; competition sets live |
| code | HumanEval, MBPP, LiveCodeBench, SWE-bench (Verified) | function synthesis vs real repository fixes | HumanEval saturated; SWE-bench is the agentic standard (10.9 Evaluating agents) |
| reasoning / misc | ARC, BIG-Bench Hard, long-context "needle" tests, RULER | abstraction, instruction following, retrieval over long inputs | mixed; long-context tests easy to game |
| multimodal | MMMU, MathVista, DocVQA | image + text understanding | active |
| agents | τ-bench, GAIA, WebArena, OSWorld | tool use, browsing, multi-step tasks | active, noisy (10.9 Evaluating agents) |
| safety | refusal and jailbreak suites, bias (BBQ), truthfulness | harm avoidance, calibration | model-card staples (8.12 Safety, risks and responsible AI) |
The same benchmark gives different numbers under different prompts (zero- vs few-shot, answer letters vs text, chain-of-thought or not) and decoding settings (8.5 Decoding and sampling). Always read the footnotes of an eval table.
Human preference: arenas
Chatbot arenas (LMArena being the best known) show users two anonymous model responses and record a vote. Votes feed a Bradley–Terry model — the same one used to train reward models in 8.3 Alignment: RLHF, PPO, DPO, GRPO and Constitutional AI — producing Elo-like ratings with confidence intervals. Arenas measure what users prefer on the prompts they bring, which is valuable and also biased: longer, well-formatted, confident answers win more; the user population skews technical; and vendors can target the format. Style-controlled ratings partially correct for length and markdown.
LLM-as-judge
Grading with a strong model is cheap and scalable, and the MT-Bench study found that GPT-4-class judges agreed with human experts about as often as humans agreed with each other (roughly 80%). Known biases and their remedies:
- Position bias (preferring the first answer) — evaluate both orders and average or require agreement.
- Verbosity bias — instruct the judge explicitly, and report length alongside scores.
- Self-preference — a model rates its own style higher; use a different judge model, or several.
- Rubric drift — give a concrete rubric and reference answers; ask for a short justification before the score (CoT grading).
- Calibration — hand-label 50–100 items and measure judge–human agreement before trusting the judge at scale.
Pairwise comparison is more reliable than absolute scoring; absolute scores are more convenient for tracking over time. Many teams do both.
Contamination, saturation and noise
Contamination: test items appear in pretraining data (benchmarks are posted online). Detection uses n-gram overlap, canary strings, or checking whether the model can complete the test item verbatim; the structural fix is fresh, regularly refreshed test sets (LiveBench-style) and private evals.
Noise: treat a benchmark score as an estimate of a success probability from trials (1.8 Statistics essentials). The standard error is .
Math check. MMLU has about 14,000 questions: at , , so differences of 0.3 points are within noise. GPQA Diamond has 198 questions: at , — a 95% interval about points wide. Two models "3 points apart" on it may be tied.
Add prompt-format variance and sampling variance, and the honest conclusion is that leaderboards resolve tiers, not ranks.
Building your own eval
- Collect 50–200 real inputs (logs, user interviews, synthetic variations of real cases). Cover the hard and rare cases deliberately.
- Define success per item: an exact answer, a checker (tests, regex, schema), or a rubric with examples of pass/fail.
- Automate scoring: deterministic checks first, judges only where necessary — calibrated as above.
- Run it on every change (prompt, model, retrieval, decoding) and keep the history; a dashboard of per-item results beats a single number.
- Do error analysis by reading failures and grouping them — this, not the aggregate score, tells you what to fix next (Hamel Husain's "look at your data").
- Refresh the set as the product changes; keep a held-out split that nobody tunes against.
Tooling: lm-evaluation-harness and HELM for public benchmarks; promptfoo, Inspect, Braintrust and provider eval suites for custom sets; tracing tools for production (9.8 Evaluating and observing LLM apps).
Where this shows up later
- RAG evaluation adds retrieval metrics and faithfulness — 9.8 Evaluating and observing LLM apps; agent evaluation adds trajectories and compounding error — 10.9 Evaluating agents.
- Fine-tuning and prompt changes are only real when the eval says so — 8.2 Fine-tuning and PEFT, 8.4 Prompting as programming.
- Statistics of estimates come from 1.8 Statistics essentials; classification metrics from 3.5 Evaluating models: metrics, validation and the bias–variance trade-off.
Common pitfalls (4)
- Ranking models by a 1–2 point difference on a small benchmark without confidence intervals.
- Using the same model as generator and judge and trusting the self-preference.
- Letting a benchmark leak into fine-tuning data and reporting the inflated result.
- Optimizing an aggregate score while never reading individual failures.
Recap: all 7 key points
- Public benchmarks tell you what to try; your own eval set tells you what to ship.
- Perplexity = exp(mean NLL); it tracks pretraining but decouples from usefulness after alignment and is only comparable with the same tokenizer and text.
- Benchmark families cover knowledge (MMLU, GPQA), math (GSM8K, competition sets), code (HumanEval, SWE-bench), long context, multimodal, agents and safety — many are saturated or contaminated.
- Arenas turn pairwise human votes into Bradley–Terry ratings; they favor long, well-formatted, confident answers.
- LLM judges are cheap and roughly human-level in agreement, but need position swapping, rubrics, different judge models and calibration against human labels.
- A score is an estimate with SE = √(p(1−p)/n): 200-question benchmarks have confidence intervals of several points.
- Build evals from real inputs, automate deterministic checks first, run on every change, and read your failures.
Watch
The sections on hallucinations, leaderboards and why benchmark numbers must be read skeptically.
Read
Exercises
- Confidence intervals on a leaderboard
Pick three published scores on a 200-question benchmark and three on a 10,000-question one. Compute and 95% intervals. Which differences are statistically meaningful? Expected: most small-benchmark gaps are not.
- Judge calibration
Write a 1–5 rubric for answer quality on 40 questions from a domain you know. Score them yourself, then with an LLM judge in both response orders. Compute agreement (exact and within-one) and position-flip rate. Expected: agreement in the 70–85% range and a measurable position bias.
- Contamination probe
Take 20 public benchmark questions and prompt a model with the first half of each question, asking it to complete the text. Count verbatim or near-verbatim completions. Expected: at least some memorized items for popular benchmarks.
- Build a 50-item eval
For a task you care about, assemble 50 real inputs with expected outputs or rubrics, write a scoring script (exact match or checker, judge for the rest), and compare two models or prompts. Record per-item results and write five lines of error analysis.
Quiz
Flashcards
These cards are now in your spaced-repetition queue. Review all due cards →