5.12 Evaluation
1. Learn
Section titled “1. Learn”- Stanford CS336: Language Modeling from Scratchlecture 12 "Evaluation" (May 8)
- Miller, Adding Error Bars to Evalssections 1–5 (paired differences are §4.2, power analysis §5)
- Chen et al., Evaluating Large Language Models Trained on Code (pass@k)section 2.1
2. Bridge
Section titled “2. Bridge”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).
3. Explore
Section titled “3. Explore”stubs/m5_12_eval.pyLoading 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.
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.
5. Check
Section titled “5. Check”- not yet: All tests pass (0/?)
- not yet: Checkpoint quiz ≥ 80%
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.