AI State of the Art
MLOps/LLMOps/43 min
Section 196

Building and Running Your Own Evaluation

Listen as a podcast →

What this page does, and what it does not repeat

Three lessons already cover how to read published scores, and this page does not repeat them:

  • How to read a benchmark score gives the full checklist: what a measurement protocol does to a number, the choice of comparison, the exact model version, who produced the figure, and ten questions to ask of any announcement.
  • Why benchmarks lie about real capability covers contamination, saturation, and score-chasing in detail.
  • Measuring a ranking covers recall@K, precision@K, MRR and NDCG, which apply the moment a system returns a list rather than an answer.

This page covers what is left, and what actually matters in operations: how you build an evaluation in-house and how you run it. That is not a reading problem, it is an engineering problem, a set of examples, a scorer, a harness that executes them, and the discipline that makes today's number comparable to yesterday's.

The problem: a public score does not answer your question

A public leaderboard answers "which model is best in general". Your question is different: "does this specific change (new model, new prompt, new document base) improve my service?"

No public benchmark can answer it, for a simple reason: your data and your requirements are not in it. A model at the top of every leaderboard can be mediocre on your legal corpus, your internal jargon, or your working language.

Hence the rule: public leaderboards shorten the candidate list; your own evaluation set makes the decision.

The one decisive advantage of your own set

Nobody optimised it. A public benchmark is online, therefore readable by everyone, therefore potentially present in the training data of the very models it evaluates. Your set, drawn from your real traffic and kept private, does not have that flaw. That (not its size, not its sophistication) is what makes it the least bad measurement available to you.

The three pieces of an evaluation

Every evaluation, public or homemade, decomposes into three pieces that can be changed independently. Conflating them is the most common source of error.

  1. The example set: the inputs, and where applicable the expected answer.
  2. The scorer: the rule that turns an answer into a number.
  3. The harness: the program that presents examples to the model, collects answers, and applies the scorer.

Two teams using the same set but different harnesses publish numbers that are not comparable. This is routine, and it regularly explains gaps between a vendor's published score and the score you reproduce yourself.

Two-by-two table classifying benchmarks. Columns give the source of questions: static or live. Rows give the evaluation metric: ground truth or human preference. The cells contain MMLU, HellaSwag and GSM-8K for static plus ground truth, Codeforces Weekly Contests for live plus ground truth, MT-Bench and AlpacaEval for static plus human preference, and Chatbot Arena for live plus human preference.
The two design choices that determine everything else. Columns: where questions come from, a frozen set published once, or a live stream that cannot be memorised in advance. Rows: what the answer is judged against, a known correct answer, or a human's preference. Your in-house evaluation almost always sits in the top-left quadrant, a frozen set with reference answers. That quadrant is the easiest to automate and the fastest to go stale.Source : Chatbot Arena paper (figure 1), LMSYS

Piece 1: the example set

Where examples come from

The right source is your production logs: real user requests, not requests imagined by the team. An imagined request is clean, correctly spelled, well formed. A real one is ambiguous, truncated, sometimes in two languages at once. The gap between the two is exactly the gap between a flattering score and a disappointing service.

Three sources stack:

  • A representative sample of ordinary traffic, drawn at random rather than cherry-picked.
  • Real failures, each incident added to the set the day it is fixed. This is the regression-test mechanism: the same bug does not come back twice.
  • Rare but expensive cases, deliberately over-represented: the out-of-scope request, the trick question, the manipulation attempt. They weigh nothing in traffic and everything in risk.
Real data is personal data

An evaluation set built from user conversations contains everything those users wrote. Building it creates a data processing operation, with a lawful basis, a retention period and anonymisation to settle before the first line of code, not after. See data governance.

How many examples

The honest answer depends on the size of the gap you need to detect, and that is a statistics question, not a matter of taste.

Over nn examples scored right or wrong, the uncertainty on the observed pass rate behaves like 1/n1/\sqrt{n}, one over the square root of the number of examples. In practice the usual margin of error is roughly:

margin≈1n\text{margin} \approx \frac{1}{\sqrt{n}}

where nn is the number of examples in the set and the margin is expressed in percentage points on the pass rate. The formula is a crude approximation, valid around a 50% pass rate and deliberately pessimistic elsewhere. Read in plain words: halving the uncertainty requires four times as many examples.

The orders of magnitude that follow:

Set sizeIndicative marginWhat you may claim
30±18 pointsAlmost nothing; catches gross breakage only
100±10 pointsA 15-point gap is real, a 5-point gap is not
400±5 pointsTwo close versions become distinguishable
2,500±2 pointsFine tuning becomes measurable, at 2,500 calls per run

This is the arithmetic behind the usual advice to start at a few hundred examples: below that, most observed gaps are noise.

Paired comparison buys more than sample size

