AAI, Built

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 modelsLab 2 · Thinking MachinesAlpha-beta: the same move from far fewer leavesLab 3 · Vectors That Mean ThingsPower iteration and the best low-rank copyLab 4 · ChangeThe gradient check and its V-curveLab 5 · Randomness in MotionParticles against their density's own lawLab 6 · Classical MLNewton against gradient descent on logistic regressionLab 7 · Statistical MLEM never goes downhill: the bound under the likelihoodLab 8 · Fitting and GeneralizingThe smallest fit, and the peak at the interpolation thresholdLab 9 · NetworksBackpropagation on XOR, checked three waysLab 10 · Seeing and RememberingVanishing and exploding gradients through timeLab 11 · Going DownhillThree ways downhill, against their derived ratesLab 12 · The Mathematics of ScaleOne learning rate for every width: the coordinate checkLab 13 · Attention as GeometryLearning inside the prompt: attention against one gradient stepLab 14 · The Language-Model LineageNext word against fill in the blank, at equal computeLab 15 · MemoryA matrix that remembers: crosstalk, and the delta ruleLab 16 · SparsityThe router's gradient, and balance without a lossLab 17 · SiliconTiling, traffic and a systolic arrayLab 18 · Pretraining at ScaleMinHash bands and the pipeline bubbleLab 19 · InferenceFaster, and exactly the same: speculative sampling and FlashAttentionLab 20 · Four Ways to GenerateThe adversarial game: the optimal discriminator and the spiralLab 21 · Diffusion and FlowGuessing the noise is learning the scoreLab 22 · Images, Video and 3DLight through a volume, and a Gaussian on a screenLab 23 · Every Sense Is a TokenCTC: every alignment at onceLab 24 · Learning Without LabelsInfoNCE: a lower bound with a ceilingLab 25 · Symmetry and ScienceSymmetry, checked three waysLab 26 · Reinforcement Learning, from Bellman to AlphaZeroBellman's contraction, sweep by sweepLab 27 · Post-Training and AlignmentReinforcement learning on a leash, and Goodhart's lawLab 28 · ReasoningLearning from a checker: GRPO in miniatureLab 29 · Agents and WorldsBehaviour cloning against DAgger on a windy laneLab 30 · Inside the ModelMore ideas than dimensionsLab 31 · Can We Trust It?Measuring honestly, and the arithmetic of control