Optimization & Generalization
How networks learn and why they work on data they have never seen: gradient descent, backpropagation, stochastic optimizers, and the surprises of overparameterized models.
4 lessons • 30 min read

- 01
Gradient descent and the shape of a loss surface
Every modern neural network is trained by some variant of one idea: compute which way the loss decreases fastest and take a small step that way. This lesson covers why that works, how the step size and the curvature of the loss interact, and what the loss surfaces of large networks look like in practice.
7 min read - 02
Backpropagation is the chain rule, organised
Gradient descent needs the gradient of one scalar loss with respect to every parameter, and a large model has billions of them. Backpropagation computes all of those derivatives for roughly the cost of a couple of extra forward passes. It does so by applying the ordinary chain rule in a particular order and saving the right intermediate results along the way.
7 min read - 03
Stochastic optimization: SGD, momentum and Adam
No one computes the exact gradient of a language model's loss over its full training set: one gradient step would require a pass over trillions of tokens. Training instead uses cheap, noisy gradient estimates and adds two refinements, momentum and per-parameter step sizes. This lesson explains each piece, why it works, and the optimizer settings large models actually use.
7 min read - 04
Generalization: overfitting, regularization and the surprises of overparameterization
A model is useful only if it performs well on data it was not trained on. Classical statistics gave a clear account of when that happens, and modern deep learning broke much of it. Networks with far more parameters than training examples fit their data perfectly and still generalize well. This lesson covers the classical picture, the evidence against it, and what partly replaces it.
9 min read
Reference videos
20:333Blue1BrownGradient descent, how neural networks learn | Deep Learning Chapter 2
Loss surfaces and descent, visually.
Watch
12:473Blue1BrownBackpropagation, intuitively | Deep Learning Chapter 3
What backprop computes, before the calculus.
Watch
2:25:52Andrej KarpathyThe spelled-out intro to neural networks and backpropagation: building micrograd
Build autograd yourself. The chain rule, organised, in code.
Watch
15:52DeepBeanOptimization for Deep Learning (Momentum, RMSprop, AdaGrad, Adam)
How SGD grew into Adam, one fix at a time.
Watch
34:06Welch LabsWhat the Books Get Wrong about AI [Double Descent]
The overparameterization surprise from the generalization lesson.
Watch
Series10 videos3Blue1BrownNeural networks
The whole visual deep-learning series, from neurons to transformers.
Open series
Series10 videosAndrej KarpathyNeural Networks: Zero to Hero
Build everything from backprop to a GPT yourself, in code.
Open series
Series12 videos3Blue1BrownEssence of calculus
Derivatives and the chain rule, visually: the calculus behind gradient descent.
Open series
Series19 videosStanford OnlineStanford CS229: Machine Learning, Spring 2022
The standard university course on supervised learning and generalization.
Open series
Series90 videosAlexander AminiMIT 6.S191: Introduction to Deep Learning
MIT's yearly deep-learning bootcamp: the latest lectures first, then editions back to 2018.
Open series
Series18 videosStanford OnlineStanford CS231N: Deep Learning for Computer Vision, 2025
Its lectures on backprop, optimizers and training dynamics are among the clearest anywhere.
Open series