Comparing two versions on the same examples, then looking only at the examples where they differ, removes the variability caused by question difficulty. You then detect a far smaller gap at the same set size. It is the principle of the crossover clinical trial, where each patient is their own control.

The reference answer, where one exists

For a factual question or a calculation, the expected answer can be written down. For an essay, a summary or a recommendation, it cannot: there are dozens of good answers. That is exactly where the choice of scorer is decided.

Piece 2: the scorer, in three families

Family 1: exact comparison

The model's answer is compared to the expected answer. Simple, reproducible, free. The trap is elsewhere: extraction. The model answers in sentences; you must extract the letter, number or label to compare. A model answering "the correct answer is probably C" scores zero if the extractor expects the bare letter C.

This is not a theoretical worry: a meaningful share of the gaps between a lab's published score and a score reproduced elsewhere comes from here, not from the model.

Diagram of the MMLU evaluation protocol. A multiple-choice question from the MMLU set, with its four options A, B, C, D and the word Answer, is fed to the LLM. The model generates a letter, here D. That letter is compared to the correct answer from the dataset, which was never shown to the model.
The exact-comparison scorer in its simplest form. The question and its options go into the prompt, the model emits a letter, the letter is compared to the key. Two things follow. With four options, guessing already earns 25%, so a 30% score is not 30% of understanding. And everything between the model's natural-language answer and the extracted letter is code you wrote, and code can be wrong.Source : Sebastian Raschka, Ahead of AI

Family 2: the programmatic verifier

No reference answer is stored; a property of the answer is checked by executing it. Generated code is compiled and run against tests. Requested JSON is validated against its schema. A numeric answer is recomputed.

This is the sturdiest family, because it depends on no judgement, and the cheapest, because a unit test costs nothing to run. Whenever a task can be reframed to fall into this family, it should be. It is the same argument that underpins reinforcement learning from verifiable rewards, covered in RLVR.

Family 3: the model judge

A second model reads the answer and scores it. This is the only option when the quality you care about is a judgement, tone, relevance, absence of fabrication. It is also the most fragile, and it has its own page: the model as judge, which covers its biases and the validation it demands before anyone believes it.

One methodological point belongs here rather than there: a judge is a variable cost. Scoring 500 examples with a judge means 1,000 model calls per run, and if the evaluation fires on every change, the evaluation bill can exceed the production bill. The standard reflex is to run families 1 and 2 on every change, and family 3 before every release.

The cheapest scorer that answers the question

Push every criterion into the lowest family that can carry it. "Does the answer cite at least one source from the supplied corpus?" is a regular expression, not a judge. "Is the answer in French?" is a language detector. Reserve the judge for what genuinely requires judgement.

Piece 3: the harness, and what must be frozen

This is the part everyone underestimates. An evaluation number only means something against another number obtained under the same conditions. Six settings move the score with no change to the model at all:

To freezeWhyIf you forget
The exact model versionOne commercial name covers several successive versionsThe score moves with nothing changed on your side
The exact evaluation prompt textWording changes the answerTwo campaigns that cannot be compared
The number of examples shown before the questionZero, one or five shots do not give the same scoreGaps of several points
Temperature and sampling modeNon-zero temperature makes every run differentNoise read as progress
The answer-extraction codeIt decides what counts as an answerSee family 1
The random seed, or failing that the repeat countWithout it, nothing is replayableA result nobody can reproduce
Prompt wording is worth several points

This is not a theoretical worry. The MMLU-Pro authors measured how far a single model's score moved across 24 different phrasings of the instruction: the spread reached 4 to 5 points on the original MMLU, and fell to 2 points on their harder version. On the most-cited benchmark of the decade, rephrasing the question moved the score as much as several months of advertised progress.

MMLU-Pro: A More Robust and Challenging Multi-Task Language Understanding Benchmark

Run-to-run noise, and how to make it visible

Two runs of the same evaluation against the same model do not give the same number, unless temperature is zero and the seed fixed, and even then, inference servers do not always guarantee determinism, because results can depend on how requests were batched together.

The practical consequence is simple, and it is the discipline that separates a real evaluation from a table of numbers: never publish a score without its uncertainty. Three runs at minimum, a low, a high, and comparisons made between intervals rather than points. A 1.5-point gap between two versions, quoted without an interval, means nothing.

The tools: do not rewrite the harness

Writing your own harness is an excellent way to understand, and a poor way to produce comparable numbers. Several open-source tools do the job, and choosing between them depends on what you are evaluating.

