Sam Babichenko

Reading notes

Deep Learning Alchemy

Lessons and quizzes from Stanford CS 312 Deep Learning Alchemy (Fall 2026), taught by Tatsunori Hashimoto and Suhas Kotha, with Kaiyue Wen and Tristan Thrush (CAs). The lessons, experiments, figures and quiz problems are the course's, shown here with the instructors' permission.

Deep learning lacks a general theory for what happens when a pretraining recipe changes, so understanding means predicting outcomes on a controlled transformer before running them. Across architecture and optimization, behavior reduces to how additive paths carry signal, how scale-invariant weights settle under decay, and how optimizer noise sets a loss floor.

Controlled ablations show that untuned learning rates and seed spread reverse naive rankings, and scaling ladders fail unless settings move with size. Noisy quadratics, width parametrization, loss basins, and edge-of-stability flows link batch size, momentum, and weight decay to equilibrium norms and sharpness. Residual paths, gated recurrences, and parameter count govern trainability and loss, while heavy decay and ensembles restore scaling on fixed data.

Prediction as understanding: the d8 model organismHashimoto and Kotha, Stanford CS 312, Fall 2026, Lecture 1 and LLMs 101The d8 transformer organism turns pretraining ideas into concrete predictions and exposes shared-learning-rate errors. Hyperparameters, scaling, noise and debuggingHashimoto and Kotha, Stanford CS 312, Fall 2026, Lecture 2Controlled d8 experiments show how untuned hyperparameters, random seed spread, and unscaled ladders corrupt pretraining comparisons. Noisy quadratics and weight normsHashimoto and Kotha, Stanford CS 312, Fall 2026, Lecture 3Noisy quadratics and scale-invariant weight equilibria explain why momentum needs large batches and Hyperball stabilizes updates. Parametrization across width and depthHashimoto and Kotha, Stanford CS 312, Fall 2026, Lecture 4Width and depth scaling exponents keep activation changes bounded and transfer optimal learning rates across size. Loss basins, river valleys and saddle pointsHashimoto and Kotha, Stanford CS 312, Fall 2026, Lecture 5Midpoint barriers and river-valley dynamics explain when checkpoints average cleanly and why cooldowns drop loss. The edge of stability, central flows and flat minimaHashimoto and Kotha, Stanford CS 312, Fall 2026, Lecture 6Oscillation along the sharpest Hessian direction regulates curvature at the stability threshold and defines central flow. Signal propagation in depthHashimoto and Kotha, Stanford CS 312, Fall 2026, Lecture 7Clean identity shortcuts, branch normalization, and criticality preserve forward norms and backward gradients across extreme depth. Signal propagation in timeHashimoto and Kotha, Stanford CS 312, Fall 2026, Lecture 8Input-dependent gates, attention sinks, and matrix-state recurrences govern how sequence models retain and overwrite past tokens. Depth, width and expressivityHashimoto and Kotha, Stanford CS 312, Fall 2026, Lecture 9Depth-separation sawtooths collapse under noise, so practical language-model loss tracks total parameter count instead of aspect ratio. Regularization and fine-tuningHashimoto and Kotha, Stanford CS 312, Fall 2026, Lecture 10Heavy weight decay, independent ensembles, and distillation restore model-size scaling when pretraining tokens stay fixed.