Basic Prerequisites: 03 · Multivariable Calculus (gradient, Hessian) and 04 · Constrained Optimization (stationarity).
1. Intuition & Practical Objective
When a stationary point has no closed form - a logistic regression, a neural-network loss, a calibration objective - you find it by iteration. Two algorithms dominate everything, and they are opposite in temperament:
- Gradient descent uses only first-order information: step in the direction that locally decreases the objective fastest, . It is cheap (no Hessian), needs almost no memory, and scales to millions of parameters - but its speed is dictated by the problem’s conditioning, and on a stretched valley it crawls.
- Newton’s method uses second-order information: solve the local quadratic model exactly, . It is expensive (a linear solve per step) but affine-invariant and quadratically convergent near the optimum - the number of correct digits roughly doubles each iteration.
The objective is to understand when each wins, in quantitative terms: the gradient method’s convergence factor is (Boyd eq. 9.18), governed by the condition number ; Newton’s rate is quadratic and blind to the condition number, at the price of an solve and a need for . This tension - cheap-and-slow versus dear-and-fast - is the central trade-off of numerical optimisation and of machine learning.
The one-sentence essence. “Both methods minimise a local quadratic model of the objective; gradient descent uses a model with the identity curvature (so its step is scaled by and it is slow when the true curvature is anisotropic), whereas Newton uses the true curvature (so it is scale-free and converges quadratically).“
2. Mathematical Ground Truth & Derivations
The descent-method template. A descent method picks a direction with (a descent direction) and a step size , then sets . Gradient descent takes ; the step length is chosen by exact line search (minimise along the ray) or backtracking (Armijo: shrink until ).
Strong convexity and smoothness (the two constants). Assume for all in the region of interest
bounds the minimum curvature (strong convexity), the maximum (Lipschitz gradient). Two consequences are used constantly (Boyd §9.1.2):
where is the optimal value.
Gradient descent with exact line search (Boyd §9.3.1). With step the quadratic upper bound (eq. 9.17) gives
and combining with the strong-convexity bound yields the linear convergence result
The iteration count to reach accuracy is therefore
and since for large , the count grows linearly in the condition number . This is the entire reason ill-conditioned problems are slow: the level sets are thin ellipses, and a first-order step oscillates across the valley while barely advancing along it.
Newton’s method (Boyd §9.5). The Newton step is
It minimises the second-order Taylor model exactly. If then
so it is a descent direction; is the Newton decrement, and estimates the suboptimality (a natural stopping criterion). Equivalent expressions: (eq. 9.29) and (eq. 9.30).
Three properties make Newton special:
- Affine invariance. Under , the Newton step transforms as - the method is independent of the coordinate system, unlike gradient descent.
- Exact on quadratics. For , Newton reaches the minimiser in one step, because the quadratic model is the function.
- Quadratic convergence near . In the pure Newton phase () the error satisfies - the number of correct digits roughly doubles per iteration. The damped (backtracking) version adds a line search so it also converges from far away: a “damped Newton phase” at linear rate, then a quadratic phase, with a total bound roughly -flavoured (Boyd §9.5.3).
The cost. Newton needs and a solve ( dense, or the structure of the Hessian). Quasi-Newton methods (BFGS, L-BFGS) build a cheap Hessian approximation from gradient differences - the practical compromise when is large.
3. Computational Implementation - linear versus quadratic convergence, measured
Stdlib only. Part (A) runs gradient descent on a coupled quadratic with condition number and counts iterations against the theoretical bound; part (B) shows Newton solving the same quadratic in one step; part (C) shows quadratic convergence on a non-quadratic objective.
Read the output. (A) Gradient descent takes iterations to reach on a condition-number- problem - far more than Newton’s one, and already in the regime where the exact method counts (the bound of - computed for an assumed initial-gap ratio; the experiment’s own ratio gives , so is a touch optimistic - is worst-case, so the measured count is better than the guarantee, but the order of magnitude - “hundreds of cheap steps versus one expensive solve” - is the real comparison). (B) Newton lands exactly on in a single step, because for a quadratic the model is the function. (C) On a non-quadratic, Newton’s error sequence is - each iteration squares the previous error (roughly: and so on down), i.e. quadratic convergence, reaching machine precision in four steps.
4. Failure Modes & First-Principles Breakdowns
- A too-large step makes gradient descent diverge. The guarantee needs (or backtracking). With the iteration overshoots and the error grows geometrically - same formula, opposite sign of the exponent.
- Ill-conditioning is the dominant practical failure. Iterations scale like . In finance is routinely – (covariance matrices, deep-network Hessians), so plain gradient descent needs millions of steps; the fix is preconditioning, a better norm, or a second-order/quasi-Newton method.
- Newton needs at the current point. Where curvature is negative the Newton step is an ascent direction and the iterate can fly to a maximum or diverge. The damped/guarded version (line search accepting only that decreases ) is mandatory in practice, not optional.
- Newton’s per-step cost can dominate. An dense solve per iteration is hopeless for ; and forming may be infeasible. This is the entire motivation for quasi-Newton (L-BFGS) and stochastic gradient methods in machine learning.
- The Newton decrement is a quadratic-model estimate of suboptimality. Stopping when can stop early when the model is a poor fit (highly non-quadratic behaviour); pair it with an actual function-value decrease check.
- Stochastic gradients are unbiased but noisy. In ML, is estimated from a minibatch; the noise makes a fixed step size bounce in a ball around the optimum, and the “convergence rate” is no longer the deterministic . Constant-step SGD converges to a neighbourhood, not to the point - a first-principles distinction that trips up practitioners reading deterministic theory.
5. References
- Boyd & Vandenberghe: Convex Optimization
- Nocedal & Wright: Numerical Optimization (2nd ed.)
- Simon & Blume: Mathematics for Economists
- Hastie, Tibshirani & Friedman: The Elements of Statistical Learning
6. Connected Graph Bridges
- Back: 04 · Constrained Optimization · Index Hub
- Next: 06 · Convexity & Applications
- Applied: Numerical Optimization (the methods as numerical primitives) · Machine Learning (SGD, IRLS, gradient boosting) · Mean–Variance Optimization
- Base: 03 · Multivariable Calculus (Hessian, conditioning)