Unit 4 of 7 · about 4 hours · implement, measure
Uncertainty, robustness and honest claims
A single mean hides where a model fails and how fragile the number is. Slices plus uncertainty plus sensitivity turn a leaderboard entry into a claim you can defend.
You'll be able to
- Build slices, paired comparisons and bootstrap intervals for a small evaluation, and read overlapping intervals correctly.
- Measure prompt, order and sampling sensitivity under fixed compute budgets and report the range, not just the best run.
- Separate capability results from safety results with distinct gates and stop conditions.
Covers
Read
In this order, only the parts listed
0 of 4 done
- Modern LLM Notebook 25-evaluation: aggregation and composite scoresModern LLM Notebook - evaluation and FLOP accounting
Section 5 comparison table with analysis points (same-scale compare, business-relevant metrics, trends over single numbers, labeled source and config) and Section 5.2 (arithmetic, normalized, weighted, geometric and rank-sum methods with geometric penalizing weak spots)
- Modern LLM Notebook 25-evaluation: robustness and pitfallsModern LLM Notebook - evaluation and FLOP accounting
Section 8.2 (
CR@K, prompt, order and sampling robustness) and Sections 10.1 to 10.3 (prompt sensitivity 5 to 15 percent with OLMES prompts, few-shot counts, HumanEval 164 variance,seed,temperature, mean plus minus std, per-subject slices, length bias, best-score reporting) - lm-eval-harness: bootstrap uncertainty in
metrics.pyLanguage Model Evaluation Harnessbootstrap_stderrwith resampling anditers,stderr_for_metricwith the bootstrappable list (median,matthews,f1,perplexity,bleu,chrf,ter,nanmean) and closed-form mean andacc_all, pluspooled_sample_stderrfor groups - CS336 Lecture 12: safety benchmarks and realismStanford CS336 - resource accounting, inference and evaluation
Function
safety_benchmarks()with HarmBench 510 behaviors, AIR-Bench 314 categories and 5694 prompts, GCG transfer, contextual safety and dual-use CyBench; plusrealism()with GDPVal, MedHELM 121 tasks from 29 clinicians, and Clio
Focus on
- Slice first, then aggregate. Report per-slice means before any composite, and say which slice drives the headline.
- Compare paired deltas on the same prompts, not two independent means. Pairing cancels prompt difficulty, which two independent intervals would both include.
- Bootstrap resamples with replacement and reports the std of the stat. Use the closed-form SE for plain means and bootstrap for medians, F1, perplexity and similar.
- Fix the sampling and prompt budget before comparing. Temperature, seed, few-shot and prompt version are part of the result.
Common mistakes · 3
- Reading overlapping intervals as proof of no difference without a paired test. Pair the prompts first, then test the .
- Reporting the best prompt or seed. Prompt swings of 5 to 15 percent dwarf small model gaps.
- Claiming safety from a capability average. A model at 90 math and 10 safety averages 50 and is still unsafe, so gate safety separately.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Exercise 3 scores Model A at 82, 71, 65, 78 and Model B at 78, 75, 70, 72. What do the two means say?Answer
Arithmetic: A 74.0, B 73.8, so A leads by 0.25. Geometric: both about 73.7, so the gap vanishes. B is more balanced (range 8 versus 17) because the geometric mean punishes the weak 65 that the headline average hides.
2.When should you use
bootstrap_stderrinstead of a closed-form SE?AnswerPlain means and
acc_allhave closed forms (mean_stderr,acc_all_stderr). Medians, F1, perplexity, BLEU and similar usebootstrap_stderrwith resampling, and groups combine withpooled_sample_stderr.3.Why compare paired deltas rather than two independent means?Answer
Both models see the same prompts, so prompt difficulty cancels and the isolates the model effect. Independent means mix model differences with prompt sampling noise.
4.How should capability and safety results be gated?Answer
Gate them separately with distinct primary tasks, regressions, slices, safety checks and stop conditions. Dual-use tasks such as CyBench count as both, so state which claim each result supports.
You're done when
Your two-slice report shows per-slice means, a paired with an interval, and a sensitivity range for one prompt or sampling change.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 3 more in the section
- Stanford CS336 - resource accounting, inference and evaluationStanford University · primary
Use Spring 2026 Lectures 2, 10 and 12 for FLOPs, memory, arithmetic intensity, inference and evaluation. Reproduce the small calculations locally. Assignment 3 IsoFLOPs analysis is optional; do not require its hosted training API or costly experiments.
- Modern LLM Notebook - evaluation and FLOP accountingWalking Labs · required
Use English notebook 25-evaluation and Appendix B FLOP and memory accounting. Build a 20-example evaluator with two slices, raw outputs and bootstrap intervals, and deliberately create one parser, prompt or judge failure.
- Language Model Evaluation HarnessEleutherAI · optional
After the small evaluator passes, inspect task versioning, request construction and result schemas to understand production evaluation plumbing. Do not use the harness as a substitute for owning the task and metric contract.
Also in this section
- LLMs from Scratch companion - GPT FLOP analysisSebastian Raschka · required
Use ch04/02_performance-analysis/flops-analysis.ipynb as a concrete calculator, then rebuild the formulas from the model configuration and reconcile parameters and at least one memory or operation estimate with runtime state.
- LLM Foundations Checkpoint - evaluation and arithmetic sliceRoadmap-Final · support
Use the contamination, evaluator-bias, parameter, FLOP, activation, state and KV requirements as the assessment contract. Keep raw outputs and distinguish a verified task result from a broad model capability claim.
- Stanford CS336 Assignment 3 - IsoFLOPs scalingStanford University · optional
Use Section 2.1 and Problem
chinchilla_isoflopswithdata/isoflops_curves.jsonfor the bounded curve-fitting exercise only. Do not use the hosted training API or costly experiments.