Labs
One lab per part. Each is seeded, runs in seconds with nothing to download, checks its own result against the theory it illustrates, and ends with three things to change. They are written on the series' autodiff: a reverse-mode autodiff library in numpy, built in Part 4 and used by the models the series trains.
pip install numpy scipy matplotlib
python -m videos.ai.labs --list
python -m videos.ai.labs 1 --show
python -m pytest -q tests/test_courses.py -k ai
Lab 1 · The Guessing GamePrediction is compression: an arithmetic coder under three models
Lab 2 · Thinking MachinesAlpha-beta: the same move from far fewer leaves
Lab 3 · Vectors That Mean ThingsPower iteration and the best low-rank copy
Lab 4 · ChangeThe gradient check and its V-curve
Lab 5 · Randomness in MotionParticles against their density's own law
Lab 6 · Classical MLNewton against gradient descent on logistic regression
Lab 7 · Statistical MLEM never goes downhill: the bound under the likelihood
Lab 8 · Fitting and GeneralizingThe smallest fit, and the peak at the interpolation threshold
Lab 9 · NetworksBackpropagation on XOR, checked three ways
Lab 10 · Seeing and RememberingVanishing and exploding gradients through time
Lab 11 · Going DownhillThree ways downhill, against their derived rates
Lab 12 · The Mathematics of ScaleOne learning rate for every width: the coordinate check
Lab 13 · Attention as GeometryLearning inside the prompt: attention against one gradient step
Lab 14 · The Language-Model LineageNext word against fill in the blank, at equal compute
Lab 15 · MemoryA matrix that remembers: crosstalk, and the delta rule
Lab 16 · SparsityThe router's gradient, and balance without a loss
Lab 17 · SiliconTiling, traffic and a systolic array
Lab 18 · Pretraining at ScaleMinHash bands and the pipeline bubble
Lab 19 · InferenceFaster, and exactly the same: speculative sampling and FlashAttention
Lab 20 · Four Ways to GenerateThe adversarial game: the optimal discriminator and the spiral
Lab 21 · Diffusion and FlowGuessing the noise is learning the score
Lab 22 · Images, Video and 3DLight through a volume, and a Gaussian on a screen
Lab 23 · Every Sense Is a TokenCTC: every alignment at once
Lab 24 · Learning Without LabelsInfoNCE: a lower bound with a ceiling
Lab 25 · Symmetry and ScienceSymmetry, checked three ways
Lab 26 · Reinforcement Learning, from Bellman to AlphaZeroBellman's contraction, sweep by sweep
Lab 27 · Post-Training and AlignmentReinforcement learning on a leash, and Goodhart's law
Lab 28 · ReasoningLearning from a checker: GRPO in miniature
Lab 29 · Agents and WorldsBehaviour cloning against DAgger on a windy lane
Lab 30 · Inside the ModelMore ideas than dimensions
Lab 31 · Can We Trust It?Measuring honestly, and the arithmetic of control