TL;DR
A benchmark dataset is a fixed collection of test items, each with a known correct answer, that every model is scored on in the same way. Because the items and the scoring never change, two models' results can be compared directly. A benchmark gives only a sample of what a model can do, so its score is useful only when the sample is large enough and close enough to the real task.
Builds on: test sets, Precision and Recall · Leads to: the public leaderboards and papers that report scores such as SWE-bench, and the caution about reading those scores
Where it's used
Image recognition. ImageNet holds about 1.2 million training images in 1,000 categories, and its validation images were the shared yardstick for image classifiers for years. The yearly challenge built on it showed how a deep convolutional network could cut the error rate sharply in 2012, and every later model was compared against the same fixed items.
Software engineering. SWE-bench collects 2,294 real GitHub issues from 12 Python projects. A model is scored by whether its patch makes the project's tests pass. Because the task is fixed and the tests decide the answer, a score from one lab can be checked against another's.
Chatbot safety. Teams that red-team a language model keep a set of prompts that previously drew harmful replies, and rerun it after each change. The set is a small benchmark: it lets a team see whether a new version got better or worse on the cases it already knows about.
How it works
Take one tiny benchmark: ten questions, each with a correct answer written by a person before any model was run.
-
Write the items and their answers. Ten questions, each with one correct label. Check: there are exactly ten pairs of question and answer.
-
Freeze the set. Store the ten pairs in a file and never change them. Anyone who reruns the benchmark gets the same questions. Check: the file reads the same on every run.
-
Run model A. Ask model A each question and compare its answer to the label. It is right on 7 of 10. Check: its score is , or 70 percent.
-
Run model B. Model B is right on 8 of 10, so its score is 80 percent. Check: the two scores are comparable because they use the same ten items.
-
Ask how much to trust the gap. The gap is one question. If the ten items had been drawn differently, model B might have looked worse. Check: with ten items, each item moves the score by 10 points, so a 10-point gap is roughly one question.
-
Notice what the set cannot show. If model A had already seen some of these questions during training, its 70 percent overstates what it can do on new questions. Check: the score measures the items, and the items are only a sample of the task.
flowchart LR A["Write items with known answers"] --> B["Freeze the set"] B --> C["Run each model on every item"] C --> D["Score: fraction correct"] D --> E["Compare scores, and ask how much noise is in the gap"]
The math
Write for the number of items, for the correct label of item , and for the model's answer. The score is the fraction of correct answers,
where equals 1 when the statement inside is true and 0 otherwise. This is the same as the accuracy of the model on the set.
Step 3 in symbols: the score
With and seven correct answers, the sum of indicators is 7, so the score is .
Step 5 in symbols: how noisy the score is
Treat each item as a coin flip with success probability , the model's true rate. Averaging many such flips makes the score roughly normal for large , by the Central Limit Theorem, so its spread is described by the standard error:
For and , this is , so the score of 70 percent carries about plus or minus 14.5 points. Two scores closer together than about two standard errors do not tell you much. The size of the set controls the noise: a benchmark with ten times as many items shrinks this error by a factor of .
Worked examples
A benchmark has items. Model A gets 6 right and model B gets 7 right. Find both scores and say whether the gap means much.
- Model A's score is , or 60 percent.
- Model B's score is , or 70 percent.
- The gap is 10 points, which is one item.
- The standard error of model B is , about 14.5 points.
- Check: the gap of 10 points is well inside one standard error, so the benchmark cannot tell these two models apart.
Interpretation: on ten items, a difference of one question is noise. A bigger set, or a different set, is needed before ranking the models.
A benchmark has items. Model C gets 150 right, and model D gets 160 right. Find both scores, their standard errors, and the gap in units of its own noise.
- Model C's score is , or 75 percent.
- Model D's score is , or 80 percent.
- Model C's standard error is , about 3.1 points.
- Model D's standard error is , about 2.8 points.
- The standard error of the gap is , about 4.2 points.
- The gap of 5 points is about standard errors.
Interpretation: a 5-point gap on 200 items is within the range of noise a careful reader expects. Reporting "model D is better" without the uncertainty overstates what the benchmark shows.
A software benchmark has 2,294 issues, like the SWE-bench collection. A model resolves 46 of them. Find the resolution rate and its standard error, then find the rate for a model that resolves 92.
- The rate is , or 2.0 percent.
- The standard error is , about 0.3 points.
- The noise is small here, because the set is large. The 2.0 percent is known to within about a third of a point.
- Check: the rate is the count divided by the size, so 46 resolved out of 2,294 gives 2.0 percent.
Try it: a second model resolves 92 of the 2,294 issues. What is its rate, and what is its standard error? Answer: , so 4.0 percent. The standard error is , about 0.4 points, so the gap from 2.0 to 4.0 percent is far larger than the noise.
Common mistakes and tradeoffs
It is tempting to think that a benchmark score tells you how well a model does at the real task. In fact the score measures the items in the set. The set is a sample, and it differs from real use in its topics, its wording and its difficulty. A model can score well on a benchmark and still fail on tasks the benchmark did not include, a gap that distribution shift and out-of-distribution generalization describe.
It is tempting to think that a benchmark stays clean once it is published. In fact, once the items and their answers appear on the web, they can end up in the training data of later models, and the score then measures memory as well as skill. This is called contamination, and it is one reason many teams keep a private test set.
It is tempting to think that accuracy is enough. In fact a single number can hide the difference between false alarms and misses. A benchmark for a rare event can show high accuracy from a model that never flags anything, which is why Precision and Recall are reported alongside it.
It is tempting to think that a small gap between two models is real. In fact the noise from a small test set can be larger than the gap. Report the uncertainty, for example as a confidence interval, and prefer more items or several benchmarks before ranking models.
It is tempting to think that a model that scores well on a benchmark has learned the task. In fact, when a measure becomes the target that people optimise, it stops tracking the thing it was meant to measure. This is Goodhart's law. Teams that tune models to one benchmark can raise its score without raising real ability.
When to use a benchmark: to compare models on the same fixed items, to track changes to one model over time, or to catch regressions on known cases. When not to use one: to make a claim about a broad ability from a small or narrow set, or to judge a model on a task the set does not represent. Alternatives include private held-out sets, resampling methods such as Cross-Validation on the training data, benchmarks that renew their items over time, and direct human evaluation on real tasks.
History
Early machine learning often used small benchmark sets, and most researchers evaluated on whatever data they could collect. The MNIST database of handwritten digits, released in 1998, became a widely shared benchmark, and its shared use let researchers compare methods on the same images for the first time in a systematic way.
ImageNet, announced in 2009, scaled the idea to about a million labelled images in 1,000 categories. A yearly challenge built on it gave a common scoreboard, and the 2012 entry based on a deep convolutional network showed how much a shared benchmark could drive progress.
Researchers soon noticed the limits. Repeated use of the same test images, and small changes in how they were collected, raised doubts about how well headline scores transferred to new images. Attention moved toward fresh test sets, held-out private data and benchmarks built from new material, which is the approach that later software benchmarks such as SWE-bench took.
The idea caught on because it turned an argument about which model is better into a number that anyone can recompute. Its weakness is the same as its strength: the number is only as good as the items behind it.
Recap
- A benchmark dataset is a fixed set of items with known answers, scored the same way for every model.
- The score is the fraction correct, a sample estimate with noise that shrinks as the set grows, roughly as .
- Small gaps between models can be pure noise; report the uncertainty before ranking.
- Scores reflect the items, not the whole task, and they lose meaning when the items leak into training or when a target is optimised too hard.
Read next: Overfitting for why a model can score well on data it has seen, and SWE-bench for a worked example of a benchmark built from real repositories. Papers that report results on this kind of benchmark, such as TruthfulQA and scalable oversight, assume these ideas.
Check yourself
QuestionRecall: what makes two models' scores on a benchmark directly comparable?Show answer
Both models are scored on the same fixed set of items, with the same known correct answers and the same scoring rule. If the items or the rule change, the scores no longer compare.
QuestionCompute: a benchmark has 400 items and a model gets 300 right. What is the score, and what is its standard error to one decimal place in percentage points?Show answer
The score is , or 75 percent. The standard error is , which is about 2.2 percentage points.
QuestionWhy can a high score on a public benchmark be misleading even when the labels are correct?Show answer
The items may have appeared in the training data of the model, so it may have memorised answers rather than learned the task. The items are also only a sample, so the score may not transfer to real use that differs in topic or difficulty.
QuestionApplied: a team reports that its new model beats the old one by 2 points on a 150-item benchmark. What should a careful reader ask before believing the claim?Show answer
A reader should ask for the standard errors. On 150 items each score has a standard error of several points, so a 2-point gap is well within the noise. The reader should also ask whether the items were public, whether the model could have seen them in training, and whether the result holds on other benchmarks.