Evaluating LLMs (benchmarks, leaderboards, judges)
NLP metrics, LLM-as-judge, and the test suites that catch regressions before users do.
Why this matters
A senior LLM engineer is judged less by building a model than by measuring it. Wrong metric β wrong fine-tune β wasted GPU-months. The 2026 evaluation landscape is messy: benchmarks leak, judges are biased, Arena scores conflate skills. You need a worldview: which benchmarks tell you what, when LLM-as-judge is okay, and how to design a custom eval that actually measures what your product cares about.
Learning objectives
- Distinguish capability, alignment, safety, and efficiency benchmarks.
- Use
lm-eval-harnessandEleutherAI Eval Harness. - Understand the limitations of MMLU, MT-Bench, and Chatbot Arena.
- Design a custom eval set with
LLM-as-judgeplus rule-based scorers. - Interpret a model card / technical report critically.
1. The evaluation taxonomy
| Category | What it measures | Examples |
|---|---|---|
| Knowledge | Facts, world knowledge | MMLU, MMLU-Pro, GPQA |
| Reasoning | Multi-step logic | GSM8K, MATH, AIME, BBH |
| Code | Coding correctness | HumanEval, MBPP, LiveCodeBench, SWE-bench |
| Long context | Recall over long input | RULER, ZeroSCROLLS, LongBench |
| Instruction following | Doing what you ask | IFEval, MT-Bench |
| Chat quality | Subjective preferences | Chatbot Arena, AlpacaEval 2 |
| Safety / alignment | Harmlessness, refusal | XSTest, ToxicChat, AdvBench |
| Multimodal | Image/audio understanding | MMMU, ChartQA, MathVista |
| Agentic | Tool use, multi-step | TAU-bench, GAIA, AgentBench |
| Efficiency | Speed, cost | tokens/s, time-to-first-token, $/M tokens |
Reporting just "MMLU = 75" is meaningless. Always report a cluster across categories.
2. Knowledge: MMLU and friends
MMLU (Hendrycks 2020)
57 multiple-choice subjects, 4 options each. Score = accuracy. Frontier models hit 85-90+. Was the headline metric for years.
Problems:
- Many leaked answers in pretraining corpora.
- 4-choice MCQ is gameable.
- Subject coverage is uneven.
MMLU-Pro (2024)
Harder, 10-choice, less leakage. Frontier models around 70-80.
GPQA (Rein et al., 2023)
Graduate-level science questions, "Google-proof" β even with web access, the average human takes a long time. Designed to be uncheatable. Frontier models 50-70+.
Reading the leaderboards
Hugging Face's Open LLM Leaderboard v2 aggregates MMLU-Pro, GPQA, MUSR, IFEval, BBH, MATH. Use it as a vibe check, not gospel.
3. Reasoning and math
- GSM8K (Cobbe 2021) β 8.5k grade-school math problems with chain-of-thought solutions. The standard maths benchmark.
- MATH (Hendrycks 2021) β 12.5k high-school competition problems; harder.
- AIME / IMO β olympiad-level. The 2024-2025 frontier (o1, R1) hit dramatic gains here.
- BBH (Suzgun 2022) β Big-Bench Hard subset; 23 reasoning tasks.
- MUSR β multi-step soft reasoning.
4. Code
- HumanEval (Chen 2021) β 164 small Python problems with unit tests. Saturated by 2024 (~95+%).
- MBPP β similar, 1k problems.
- LiveCodeBench β refreshed monthly to avoid contamination; running scores on recent contest problems.
- SWE-bench / SWE-bench Verified β real GitHub issues + test patches. The hardest mainstream coding benchmark.
- Aider's polyglot benchmark β multi-language code editing.
For self-study, run bigcode-evaluation-harness for HumanEval and SWE-bench-Lite.
5. Instruction following
IFEval (Zhou 2023)
Verifiable instruction tests: "respond in exactly 3 paragraphs," "include exactly 5 bullet points," "do not use the letter e." Rule-based scoring. Catches models that say yes but don't follow the instructions.
MT-Bench (Zheng 2023)
80 multi-turn questions; LLM judge (GPT-4) scores each from 1-10. Easy to run; biased by judge.
AlpacaEval 2 / LC AlpacaEval
Length-controlled win-rate vs GPT-4-Turbo as the reference. Less length-bias than MT-Bench.
6. Chatbot Arena
Massive crowdsourced preference battles between anonymous models. Produces an Elo-style ranking. Currently the most respected single signal for chat-model quality, because:
- Real humans, real prompts.
- No fixed eval set to memorise.
- Continuously updated.
Caveats:
- Heavy on conversational / opinion / creative tasks.
- Light on hard reasoning, code, agents.
- Style can dominate substance.
The right way to read it: "this model is preferred in conversational quality." Combine with capability benchmarks.
7. Long context
- RULER (Hsieh 2024) β multi-needle, multi-key, variable-difficulty NIAH variants.
- ZeroSCROLLS β long doc summarisation, QA.
- LongBench / LongBench-V2 β 21 tasks across long context.
- NIAH (gkamradt) β single needle, easiest test.
A model that says "1M context" should pass NIAH at 1M and RULER's harder variants. Many do not.
8. LLM-as-judge β when and how
LLM judges (gpt-4o, claude-sonnet, llama-3.1-70b) are practical for evaluating open-ended output. They have known biases:
- Position bias (slightly prefer A or B; randomise).
- Length bias (prefer longer; length-control).
- Self-preference (judges prefer their own family's outputs).
- Refusal preference (over-reward refusals).
Best practices:
- Use the strongest judge you can afford.
- Use 3-judge majority vote for borderline cases.
- Position-randomise; report robustness.
- Calibrate against human ratings on a small set.
- Use rule-based judges where possible (regex, exact match, code-execution).
JUDGE_PROMPT = """\
You will be shown a question and two responses A and B.
Decide which response is more helpful, accurate, and follows instructions.
If both are equal, prefer the more concise one.
Output JSON: {"choice": "A"|"B"|"tie", "reason": "..."}.
Question: {question}
A: {a}
B: {b}
"""Tools: arena-hard-auto, judges library (Lighteval), weights-and-biases LLM Eval, Promptfoo, OpenAI evals.
9. Custom evals β the most useful kind
Public benchmarks tell you about general capability. Your product demands a custom eval, with these properties:
- Aligned with the user task β sample from real user queries.
- Tracks both correctness and quality β combine rule-based and LLM-judged.
- Includes adversarial / failure cases β long inputs, ambiguous queries, off-topic.
- ~50-200 examples is enough; anything more is ROI-poor early.
- Versioned in git, runnable in CI.
- Cheap to run ($1-10 per evaluation cycle).
Pattern:
class EvalCase(TypedDict):
name: str
input: str
expected: str | None
rubric: str
must_contain: list[str]
must_not_contain: list[str]
def score_one(model, case):
out = model(case["input"])
rule_score = all(s in out for s in case["must_contain"]) and \
all(s not in out for s in case["must_not_contain"])
judge_score = llm_judge(case["rubric"], case["input"], out)
return rule_score, judge_scoreRun on every model checkpoint; gate releases on regressions.
10. Reading a technical report
When a lab releases a model, read the report critically:
- Architectural changes β what is novel? What is "Llama-3 with our data"?
- Training data β provenance, dedup, decontamination claims.
- Compute β total FLOPs / GPU-days; reproducibility?
- Evals β which benchmarks reported, which omitted; few-shot vs zero-shot.
- Comparisons β fair baselines? same compute / data?
- Limitations / risks β usually in a small section near the end.
Key skill: spotting cherry-picked numbers. If a report shows GSM8K but not MATH, or AlpacaEval but not Arena, ask why.
Hands-on lab (4 hours)
eval_lab.ipynb:
- Install
lm-evaluation-harness. Run MMLU onQwen2.5-3B-Instruct. Take ~30 minutes; verify accuracy. - Run IFEval on the same model. Inspect failed cases.
- Implement an LLM-judge using
gpt-4o-minifor 30 of your own prompts. Compute pairwise win-rate againstLlama-3.2-3B-Instruct. - Build a rule-based judge that flags refusals, hallucinated tool calls, and off-topic responses. Combine with LLM-judge.
- Score the same models with position-randomised judging. Compare results β note the difference if any.
- Bonus: contribute a custom eval set (50 prompts) for a real product use case (your own).
Common pitfalls
- Reporting one benchmark only β always cluster across categories.
- Using saturated benchmarks (HumanEval at 95+%) β moves are noise.
- Forgetting decontamination check β your fine-tune may have seen the test set.
- Trusting a single LLM-judge run β high variance; do 3 runs.
- Optimising for a public benchmark β the model overfits to that benchmark's style. Better: optimise for your custom eval.
Self-check
- Why prefer GPQA over MMLU for frontier models?
- Difference between AlpacaEval 2 and Chatbot Arena.
- Three biases of LLM-as-judge?
- What does IFEval test that MT-Bench doesn't?
- What makes a good custom eval set?
References
- Hendrycks et al. (2020), "Measuring Massive Multitask Language Understanding" (MMLU).
- Wang et al. (2024), "MMLU-Pro."
- Rein et al. (2023), "GPQA: A Graduate-Level Google-Proof Q&A Benchmark."
- Cobbe et al. (2021), "Training Verifiers to Solve Math Word Problems" (GSM8K).
- Chen et al. (2021), "Evaluating Large Language Models Trained on Code" (HumanEval).
- Zheng et al. (2023), "Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena."
- Hsieh et al. (2024), "RULER."
- HuggingFace Open LLM Leaderboard v2.
- LMSYS Chatbot Arena.
- Eleuther
lm-evaluation-harness.
Sign in to save your progress and earn badges.