Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Take a small step downhill, then repeat
Standing on a hillside, you can feel which direction is steepest downhill. Gradient descent says: take a step that way, look again, take another step. Big steps are fast but might overshoot the bottom and land higher up the other side. Tiny steps are safe but slow.
In a long, narrow valley, “steepest downhill” points mostly across the valley, not along it. So you zig-zag from wall to wall, creeping slowly toward the bottom.
Training every neural network, fitting calibration models, tuning controllers and solving large least-squares problems in navigation all use gradient descent or its descendants. Choosing the step size and fixing poor scaling are everyday engineering skills.
- 1. Gradient descent steps in the direction of…
- 2. A step size that's too large can…
- 3. In a narrow valley, gradient descent tends to…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.The update
is the step size (learning rate).
Why the negative gradient? The directional derivative in a unit direction is . By Cauchy–Schwarz it’s smallest, equal to , when . That’s the direction of steepest descent.
Example: a 1-D quadratic
, so .
- : converges, because .
- : reaches the minimum in one step.
- : converges while overshooting back and forth.
- : diverges.
- 1. For f = (a/2)x², GD converges iff…
- 2. The steepest-descent direction is…
- 3. For f = 2x² (a = 4), the one-step step size is…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.Three derivations
- Steepest descent, as in Level 1.
- Minimize a local quadratic model: . Its minimizer is the GD step. Replacing by the true Hessian gives Newton’s method (A6.1-4).
- Gradient flow: , discretized by forward Euler with time step .
Step size, L-smoothness and conditioning
If is -Lipschitz (A3.5-3), then guarantees descent, and is the stability limit on quadratics. On a quadratic with Hessian eigenvalues in , each step contracts the error by
gives , where is the condition number. The best fixed step gives . You need about steps. With that’s thousands.
Practical rules
- Standardize features and choose sensible units. Rescaling changes .
- Check your gradient with finite differences before trusting an optimizer.
- Monitor the loss and . Stop on a small gradient or a small relative change.
- If the loss explodes, lower . If progress is glacial, use a line search (A6.1-5), momentum (A6.3-3) or preconditioning.
- 1. With η = 1/L on a quadratic, the error contracts per step by…
- 2. The best fixed step on a quadratic is…
- 3. Standardizing features mainly reduces…
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.The descent lemma
If is -Lipschitz, then . Put in :
For the objective strictly decreases unless . With , the decrease is at least . ∎
Rates
- Non-convex, L-smooth: summing the descent lemma gives . That’s convergence to a stationary point at rate .
- Convex: .
- μ-strongly convex: , a linear (geometric) rate. Proved in A6.3-2 using the Polyak–Łojasiewicz inequality .
Quadratic analysis
For , the error obeys . In the eigenbasis each component scales by , which gives . Minimizing balances , so . ∎
Exercise 3.1: How many steps for κ = 100, ε = 10⁻⁶, η = 1/L?
. With the optimal step: .
- 1. With η = 1/L, the descent lemma guarantees a decrease of at least…
- 2. On non-convex smooth f, GD guarantees…
- 3. On strongly convex f, GD converges…
Level 4: Expert
★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.Calibrating a gyro bias
A gyro’s bias depends on temperature (≈ 300 K) and supply voltage (≈ 5 V): . With raw features, has condition number about , because the columns are large and nearly collinear with the intercept. GD with the safe step makes essentially no progress in 20,000 steps. After standardizing each feature (zero mean, unit variance), and GD converges in a handful of steps. The model is the same; only the coordinates changed.
Gradient descent in AI, robotics and aerospace
- Deep learning: SGD and its variants train essentially all neural networks (A6.3). The full-batch GD analysis here is the foundation (Bottou, Curtis and Nocedal, 2018).
- Iterative least squares in navigation and calibration, where preconditioning and scaling decide convergence.
- Trajectory optimization: CHOMP is covariant (preconditioned) gradient descent on trajectories (Ratliff et al., 2009).
- Gradient flow connects optimization to dynamical systems and control, including Lyapunov-style convergence proofs (Wilson, Recht and Jordan, 2021).
References
- A. Cauchy (1847). “Méthode générale pour la résolution des systèmes d’équations simultanées.” Comptes Rendus, 25.
- Y. Nesterov (2018). Lectures on Convex Optimization, 2nd ed. Springer. Ch. 1–2.
- J. Nocedal, S. Wright (2006). Numerical Optimization, 2nd ed. Springer. Ch. 3.
- S. Boyd, L. Vandenberghe (2004). Convex Optimization. Cambridge University Press. §9.3.
- S. Bubeck (2015). “Convex optimization: algorithms and complexity.” Foundations and Trends in Machine Learning, 8(3–4).
- L. Bottou, F. Curtis, J. Nocedal (2018). “Optimization methods for large-scale machine learning.” SIAM Review, 60(2).
- H. Karimi, J. Nutini, M. Schmidt (2016). “Linear convergence of gradient and proximal-gradient methods under the Polyak–Łojasiewicz condition.” ECML-PKDD.
- N. Ratliff, M. Zucker, J. A. Bagnell, S. Srinivasa (2009). “CHOMP: gradient optimization techniques for efficient motion planning.” ICRA.
- A. Wilson, B. Recht, M. Jordan (2021). “A Lyapunov analysis of accelerated methods in optimization.” JMLR, 22.
- B. Polyak (1987). Introduction to Optimization. Optimization Software.