Newton & Quasi-Newton Methods
Curvature, quadratic convergence, BFGS and L-BFGS.
Close to a minimizer, Newton's method doubles its number of correct digits at every step, and it does not care how badly the problem is scaled. This lesson proves both facts, shows how damping and self-concordance make it work from far away (the engine of interior-point methods), and builds the quasi-Newton and Gauss–Newton methods that bring curvature to problems too large for a Hessian.
What you’ll learn
- Prove that Newton's method is affine invariant and converges quadratically near a nondegenerate minimizer with a Lipschitz Hessian.
- Explain damped Newton, the Newton decrement and self-concordance, and state the iteration bound that makes interior-point methods polynomial.
- Derive the BFGS update from the secant condition, prove that it preserves positive definiteness, and describe superlinear convergence and the L-BFGS two-loop recursion.
- Derive Gauss–Newton and Levenberg–Marquardt, and explain how Hessian-free optimization and K-FAC bring curvature to deep networks.
Newton's step and affine invariance
Newton's method minimizes the local quadratic model at every step: with (derived in Adaptive & Second-Order Methods). Its natural measure of progress is the Newton decrement
the length of the step in the local metric, , and half its square is the decrease the quadratic model predicts, .
The chain rule transforms the gradient by and the Hessian by :
So the Newton step for is the Newton step for pulled back by , which maps the iterates onto each other, and the decrement's quadratic form is unchanged:
Gradient descent has no such property. On its step maps back to , so it is invariant only under rotations, and rescaling one coordinate changes , the iterates and the step count. A satisfying analysis of Newton's method should therefore avoid constants such as , or a Hessian Lipschitz constant, which all change under rescaling. The classical analysis of the next step uses them anyway; self-concordance, two steps on, repairs this.
You rescale one coordinate of a smooth, strongly convex problem by a factor of , making it badly conditioned. What happens to the number of iterations of pure Newton and of gradient descent (exact arithmetic, gradient descent's step size retuned)?
- Both stay the same
- Newton's stays the same; gradient descent's can grow by orders of magnitude
- Newton's grows; gradient descent's stays the same
- Both grow by about a factor of
Show the answer
B. Newton's stays the same; gradient descent's can grow by orders of magnitude
Newton's iterates transform with the change of variables, so they are the same points of the original space and the count is unchanged. Gradient descent's rate depends on , and rescaling a coordinate by multiplies its curvature by , which can raise by up to that factor.
Local quadratic convergence, and its limits
With , and , write the error as an integral along the segment from (as in the Descent lesson). The Lipschitz Hessian bounds the integral by :
Strong convexity is now assumed only at . Moving a distance away lowers the smallest eigenvalue by at most (Weyl's inequality), so the Hessian stays invertible while :
If , then , which gives the quadratic bound, and the bound is below , so the next iterate lies in the ball too. Induction completes the proof, with .
Where the classical theory falls short. The radius depends on constants that are unknown in practice and change under rescaling, though the iterates do not. Outside some region pure Newton can fail even on a smooth, strictly convex function: for the Newton map is , which converges from , cycles between from and diverges from . On nonconvex functions the method converges just as readily to nondegenerate saddle points and maxima, since it solves without regard to the sign of the curvature.
Run pure Newton on from . After how many steps is for the first time?
Show the answer
3
, , . The convergence is even cubic here, , because removes the quadratic error term. From the same map gives , then , then : divergence.
Damped Newton and self-concordance
Away from the solution, take a damped step , with chosen by backtracking line search: start at and multiply by until the Armijo condition holds, with . Since away from stationary points, the Newton direction is a descent direction wherever the Hessian is positive definite. For strongly convex with a Lipschitz Hessian the method has two phases: a damped phase in which each step lowers by at least a fixed amount, then a quadratic phase in which the full step is always accepted.
Think first For , , an initial gap and , how many iterations does this bound allow, and which term dominates?
, so the damped phase is bounded by iterations, and the quadratic phase by more: about in all. The quadratic phase is nearly free, and the damped-phase term is very conservative in practice. What matters is that no unknown , or appears.
This is what makes interior-point methods polynomial. To solve subject to , they minimize with a self-concordant barrier , such as for linear constraints, for an increasing sequence of , warm-starting Newton each time. For a barrier with parameter ( for linear inequalities), path-following needs Newton steps in all (Nesterov & Nemirovski, 1994), the theory behind efficient solvers for linear, quadratic, second-order cone and semidefinite programs.
Quasi-Newton methods: BFGS and L-BFGS
Quasi-Newton methods replace by an approximation built from gradients. With and , the fundamental theorem of calculus gives : the gradient change reveals the average Hessian along the last step, in one direction. The secant condition asks the new approximation to reproduce it, , or for an inverse approximation , . A positive definite solution can exist only under the curvature condition (since then ); it is automatic for strongly convex , and a Wolfe line search enforces it otherwise.
Secant condition. Since , the right factor annihilates and the last term maps it to :
Positive definiteness. For any , set . The quadratic form splits into two nonnegative terms when :
Both terms vanish only if and , and then . So , and the next direction is a descent direction.
Convergence. With a Wolfe line search, BFGS converges globally on smooth, strongly convex functions (Nocedal & Wright, 2006, §6.4) and superlinearly near a minimizer where the Hessian is positive definite and Lipschitz. The Dennis–Moré theorem (1974) explains how: a quasi-Newton method taking unit steps converges superlinearly exactly when . The approximation never has to converge to the Hessian; it only has to act like it along the steps actually taken. On a strictly convex quadratic with exact line searches, BFGS terminates in at most steps. For nonconvex functions there is no general global guarantee, and counterexamples exist; explicit non-asymptotic superlinear rates for the classical methods were proved only in the early 2020s.
LBFGS_DIRECTION(g, pairs (s_i, y_i) for i = t−m, ..., t−1) # Nocedal & Wright, Algorithm 7.4
q ← g
for i = t−1 down to t−m: # newest pair first
ρ_i ← 1 / (y_i · s_i)
a_i ← ρ_i (s_i · q)
q ← q − a_i y_i
γ ← (s_{t−1} · y_{t−1}) / (y_{t−1} · y_{t−1})
r ← γ q # initial inverse Hessian H0 = γ I
for i = t−m up to t−1: # oldest pair first
b ← ρ_i (y_i · r)
r ← r + (a_i − b) s_i
return −r # = −H_t gThe two-loop recursion applies the inverse-Hessian approximation that BFGS would build from the last pairs, starting from the scaled identity , without forming any matrix: about multiplications and stored vectors (Liu & Nocedal, 1989).
Gauss–Newton, Levenberg–Marquardt and curvature for deep networks
For a sum of squared residuals with Jacobian , the Hessian has two parts:
Gauss–Newton drops the second part, which is small when the residuals are small or nearly linear, and solves the normal equations of the linearized problem . Its matrix is positive semidefinite, so with of full column rank the step is a descent direction:
Levenberg–Marquardt adds damping (Levenberg, 1944; Marquardt, 1963), moving between Gauss–Newton () and a short gradient step (); rises after a rejected step and falls after a good one, a trust-region strategy:
For a convex loss of a model's outputs , the same idea keeps the loss's curvature and drops the model's. The generalized Gauss–Newton matrix is positive semidefinite whenever is convex, unlike the Hessian of a network's loss:
Curvature without storing it. A network with parameters has no storable Hessian, but curvature-vector products are cheap. Pearlmutter (1994) showed how to compute exactly at a small constant multiple of the cost of a gradient, and a product needs one forward-mode and one reverse-mode pass. Hessian-free optimization (Martens, 2010) solves approximately by conjugate gradients using only such products, with Levenberg–Marquardt damping.
K-FAC (Martens & Grosse, 2015) approximates each layer's block of the Fisher matrix, which for common losses coincides with the generalized Gauss–Newton matrix (Mirror Descent & Natural Gradient). For a layer , with the back-propagated gradient with respect to (for targets sampled from the model's own predictions), the block is , and K-FAC replaces the expectation of the product by the product of expectations:
Two inverses the size of the layer's input and output replace one whose size is the square of the layer's weight count.
Key takeaways
- Newton's method is affine invariant: its iterates and its decrement do not depend on the coordinates. With an -Lipschitz Hessian and it converges quadratically from within , while pure Newton can diverge from farther away.
- For self-concordant functions (), damped Newton needs at most iterations, a bound free of problem constants that makes interior-point methods polynomial.
- BFGS enforces the secant condition with a rank-two update that stays positive definite when . It converges superlinearly when it acts like the Hessian along its steps (Dennis–Moré), and L-BFGS applies it in time with a two-loop recursion.
- Gauss–Newton and Levenberg–Marquardt drop the residuals' curvature and add damping. Hessian-free optimization and K-FAC bring generalized Gauss–Newton or Fisher curvature to deep networks through matrix-vector products and Kronecker factors.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
After an invertible linear change of variables , which method produces the same iterates once they are mapped back to , for every ?
- Gradient descent
- Adam
- Coordinate descent
- Newton's method
Show the answer
D. Newton's method
Newton's step transforms as , so its iterates are the same points of the original space. That is why its speed does not depend on the condition number.
BFGS is about to update with a pair satisfying . What is the risk, and the remedy?
- None: the BFGS update always preserves positive definiteness
- may fail to be positive definite, so may not be a descent direction; a Wolfe line search, skipping the update or a damped update prevents it
- No symmetric matrix satisfies the secant condition any more
- The method automatically switches to gradient descent
Show the answer
B. may fail to be positive definite, so may not be a descent direction; a Wolfe line search, skipping the update or a damped update prevents it
The proof needs . With negative curvature along , no positive definite can satisfy , since that would force . Implementations enforce the curvature condition with a Wolfe line search, skip the update, or use Powell's damped modification.
When does the Gauss–Newton matrix equal the true Hessian of ?
- Always
- Whenever has full column rank
- When the residuals are affine in , or all vanish at the point
- Never: is only ever an approximation
Show the answer
C. When the residuals are affine in , or all vanish at the point
The dropped term vanishes when every (linear least squares) or every (a zero-residual solution). Near a zero-residual minimizer Gauss–Newton therefore converges quadratically, like Newton; with large residuals it can be slow.
K-FAC approximates a layer's Fisher block by . Why does this help?
- Inverting needs only and , matrices the size of the layer's input and output, instead of one matrix the size of the weight count squared
- It makes the Fisher block diagonal
- It removes the need for back-propagated gradients
- It is exact for every network
Show the answer
A. Inverting needs only and , matrices the size of the layer's input and output, instead of one matrix the size of the weight count squared
, and applying it to the gradient is the matrix product . For a layer with inputs and outputs that means inverses of sizes and instead of one of size .
Further reading
- J. Nocedal & S. J. Wright, Numerical Optimization, 2nd ed. (Springer, 2006), chapters 3, 6, 7 and 10.
- S. Boyd & L. Vandenberghe, Convex Optimization (Cambridge University Press, 2004), chapters 9–11.
- Yu. Nesterov & A. Nemirovskii, Interior-Point Polynomial Algorithms in Convex Programming (SIAM, 1994).
- D. C. Liu & J. Nocedal, "On the limited memory BFGS method for large scale optimization," Mathematical Programming 45, 503–528 (1989).
- J. Martens & R. Grosse, "Optimizing neural networks with Kronecker-factored approximate curvature," Proceedings of the 32nd International Conference on Machine Learning, PMLR 37, 2408–2417 (2015).