7.2 Experiments and ablations
1. Learn
Section titled “1. Learn”- Glassbox bridge notethe bridge note on this page
- Bouthillier et al., Accounting for Variance in Machine Learning Benchmarksthe sources of variance it measures and its recommendations
- NIST/SEMATECH e-Handbook of Statistical Methodssection 5.3.3, then 5.3.3.3 (full factorial) and 5.3.3.4 (fractional factorial) designs
2. Bridge
Section titled “2. Bridge”What an ablation is for. An ablation removes or changes one part of a system and measures the change in a metric, to find out what that part contributes. Most architecture papers have one, such as table 3 of Attention Is All You Need, which varies heads, key size, depth, width, dropout and positional encoding one at a time. Two decisions make or break it: which runs to do, and whether each difference beats the noise.
Noise first. Runs of one config with different seeds (initial weights, data order, dropout) differ. Measure that spread, σ, first, by running the baseline with a few seeds. A difference between two configs averaged over n seeds each has standard error σ√(2/n), so an effect δ needs n ≥ 2 (zσ/δ)² seeds per config to stand z standard errors clear. That makes the true effect z standard errors, so one study clears the bar only about half the time; for an 80% chance, use z + 0.84 in place of z. Bouthillier et al. 2021 measure each source’s variance in five benchmarks, find it comparable to published improvements (including the train/test split, which seeds alone don’t vary), and argue for randomising all of them.
One at a time or factorial. Changing one factor at a time from a baseline costs one config per alternative value, but each effect is measured only at the baseline, and interactions (one factor’s effect depending on another) are invisible. A full factorial runs every combination: it grows multiplicatively, but each main effect uses every run, averaged over the other factors, and every interaction is measured. With k two-level factors, 2^k configs; fractional factorials cut that down when the interactions a fraction confounds can be assumed negligible, for a resolution V fraction those of three or more factors (NIST handbook §5.3.3.4, §5.3.3.4.4).
Testing a difference. With few seeds, make no distributional assumptions you cannot check. An exact permutation test asks how often a random relabelling of the runs gives a difference at least as large as the observed one; it is valid for any distribution, but with n runs a side it can never give p below 2 / C(2n, n), which is 0.1 for 3 seeds (Dror et al. 2018 survey which tests suit which metrics). Report the mean difference with its standard error, the number of seeds, and whether the effect clears the noise; don’t report a single run.
3. Explore
Section titled “3. Explore”stubs/m7_2_ablations.pyLoading starter file…
Prefer your own editor? Edit exercises/stubs/m7_2_ablations.py and run mlc check 7.2. The tests are identical; import the results on the progress page.
Then run the lab. Open notebooks/7.2-ablation-study.ipynb (about 3 minutes on a CPU) and paste in your 4.6 and 7.2 files. It measures your GPT’s seed noise, runs a 2 × 2 × 2 factorial over learning rate, depth and tied embeddings with three seeds each, estimates main effects and interactions with their standard errors, and tests each one-at-a-time comparison. Then design and run an ablation of your own and write it up.
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.