ToolMaintained byWhat it is for
lm-evaluation-harnessEleutherAI, since 2020Running hundreds of academic benchmarks on a model (multiple choice, maths, code) with standardised settings; it powers many public leaderboards
lightevalHugging FaceThe same use, designed to work with several inference engines; Hugging Face uses it for its own evaluations
InspectUK AI Security Institute, open-sourced in 2024Multi-step and agent evaluations: tools, sandboxes for running code, judges; widely used for pre-deployment safety testing
OpenAI EvalsOpenAI, since 2023A registry of evaluations and a framework for writing them, now also offered as a service on OpenAI's platform
promptfooStartup acquired by OpenAI in March 2026, still open sourceTesting an application rather than a model: comparing prompts, models and configurations on your own cases, and hunting for flaws (prompt injection, data leaks)

Two practical remarks. First, these tools do not solve the settings problem, they make it visible: the same benchmark run through two different tools often yields two different scores, because the prompt, the extraction or the number of shots differ. The lm-evaluation-harness maintainers drew a whole paper out of three years of experience with these pitfalls, and its conclusion matches the previous section: publish the exact configuration alongside the score. Second, the real dividing line runs between evaluating a model (the first two tools) and evaluating a system (Inspect for agents, promptfoo for applications): the second question is nearly always the one that concerns you.

Lessons from the Trenches on Reproducible Evaluation of Language Models

The set ages, and it leaks

Test-set leakage into your own tuning

You build an evaluation set. You tune the prompt until the score rises. After thirty iterations, the score reflects the set as much as the service: you have optimised on your test set. This is exactly the contamination described in benchmark limits, except that here you caused it yourself.

The remedy is the one used against overfitting, described in splitting the data: two separate sets. A working set, looked at and optimised as much as you like. A control set, run rarely (before a release, not on every change) and never inspected example by example. The day the two numbers diverge sharply, the working set is worn out.

The set that stops measuring anything

A saturated set (everyone at 98%) no longer discriminates. It is the same phenomenon as on public benchmarks, at the scale of your service: the easy questions all end up passing and the score stops moving, while real failures continue.

The remedy is rotation: retire the examples every version has passed for six months, add the recent incidents. An evaluation set is a living object, not a file delivered once.

Chart from 1998 to 2020 plotting the performance of the best systems on six historical datasets: MNIST, Switchboard, ImageNet, SQuAD 1.1, SQuAD 2.0 and GLUE. Each curve starts very low and rises until it crosses a black horizontal line at zero, which represents human level. The more recent curves rise faster and faster.
Saturation, on public sets older than today's. The black horizontal line is human level: every curve eventually crosses it, and stops separating anything. The message is in the slope, not the names: MNIST took roughly fifteen years to saturate, SQuAD and GLUE under two. Your in-house set follows the same path, faster, because you are optimising against it on purpose.Source : Sebastian Ruder, after the figure in Kiela et al. (Dynabench)

Public benchmarks leak too, and it has been measured

In 2024, researchers at Scale AI wrote GSM1k: a thousand maths problems modelled on the style and difficulty of GSM8K, but never published. Several model families lost up to 8 points compared with GSM8K, with signs of systematic overfitting, and the more likely a model was to reproduce GSM8K examples word for word, the larger its drop. Frontier models, on the other hand, showed little sign of overfitting. The message is nuanced: contamination exists and can be measured, but it does not explain all of the progress.

The countermeasures adopted since all point the same way, hide or refresh:

  • dated questions: LiveBench refreshes questions every month from recent sources (maths competitions, papers, news) and scores them automatically against a known answer; LiveCodeBench only keeps programming problems published after the evaluated model's training cut-off;
  • sets kept secret: part of the questions is never published and the organiser runs the test, as for part of the ARC-AGI sets;
  • "canary" strings: a unique character sequence inserted into a benchmark's files, so dataset builders can filter them out, and so a model that regurgitates it can be caught.

This is also why the evaluations that matter most in 2026 are often private: labs' internal sets, evaluations handed to third parties, and pre-release tests run by public bodies such as the UK AI Security Institute or the US CAISI (Center for AI Standards and Innovation). Their strength is that they cannot be optimised against; their weakness, that they cannot be checked from outside.

A Careful Examination of Large Language Model Performance on Grade School Arithmetic LiveBench: A Challenging, Contamination-Limited LLM Benchmark LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code

Evaluating an agent: what changes

An agent does not return an answer, it chains actions: searching, running code, clicking, calling tools, sometimes for hours. The course gives it a page of its own, agent evaluation; here is what it changes to the three pieces of this page.

  • The example set becomes an environment. Each example is a task with a starting state (a code repository, a website, a database) that must be recreated identically, often in an isolated sandbox. This is the most expensive part to build.
  • The scorer checks an end state. Rather than reading the answer, you look at the world after the agent has been through: do the tests pass, is the order recorded, does the file have the right content? This is family 2, the most robust, on one condition: that the agent cannot cheat by editing the tests itself, a problem documented on code benchmarks (see the SWE-bench controversy).
  • The harness also measures consistency and cost. An agent that succeeds one time in three is not a reliable agent. The τ-bench benchmark (2024) popularised the pass^k measure: the probability of succeeding at the same task in all k of k attempts, which falls much faster than the average success rate. Steps, time and cost per task are recorded too.

