Skip to content

5.12 Evaluation

ready≈ 14 hoursNeeds: 5.8
  1. 1 Learn
  2. 2 Bridge & derive
  3. 3 Explore (How noisy is a benchmark?)
  4. 4 Do
  5. 5 Check

A score is an experiment. A benchmark number depends on the items, the prompt format, how the answer is extracted and compared, and how many items there were. Change the scoring rule and the number moves: SQuAD normalises case, punctuation and articles before comparing answers (Rajpurkar et al. 2016), which is right for factual questions and wrong when case matters. Multiple-choice benchmarks are usually scored by which option the model finds most likely; longer options have lower total log-probability, so harnesses also report a per-byte version (lm-evaluation-harness, acc and acc_norm).

Error bars. An accuracy over N items is a sample mean with standard error √(p(1 − p)/N): on 500 items at 60%, ±4.3 points at 95%. Two models scored on the same items should be compared item by item (a paired test), which cancels the items’ shared difficulty (Miller 2024, sections 2–4). For code and maths, pass@k estimates the chance that one of k samples is correct; computing it from n ≥ k samples without bias needs the combinatorial estimator (Chen et al. 2021, section 2.1).

Pitfalls. Test items leak into training data scraped from the web; GPT-3’s authors flagged test examples sharing any 13-gram with the training set (Brown et al. 2020, appendix C). A model’s confidence should match its accuracy; expected calibration error measures the gap (Guo et al. 2017). Per-token loss depends on the tokenizer, so bits per byte is used to compare models (Gao et al. 2020, the Pile). And RL can raise pass@1 while lowering pass@k at large k, because it concentrates probability on answers the model could already find (Yue et al. 2025).

pass@k without bias, and how many items an accuracy needsstep 1 of 6
  1. pass@k=Eproblems[1−(1−p)k]\text{pass@}k = \mathbb{E}_{\text{problems}}\big[1 - (1 - p)^k\big]

How noisy is a benchmark?

Confidence intervals, paired comparisons, pass@k

Static view on small screens. Open this page on a laptop to interact.

Two models, A and B, where B is truly better. How often does a benchmark notice?

items in the benchmark
model A62.0%model B68.0%40%50%60%70%80%B − A (paired)-100+10+20
B − A = 6.0%, 95% bootstrap interval [-2.5%, 14.5%]: cannot tell them apart

pass@k before and after RL that sharpens the model on problems it can already solve

0%50%100%1248163264128256
before RL after RL (k = samples per problem; 300 problems)

An accuracy is a sample mean, and on a few hundred items its 95% interval is several points wide. Comparing two models on the same items (paired) is more sensitive than comparing two separate intervals, but small gaps still need thousands of items. pass@k counts a problem as solved if any of k samples is right. RL that concentrates probability on answers the model already finds raises pass@1, but problems it rarely solved become rarer still, so at large k the base model can come out ahead.

Two simulated models, A and B, where B is truly better by an adjustable amount, are scored on a benchmark of 50, 200, 1,000 or 5,000 items of varying difficulty. Dots with bars show each model’s accuracy with its 95% bootstrap interval, and the paired difference B − A with its interval; the readout says whether B is better beyond resampling noise. A button repeats the experiment on 100 fresh benchmarks and counts how often B was significantly better and how often A scored higher. Below, two curves show pass@k for k from 1 to 256 over 300 problems, before and after an RL-style sharpening whose strength a slider sets. Keyboard: Tab to the buttons and sliders.
Evaluation stubs/m5_12_eval.py

Loading starter file…

Prefer your own editor? Edit exercises/stubs/m5_12_eval.py and run mlc check 5.12. The tests are identical; import the results on the progress page.

Hints · pass_at_k 0/3 revealed
Hints · paired_bootstrap 0/3 revealed
Hints · expected_calibration_error 0/3 revealed

Then evaluate your model. Open notebooks/5.12-eval-harness.ipynb on Kaggle with a GPU and paste in your 4.6, 5.8 and 5.12 files. It trains your chat GPT and keeps an early and a final checkpoint, then scores both on generated answers (raw and normalised), log-likelihood multiple choice with calibration, pass@k on addition, bootstrap intervals with a paired comparison, a contamination check, and bits per byte.

1. A model scores 62% on a 200-item benchmark. Roughly how wide is the 95% interval?
2. Why compare two models with a paired test on the same items?
3. What does acc_norm (per-byte log-likelihood) correct for in multiple choice?
4. Test questions that appeared in the training data…
  • not yet: All tests pass (0/?)
  • not yet: Checkpoint quiz ≥ 80%
Finish the items above first.
Learner log: time spent and points of confusion

Every confusion you note becomes a fix before the module is marked stable. Export it from the progress page and attach it to an issue.