23 Optimization
Every neural network in this book is trained by the same basic loop: compute the gradient of the loss, take a step in the opposite direction, and repeat. In Chapter 9, we saw empirically what momentum, adaptive step sizes, and learning-rate schedules do for that loop on real networks, leaving three questions open. Why is there a hard ceiling on the learning rate? Why can a step safely below that ceiling still make painfully slow progress? And why does gradient noise keep a training run from settling down?
Optimization theory ties each question to the geometry of the objective. The steepest curvature sets the largest safe step size; the ratio of the steepest curvature to the flattest sets the iteration count; and convexity decides whether a stationary point is globally optimal. Throughout this chapter, we return to the narrow bowl , which is a thousand times steeper in one direction than in the other: a step size that stays safe along the steep wall barely nudges the iterate along the flat valley. While Chapter 9 focuses on practice and measurement, this chapter supplies the self-contained proofs and underlying geometry.
The chapter unfolds in three parts. Under exact gradients, Section 23.1 proves the step-size ceiling and iteration count and shows how momentum replaces the curvature ratio with its square root, while Section 23.3 establishes when stationary points are global minima; between them, Section 23.2 covers Newton, quasi-Newton, and trust-region methods that actively model curvature. Turning to noisy gradients, Section 23.4 shows why fixed-step SGD stalls at a noise floor proportional to the step size, and Section 23.5 tests per-coordinate scaling and AdamW against heavy-ball momentum. Finally, Section 23.6 and Section 23.7 develop KKT conditions, projections, proximal steps, and duality behind norm budgets (Section 2.7), and Section 23.8 analyzes floating-point precision, cancellation, and conditioning (Section 5.5).
We assume familiarity with gradients and Hessians (Section 22.2) and eigendecompositions (Section 21.3). Because deep-network losses are neither globally smooth nor convex, our theorems serve as local models whose limits each section notes explicitly; interior-point and operator-splitting methods are surveyed in Section 23.9.
- 23.1 Gradient Descent and Curvature
- 23.2 Curvature Methods: Newton, Quasi-Newton, and Trust Regions
- 23.3 Convexity
- 23.4 Stochastic Gradient Methods
- 23.5 Adaptive Methods
- 23.6 Constrained Optimization
- 23.7 Duality
- 23.8 Numerical Stability and Conditioning
- 23.9 Further Reading
Notation#
Throughout this chapter, we follow the conventions summarized in Table 23.1. Each section restates the symbols it uses most, and notation specific to a single section is introduced where it first appears.
| Symbol | Meaning |
|---|---|
| , | objective; training loss as a function of the weights |
| , | a minimizer and the minimum value |
| , , | gradient, Hessian; the gradient (or a stochastic gradient) used at step |
| , | smoothness and strong-convexity constants, |
| ; | condition number of the problem; of a matrix, |
| , | eigenvalues of a Hessian or of a quadratic's matrix |
| , | step size (learning rate); momentum coefficient |
| , | iteration index; optimizer step in the adaptive methods |
| target accuracy; in Adam, the constant that keeps a division finite | |
| , , , | number of examples; number of variables; a minibatch and its size |
| covariance of a per-example gradient | |
| , ; , | Adam's first- and second-moment estimates; their decay rates |
| preconditioner: the step is | |
| , | inequality constraints ; equality constraints |
| , | multipliers of inequality and equality constraints; also weights the decay term |
| , | Lagrangian; dual function |
| , | optimal values of the primal and the dual problem |
| convex conjugate of | |
| , | Euclidean projection onto a set ; proximal operator of |
| , | unit roundoff and machine epsilon of a floating-point format, |