One measure sums up the trajectory of recent years: the time horizon proposed by the METR organisation, meaning the length of tasks (timed on skilled humans) that the best models complete half the time. According to the original study it doubled roughly every seven months since 2019; in 2026 it exceeded ten hours for the best models, with METR warning that its measurements beyond 16 hours become unreliable, for lack of long enough tasks in its suite.

τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains Measuring AI Ability to Complete Long Software Tasks

Where evaluation plugs into the pipeline

An evaluation you launch by hand when you remember is worthless. It earns its keep when it becomes a gate, exactly like the software tests described in CI/CD for ML.

Three plug points, cheapest first:

  1. On every change: family 1 and 2 scorers, on the working set. A few minutes, negligible cost, blocks gross regressions.
  2. Before a release: the full campaign, control set and judge included. The output is a decision (promote or not) rather than a table to admire.
  3. Continuously on live traffic: a sample of real answers scored after the fact, to catch drift a frozen set cannot see. That is the subject of LLM observability and monitoring and drift.

The promotion rule must be written before the campaign, not after: "the new version ships if it loses no more than 2 points anywhere and gains at least 5 points on the target criterion". Setting the threshold after seeing the numbers is how you agree with yourself.

Public benchmarks: where to look, without redoing them here

Each has its own page in this course; what is useful here is knowing which to consult for which question.

What you want to knowWhere to look
General knowledge and reasoningMMLU, saturated, and its hardened version MMLU-Pro, itself near the ceiling (around 90% for the best models in 2026)
Graduate-level scienceGPQA
Verifiable instruction followingIFEval: about 500 prompts with constraints a program can check ("more than 400 words", "use this word three times")
Programming, short exercisesHumanEval, saturated; LiveCodeBench for problems published after training
Programming, patches to real codethe SWE-bench controversy, and successors such as Terminal-Bench
School mathematicsGSM8K and MATH, saturated for large models
Competition mathematicsAIME
Common sense, saturated historical setsARC and HellaSwag
Human preference, Elo rankingLMArena, and its automatic stand-in Arena-Hard (see LLM-as-a-judge)
Questions refreshed against contaminationLiveBench
Agents: tools and simulated usersτ-bench, and the agent evaluation page
Exams built to stay hardHumanity's Last Exam, ARC-AGI
How these scores get gamedbenchmaxxing

Two anchors explain why these sets cannot be read at face value. MMLU asks four-option questions: guessing already scores 25%, and every number must be read above that floor. GPQA contains 448 questions written by specialists; domain experts reach roughly 65%, while non-specialists with internet access and over thirty minutes per question top out at 34%, which is what makes the exam resistant to plain look-it-up search. Yet in 2026 the best models exceed 90% on its filtered version, GPQA Diamond, above the score of the experts who validated it: the exam has joined the list of sets that no longer separate the top of the table, which is what pushed towards exams such as Humanity's Last Exam (2,500 questions written by specialists worldwide).

GPQA: A Graduate-Level Google-Proof Q&A Benchmark Instruction-Following Evaluation for Large Language Models Humanity's Last Exam

Two special cases have their own pages because the subject changes the method: evaluating a RAG system, which separates retrieval from writing and notes that retrieval metrics depend on no judge at all, and agent evaluation, where what gets scored is a trajectory of actions rather than an answer.

Why it matters

An in-house evaluation is the only instrument that answers the question you actually have: does this change improve our service? Public leaderboards saturate within two or three years, leak into training data and end up optimised for their own sake; in 2026 they mostly serve to draw up a shortlist.

What separates a serious evaluation from a table of numbers comes down to a few things: a set drawn from real traffic and kept private, the cheapest scorer that answers the question, a frozen and documented harness (preferably a shared tool rather than a home-made script), a displayed uncertainty, and a decision rule written before seeing the results. For an agent, add a replayable environment and a consistency measure. And when reading someone else's announcement, the same questions apply: which set, which scorer, which configuration, what margin of error, and compared to what?

Check your understanding0 / 6

1. A model tops every public leaderboard. Why does the page refuse to conclude that you should deploy it on your service?

2. Your 100-example set gives a margin of error of about ±10 points. What does it take to bring it down to ±5?

3. A lab announces 82% on a multiple-choice test; you rerun the evaluation and get 74% with the same model and the same set. Which cause does the page describe as banal?

4. To check « the answer cites at least one source from the provided corpus », do you need a model judge?

5. After thirty rounds of prompt tuning, your in-house score has climbed nicely. Why does the page urge suspicion, and what is the remedy?

6. An agent succeeds on 60% of a benchmark's tasks. Why does τ-bench also propose measuring pass^k, the probability of succeeding at the same task in all k of k attempts?