Quick recap
The key takeaways of every lesson on one page. Read it in ten minutes to refresh the whole track; open a lesson when a point feels unclear.
01 Loss surfaces and gradient descent
- Gradient descent: , with learning rate (step size) .
- is the direction of steepest descent (Cauchy–Schwarz), and is perpendicular to the level set through .
- On : ; it converges if and only if , and oscillates (but converges) for .
- With several curvatures, one step size must satisfy ; the flat directions then shrink only by per step.
- The best fixed step on is , with factor per step.
- A large ratio of curvatures (condition number ) causes zig-zag across the valley and a slow crawl along it.
- If gradient descent converges, the limit is a stationary point; on a nonconvex loss the start decides which one.
- Stop on a small gradient norm plus a step budget; a small change of alone can stop far from the minimum.
02 Convexity, smoothness, conditioning
- is convex when chords lie on or above the graph; for differentiable , when (tangents below); for twice-differentiable , when everywhere.
- For a convex function every local minimum is global, and a point with is a global minimizer.
- Least squares and logistic regression are convex; neural-network losses are not, because permuting hidden units gives separate minimizers whose midpoint is worse.
- -smooth: is -Lipschitz ( for convex functions). -strongly convex: . Condition number ; for a quadratic, the ratio of the extreme eigenvalues.
- Descent lemma: ; a step decreases by at least .
- PL inequality: ; strong convexity implies it, but some nonconvex functions satisfy it too.
- Feature scaling is a diagonal preconditioner: it changes from about to about 1 for uncorrelated features, but cannot remove correlations ().
03 GD rates and line search
- On a quadratic with eigenvalues in , gradient descent multiplies the error component along each eigenvector by ; the total factor is .
- Gradient descent on a quadratic converges from every start exactly when ; the steep direction sets this limit.
- The best fixed step is with factor : about steps for accuracy . The step needs about twice as many.
- For -smooth, -strongly convex , the step gives (descent lemma + PL).
- For -smooth convex , the step gives : a sublinear rate, and may converge much more slowly.
- Armijo: rejects steps that are too long. Backtracking () stops with , without knowing .
- Wolfe = Armijo + curvature (, or for strong Wolfe), with ; usually , .
- The curvature condition guarantees , which keeps the BFGS matrix positive definite.
04 Momentum and Nesterov
- Heavy ball: . For a constant gradient the step approaches : ten times larger for .
- Momentum is a low-pass filter: gradient parts that keep their sign add up, parts that flip sign cancel.
- On a quadratic each eigen-direction follows , with roots of ; complex roots have size exactly .
- Polyak's parameters , give the factor : about steps per digit instead of .
- Heavy ball on a quadratic is stable exactly when and .
- Heavy ball's acceleration is proven only for quadratics; on some smooth strongly convex functions it cycles (Lessard–Recht–Packard).
- Nesterov's method takes the gradient at a look-ahead point. It gives for convex and about for strongly convex , and it is not monotone.
- No method that moves only along past gradients can beat these rates by more than a constant factor (lower bounds); CG is optimal for one fixed quadratic.
05 SGD and batch size
- A minibatch gradient is unbiased, , with variance .
- Far from all examples agree on the direction; near (the region of confusion) they disagree, and the noise does not shrink.
- With a constant step on a -strongly convex, -smooth : . SGD converges linearly to a noise ball, not to .
- In 1D mean estimation the exact floor is ; a step gives the running mean and the error .
- To reach , the steps must satisfy the Robbins–Monro conditions and ; with gives .
- Linear scaling rule: multiply the learning rate by when the batch grows by . It holds while and the step stays below the curvature limit, with warmup.
- The simple noise scale estimates the critical batch size; above it, extra examples per step are mostly wasted.
- Per example gradient, SGD's cost to a fixed accuracy does not depend on ; GD's grows like . On large datasets SGD wins.
06 AdaGrad, RMSProp, Adam, AdamW
- An EMA remembers about steps; with it is biased by the factor .
- AdaGrad divides by the root of the sum of squared gradients (steps decay like ); RMSProp uses an EMA instead, without bias correction (first step ).
- Adam: and are EMAs of and ; , ; . Defaults , , .
- Adam's first step is about in every coordinate; the step is invariant to the gradient scale and is typically at most about .
- Adam is a diagonal preconditioner: it removes bad scaling along the coordinate axes, not along rotated directions.
- A large turns Adam into momentum SGD with step ; gives a shorter memory than and reacts faster to changes in the gradient scale.
- L2 regularization equals weight decay for plain SGD, but inside Adam it is divided by , so weights with large gradients are decayed less. AdamW decays every weight by per step.
07 Schedules, warmup and clipping
- A schedule gives . Warmup + cosine: for , then with .
- WSD = warmup, a stable phase at , and a short cooldown (linear or 1−sqrt); a 10–20% cooldown matched cosine in language-model experiments.
- SGD with a constant step stays in a noise ball whose expected loss is per direction, proportional to ; decaying shrinks it, which is why the loss drops sharply in the cooldown.
- A cosine planned for cannot be stopped early or extended; WSD can be branched from any checkpoint of its stable phase.
- Warmup lets training reach regions of lower sharpness before is large, protects Adam's early second-moment estimate, and is needed with the linear scaling rule for large batches.
- A learning-rate range test increases until the loss blows up; pick a value clearly below the blow-up, which is near on a quadratic.
- Clipping by global norm, , keeps the direction, changes only large gradients, and caps the step length at ; it helps on -smooth losses, .
08 Lagrange multipliers, KKT, duality
- At a constrained minimum of on , a level set of is tangent to the constraint, so (if ). This also holds at constrained maxima.
- The Lagrangian is , with for constraints and of any sign for .
- A multiplier is a price: under strong duality, when constraint is relaxed to .
- KKT conditions: primal feasibility, dual feasibility , complementary slackness , and stationarity .
- For a convex problem, KKT points are global minimizers. Under Slater's condition (a strictly feasible point), KKT is also necessary.
- The dual function is concave and (weak duality). For a feasible , bounds .
- The projection onto the probability simplex is , with one threshold chosen so that the entries sum to 1.
- The lasso dual is s.t. ; at the optimum .
09 Proximal methods and ADMM
- The proximal operator is : move toward small without going far from .
- The prox of with step is soft thresholding, ; it maps a whole interval to exactly 0, which is why the lasso is sparse.
- The prox of the indicator of a closed convex set is the Euclidean projection, so projected gradient is a special case of proximal gradient.
- Proximal gradient: ; with it minimizes an upper bound of , so never goes up.
- For convex and , minimizes if and only if , for any .
- With step : ISTA has ; FISTA has at the same cost per step, but it is not monotone.
- ADMM for s.t. alternates an -minimization, a prox step for , and a dual update ; for the lasso the -step is the soft threshold.
10 Newton, BFGS and Gauss–Newton
- The Newton step solves : it jumps to the minimum of the local quadratic model. On a strictly convex quadratic it needs one step, for any condition number.
- Near a minimizer with and a Lipschitz Hessian, Newton converges quadratically: , so the correct digits double. The result is local.
- Damped Newton adds a line search; when the Hessian is not positive definite, the Newton step can go to a maximum or a saddle, so one modifies the Hessian or uses a trust region.
- Newton's method is affine invariant: rescaling or rotating the variables does not change its iterates (in the new coordinates). Gradient descent is not affine invariant.
- Quasi-Newton methods impose the secant condition . The BFGS update stays positive definite exactly when , which a Wolfe line search guarantees.
- L-BFGS keeps the newest pairs and computes with the two-loop recursion in time and memory.
- Gauss–Newton solves : Newton for without the term . It is quadratic for zero residuals, linear for small ones, and can fail for large ones.
- Levenberg–Marquardt solves ; small gives Gauss–Newton, large a short gradient step , and the gain ratio adapts .
11 Saddles, sharpness and stability
- At a stationary point the Hessian eigenvalues decide: all positive is a strict local minimum, all negative a strict maximum, mixed signs a saddle; a zero eigenvalue makes the test undecided (, , monkey saddle).
- GD with step on an -smooth function bounded below guarantees only : a small gradient, not a minimum.
- Near a strict saddle, the component along a direction with grows by per step; GD converges to a strict saddle only from a measure-zero set of starts, and escape takes about steps.
- Newton's method jumps to any stationary point, including saddles; saddle-free Newton uses .
- A Hessian-vector product costs a small constant times one gradient; power iteration or Lanczos on HVPs gives the top eigenvalue without forming .
- The sharpness sets the stability limit: GD can stay at a minimum only if . In practice rises (progressive sharpening) to about and hovers there (edge of stability) while the loss keeps decreasing.
- Sharpness depends on the parametrization (Dinh et al.), so "flat minima generalize" is a heuristic; SAM minimizes using the gradient at .
12 K-FAC, Shampoo and Muon
- Optimizers differ by their preconditioner: the identity (gradient descent), a diagonal (Adam), the full curvature (Newton), or per-layer Kronecker factors (K-FAC, Shampoo) in between.
- K-FAC approximates the Fisher block of a linear layer, , by with and ; it is exact for one example, and its step needs only two small inverses.
- Steepest descent under a norm: . The norm gives gradient descent, gives sign descent.
- Under the spectral norm the steepest direction is for (Theorem 2): keep the singular vectors and set all singular values to 1. The spectral and nuclear norms are dual.
- Newton–Schulz iterations act on each singular value with the polynomial and leave the singular vectors unchanged.
- Muon = momentum, then five quintic Newton–Schulz steps, applied to the 2D hidden weights only; its singular values end in a band of about , not exactly 1. The factor matches AdamW's update RMS.
- Shampoo steps along ; without accumulation this equals . SOAP runs Adam in the eigenbasis of Shampoo's factors.
- As of 2025–2026, matrix optimizers (Shampoo, Muon, SOAP) are the fastest well-tested methods, but with carefully tuned baselines their speedup over AdamW shrinks with model size (about at 0.1B to at 1.2B parameters).