Ten problems on Newton's method: the step as the minimiser of the quadratic model and the Newton decrement, the square root of 2 by hand, the proof of quadratic convergence with the error recurrence made exact, a one-dimensional minimisation with the digits doubling, affine invariance against gradient descent, why Newton finds critical points rather than minima and when its step points uphill, the Gauss–Newton approximation for least squares, Levenberg–Marquardt damping as an interpolation between Newton and gradient descent, the secant step as the first quasi-Newton update, and a two-cycle that shows convergence is only local, with worked solutions and the mistakes that iterate on f instead of f', treat Gauss–Newton as exact, take the Newton direction as a descent direction, assume convergence from any start, or expect rescaling the loss to rescale the step.
Before you start
Gradient descent uses the slope; Newton's method also uses the curvature, and the difference is the difference between a rate of convergence that depends on how stretched the loss is and one that does not. The method is simple to state, minimise the quadratic model and jump to its minimum, and everything interesting is in what the model gets wrong: far from the solution the model is poor, at a saddle its minimum is a maximum, and for a least-squares loss half of its Hessian is usually not worth computing. These ten problems derive the step and the decrement, compute 2 and a one-dimensional minimiser by hand and watch the correct digits double, prove quadratic convergence and make the error recurrence exact for a square root, show that the step is unchanged by a change of coordinates while gradient descent's is not, follow the method to a maximum, derive Gauss–Newton and the damping that turns it into Levenberg–Marquardt, take a secant step as the first quasi-Newton update, and end with a cubic on which undamped Newton cycles forever. The five mistakes at the end are the ones that produce an iteration that still runs: Newton on f when the target is ,f′=0, Gauss–Newton called exact, an uphill Newton direction fed to a line search, local convergence read as global, and a step that was expected to shrink with the loss.
f is a twice-differentiable function of x∈Rn (or of a scalar ),x), with gradient ∇f and Hessian ;H=∇2f; a minimiser is x∗ and the error at step k is .ek=xk−x∗. The quadratic model of f at x is ,mx(δ)=f(x)+∇f(x)⊤δ+21δ⊤H(x)δ, the second-order Taylor polynomial (the Taylor-series page).
Newton's method for minimisation steps to the minimiser of the model: xk+1=xk+δk with .H(xk)δk=−∇f(xk). For a scalar function this is .xk+1=xk−f′(xk)/f′′(xk). The Newton decrement is .λ(x)2=∇f(x)⊤H(x)−1∇f(x).
Newton's method for a root of g(x)=0 is ;xk+1=xk−g(xk)/g′(xk); minimisation is root-finding on ,g=f′, since .g′=f′′.ξ denotes a point between xk and x∗ supplied by Taylor's theorem.
Gradient descent is xk+1=xk−η∇f(xk) with step size .η>0. A symmetric matrix A is positive definite (PD, )A≻0) if v⊤Av>0 for all v=0 (the positive-definite page); its eigenvalues are λi with λmin and λmax the extremes. A direction d is a descent direction at x if .∇f(x)⊤d<0.
For least squares, r(θ)∈RN is the residual vector with Jacobian J=∂r/∂θ∈RN×p (numerator layout, the Jacobians page), and .f(θ)=21∥r(θ)∥2.∇2rn is the p×p Hessian of the n-th residual.
Show that the minimiser of the quadratic model mx(δ) when H(x)≻0 is ,δ∗=−H(x)−1∇f(x), and that the model predicts the decrease .f(x)−mx(δ∗)=21∇f(x)⊤H(x)−1∇f(x)=21λ(x)2. Why is H≻0 needed?
·
Derive the root-finding iteration xk+1=xk−g(xk)/g′(xk) as the zero of the tangent line, and apply it to g(x)=x2−2 from .x0=1. Simplify the iteration, compute x1,x2,x3 exactly and the errors xk−2 to two significant figures.
···
Let x∗ be a root of g with g′(x∗)=0 and g′′ continuous. Show that ek+1=2g′(xk)g′′(ξk)ek2 for some ξk between xk and ,x∗, so that convergence is quadratic once it starts: ∣ek+1∣≤C∣ek∣2 near .x∗. For ,g(x)=x2−a, show the exact recurrence ek+1=ek2/(2xk) and check it against Problem 2.
··
Minimise f(x)=ex−2x by Newton's method from .x0=0. Write the iteration, compute x1,x2,x3 to four decimals and the errors xk−x∗ for ,k=1,…,4, and verify that ek+1/ek2 approaches the constant of Problem 3.
··
Let y=Bx+c with B invertible, and define ,h(y)=f(x), that is .h(y)=f(B−1(y−c)). Show that ∇h(y)=B−⊤∇f(x) and ,∇2h(y)=B−⊤∇2f(x)B−1, and that the Newton step in y is B times the Newton step in ,x, so the iterates correspond: yk=Bxk+c for all .k. Show that gradient descent does not have this property unless B is orthogonal.
··
Apply Newton's method to f(x)=x3−3x from :x0=−21: compute x1 and x2 and say where the iteration converges and what kind of point that is. Then, for f(x,y)=x2−y2 at ,(1,2), compute the Newton step and show that it is not a descent direction.
···
For f(θ)=21∥r(θ)∥2 with r:Rp→RN and Jacobian ,J, show that ∇f=J⊤r and .∇2f=J⊤J+∑n=1Nrn∇2rn. The Gauss–Newton step drops the second term: .δGN=−(J⊤J)−1J⊤r. Show that δGN is the least-squares solution of the linearised problem ,minδ∥r+Jδ∥2, and that for a linear residual r(θ)=Aθ−b Gauss–Newton equals Newton and reaches the solution in one step.
··
The damped step is δμ=−(H+μI)−1∇f for μ≥0 with .H⪰0. Show that (a) δμ→δNewton as μ→0 when ,H≻0, and δμ≈−μ1∇f as ;μ→∞; (b) δμ is a descent direction for every ;μ>0; (c) ∥δμ∥ is decreasing in ;μ; (d) δμ minimises .mx(δ)+2μ∥δ∥2.
··
The secant method replaces g′(xk) in Newton's iteration by the slope .Bk=xk−xk−1g(xk)−g(xk−1). Starting from ,x0=1,x1=23 for ,g(x)=x2−2, compute x2 and x3 and their errors. Show that Bk is the unique scalar satisfying the secant equation ,Bk(xk−xk−1)=g(xk)−g(xk−1), and that for g=f′ this is the one-dimensional case of the quasi-Newton condition Bksk=yk with sk=xk−xk−1 and .yk=∇f(xk)−∇f(xk−1).
···
Apply Newton's method to g(x)=x3−2x+2 from x0=0 and from .x0=−2. Compute the first iterates in each case, say what happens, and explain the two outcomes in terms of Problem 3.
Answers
δ∗=−H(x)−1∇f(x) and f(x)−mx(δ∗)=21∇f(x)⊤H(x)−1∇f(x)=21λ(x)2
;xk+1=21(xk+2/xk);,x1=23,,x2=1217,,x3=408577, with errors ,8.6×10−2,,2.5×10−3,2.1×10−6
,ek+1=2g′(xk)g′′(ξk)ek2, quadratic convergence with ;C≈2∣g′(x∗)∣∣g′′(x∗)∣; for ,x2−a, exactly ,ek+1=2xkek2, which reproduces Problem 2's errors
;xk+1=xk−1+2e−xk;,x1=1,,x2≈0.7358,;x3≈0.6940; errors ,0.31,,0.043,,9.0×10−4,,4.0×10−7, with ek+1/ek2→21
,∇h=B−⊤∇f,,∇2h=B−⊤∇2fB−1,,δy=Bδx, so yk=Bxk+c throughout; gradient descent is invariant only under orthogonal B
From :x0=−21:,x1=−1.25,,x2=−1.025, converging to the local maximum ;x=−1; for x2−y2 at (1,2) the Newton step (−1,−2)⊤ has ,∇f⊤δ=6>0, an ascent direction, and lands on the saddle
;∇f=J⊤r;;∇2f=J⊤J+∑nrn∇2rn;δGN=−(J⊤J)−1J⊤r solves ;minδ∥r+Jδ∥2; for r=Aθ−b it is the Newton step and reaches (A⊤A)−1A⊤b in one step
δμ→δNewton as μ→0 and δμ≈−μ1∇f as ;μ→∞;∇f⊤δμ<0 for all ;μ>0;∥δμ∥ decreases in ;μ;δμ=argminδ(mx(δ)+2μ∥δ∥2)
,x2=1.4,x3≈1.41379 with errors −1.4×10−2 and ;−4.2×10−4;Bk=xk−xk−1g(xk)−g(xk−1) is the unique solution of ,Bksk=yk, the secant equation
From x0=0 Newton cycles ;0→1→0→⋯; from x0=−2 it converges to x∗≈−1.76929 with errors ,0.23,,0.031,,6.6×10−4,3.1×10−7
Worked solutions
Problem 1
Show that the minimiser of the quadratic model mx(δ) when H(x)≻0 is ,δ∗=−H(x)−1∇f(x), and that the model predicts the decrease .f(x)−mx(δ∗)=21∇f(x)⊤H(x)−1∇f(x)=21λ(x)2. Why is H≻0 needed?
.∇δmx(δ)=∇f(x)+H(x)δ.∇δ(g⊤δ)=g and ∇δ(21δ⊤Hδ)=Hδ for symmetric H (the matrix-calculus page).
.∇δmx=0⟺Hδ=−∇f(x)⟺δ∗=−H−1∇f(x).H≻0 is invertible (the positive-definite page's Problem 2).
,∇δ2mx=H≻0, so δ∗ is the unique minimiser of .mx.A quadratic with PD Hessian has one critical point and it is the global minimum (the positive-definite page's Problem 6).
.mx(δ∗)=f(x)−∇f⊤H−1∇f+21∇f⊤H−1HH−1∇f=f(x)−21∇f⊤H−1∇f.Substitute δ∗=−H−1∇f into the model; .H−1HH−1=H−1.
δ∗=−H(x)−1∇f(x) and f(x)−mx(δ∗)=21∇f(x)⊤H(x)−1∇f(x)=21λ(x)2The Newton step is the jump to the bottom of the local bowl; the decrement λ(x)2 is how deep the bowl says the bottom is, and 21λ2 is the usual stopping test, since it is affine-invariant (Problem 5) where ∥∇f∥ is not. Without H≻0 step 2 still finds the critical point of the model, but step 3 fails: an indefinite H makes that critical point a saddle of the model and the step may go uphill (Problem 6), and a singular H leaves it undefined. The check compares δ∗ against a direct minimisation of the model and the decrease against the model's values.
Problem 2
Derive the root-finding iteration xk+1=xk−g(xk)/g′(xk) as the zero of the tangent line, and apply it to g(x)=x2−2 from .x0=1. Simplify the iteration, compute x1,x2,x3 exactly and the errors xk−2 to two significant figures.
The tangent line at xk is .ℓ(x)=g(xk)+g′(xk)(x−xk).The linear approximation of g at xk (the Taylor-series page).
.ℓ(x)=0⟺x=xk−g(xk)/g′(xk).Solve the linear equation; g′(xk)=0 is needed.
For :g(x)=x2−2:.xk+1=xk−2xkxk2−2=2xk2xk2−xk2+2=21(xk+xk2).Put over the common denominator 2xk and split the fraction.
,x1=21(1+2)=23,,x2=21(23+34)=1217,.x3=21(1217+1724)=408577.;3/22=34;;69+8=617;17/122=1724 and .1217+1724=204289+288=204577.
,x1−2≈8.6×10−2,,x2−2≈2.5×10−3,.x3−2≈2.1×10−6.2=1.41421356… against ,1.5,1.416 and .1.41421569….
;xk+1=21(xk+2/xk);,x1=23,,x2=1217,,x3=408577, with errors ,8.6×10−2,,2.5×10−3,2.1×10−6The number of correct digits roughly doubles each step: ,1,,3,,6, and x4=470832665857 is right to 12 digits. This is the Babylonian method, Newton's method before Newton, and the averaging form of step 3 explains it: xk and 2/xk sit on opposite sides of ,2, and their mean is much closer than either. Problem 3 proves the doubling and makes the error recurrence exact for this .g.
Problem 3
Let x∗ be a root of g with g′(x∗)=0 and g′′ continuous. Show that ek+1=2g′(xk)g′′(ξk)ek2 for some ξk between xk and ,x∗, so that convergence is quadratic once it starts: ∣ek+1∣≤C∣ek∣2 near .x∗. For ,g(x)=x2−a, show the exact recurrence ek+1=ek2/(2xk) and check it against Problem 2.
.0=g(x∗)=g(xk)+g′(xk)(x∗−xk)+21g′′(ξk)(x∗−xk)2.Taylor's theorem for g about ,xk, evaluated at ,x∗, with the Lagrange remainder; .x∗−xk=−ek.
.g(xk)=g′(xk)ek−21g′′(ξk)ek2.Rearrange step 1, using (x∗−xk)=−ek and .(x∗−xk)2=ek2.
.ek+1=xk+1−x∗=ek−g′(xk)g(xk)=ek−ek+2g′(xk)g′′(ξk)ek2=2g′(xk)g′′(ξk)ek2.Subtract x∗ from the Newton update and substitute step 2 for ;g(xk); the linear terms cancel exactly.
Near ,x∗,g′(xk)→g′(x∗)=0 and ,g′′(ξk)→g′′(x∗), so ∣ek+1∣≤C∣ek∣2 with .C≈2∣g′(x∗)∣∣g′′(x∗)∣.Continuity bounds the ratio once xk is close; the error is squared each step, and if C∣ek∣<1 the sequence C∣ek∣ is squared each step too, which is the doubling of correct digits.
For :g(x)=x2−a:.xk+1−a=21(xk+xka)−a=2xkxk2−2axk+a=2xk(xk−a)2.Common denominator, then recognise the perfect square. Here g′′=2 is constant, so step 3's ξk drops out and the recurrence is exact.
Problem 2: e2=e12/(2x1)=(0.0858)2/3=2.45×10−3 and .e3=e22/(2x2)=(2.453×10−3)2/2.83=2.12×10−6.Step 5 with x1=23 and ;x2=1217; both match Problem 2 to the digits shown.
,ek+1=2g′(xk)g′′(ξk)ek2, quadratic convergence with ;C≈2∣g′(x∗)∣∣g′′(x∗)∣; for ,x2−a, exactly ,ek+1=2xkek2, which reproduces Problem 2's errorsThe proof is one line of Taylor: Newton solves the linear part of g exactly, so what remains is the quadratic remainder. Three things in it are conditions, not decorations: g′(x∗)=0 (at a double root the convergence drops to linear with ratio ),21),xk close enough that C∣ek∣<1 (Problem 10 shows what happens otherwise), and g′′ bounded. For minimisation, g=f′ and the condition is ,f′′(x∗)=0, a non-degenerate minimum.
Problem 4
Minimise f(x)=ex−2x by Newton's method from .x0=0. Write the iteration, compute x1,x2,x3 to four decimals and the errors xk−x∗ for ,k=1,…,4, and verify that ek+1/ek2 approaches the constant of Problem 3.
f′(x)=ex−2 and ;f′′(x)=ex;f′=0 at ,x∗=log2≈0.6931, where ,f′′=2>0, a minimum.Differentiate; ex=2 has the unique solution ,log2, and a positive second derivative there makes it a strict minimum.
.xk+1=xk−exkexk−2=xk−1+2e−xk.Newton on g=f′ with ;g′=f′′; divide each term of the numerator by .exk.
;x1=0−1+2=1;;x2=1−1+2e−1≈0.7358;.x3≈0.7358−1+2e−0.7358≈0.6940.e−1≈0.36788 and .e−0.7358≈0.47914.
,e2/e12≈0.452,,e3/e22≈0.493,,e4/e32≈0.500, and Problem 3's constant is .2g′(x∗)g′′(x∗)=2ex∗ex∗=21.g=ex−2 has ;g′=g′′=ex; the ratios approach 21 from below as .xk→x∗.
;xk+1=xk−1+2e−xk;,x1=1,,x2≈0.7358,;x3≈0.6940; errors ,0.31,,0.043,,9.0×10−4,,4.0×10−7, with ek+1/ek2→21Correct digits: ,0,,1,,3,,6, then 13 at .x5. Each Newton step is a gradient step with the step size η=1/f′′(xk) chosen by the curvature: 1 at ,x0,1/e at ,x1, and 21 near the solution, which is why no learning rate appears. A fixed η=21 would converge only linearly, with ratio ,∣1−21f′′(xk)∣, and η=1 would overshoot: f′′ varies by a factor of e over the first step. Mistake 1 applies this iteration to f instead of .f′.
Problem 5
Let y=Bx+c with B invertible, and define ,h(y)=f(x), that is .h(y)=f(B−1(y−c)). Show that ∇h(y)=B−⊤∇f(x) and ,∇2h(y)=B−⊤∇2f(x)B−1, and that the Newton step in y is B times the Newton step in ,x, so the iterates correspond: yk=Bxk+c for all .k. Show that gradient descent does not have this property unless B is orthogonal.
x=B−1(y−c) has Jacobian ,∂x/∂y=B−1, so .∇h(y)=(B−1)⊤∇f(x)=B−⊤∇f(x).Chain rule for a scalar through a linear map: the gradient picks up the transpose of the Jacobian (the Jacobians page).
.∇2h(y)=B−⊤∇2f(x)B−1.Differentiate step 1 again in :y:∇f(x) changes by ,∇2f(x)∂x/∂y=∇2f(x)B−1, with the constant B−⊤ in front.
Newton in :y:.δy=−(B−⊤HB−1)−1B−⊤∇f=−BH−1B⊤B−⊤∇f=−BH−1∇f=Bδx.,(B−⊤HB−1)−1=BH−1B⊤, the inverse of a product in reverse order; .B⊤B−⊤=I.
If yk=Bxk+c then .yk+1=yk+δy=Bxk+c+Bδx=B(xk+δx)+c=Bxk+1+c.Induction on k with step 3; it starts because y0=Bx0+c by choice.
Gradient descent in :y:,yk+1=yk−ηB−⊤∇f, while the image of the x-step is .B(xk−η∇f)+c=yk−ηB∇f. These agree for every ∇f only when ,B−⊤=B, that is .B⊤B=I.Compare the two updates term by term; equality for all gradient vectors forces the matrices to be equal.
,∇h=B−⊤∇f,,∇2h=B−⊤∇2fB−1,,δy=Bδx, so yk=Bxk+c throughout; gradient descent is invariant only under orthogonal BNewton's method does not care how the problem is parameterised: rescale a feature by ,1000, change units, rotate the axes, and it takes the same path, because the Hessian's change undoes the gradient's. Gradient descent sees the scaling as a change in conditioning (the positive-definite page's Problem 9), which is why feature normalisation, batch norm and Adam's per-coordinate scaling matter for first-order methods and are irrelevant to Newton. The decrement λ2=∇f⊤H−1∇f is invariant for the same reason, so it is the right stopping criterion. Mistake 5 is the special case .B=cI.
Problem 6
Apply Newton's method to f(x)=x3−3x from :x0=−21: compute x1 and x2 and say where the iteration converges and what kind of point that is. Then, for f(x,y)=x2−y2 at ,(1,2), compute the Newton step and show that it is not a descent direction.
f′(x)=3x2−3 and ;f′′(x)=6x; the critical points are ,x=±1, with f′′(1)=6>0 (minimum) and f′′(−1)=−6<0 (maximum).Differentiate; 3x2−3=0 at ;x=±1; the sign of f′′ classifies them.
.x1=−21−6⋅(−21)3⋅41−3=−21−−3−2.25=−21−0.75=−1.25.Newton on ;f′; both numerator and denominator are negative, so the step is to the left, away from the minimum at .+1.
.x2=−1.25−−7.53⋅1.5625−3=−1.25+7.51.6875=−1.25+0.225=−1.025.The same iteration; the errors from −1 are 0.25 and then ,0.025, already shrinking quadratically.
The iteration converges to ,x=−1, the local maximum.Newton solves f′=0 and converges to whichever critical point it starts near; with f′′(x0)<0 the quadratic model is an upside-down parabola and its "minimiser" is a maximiser.
For :f(x,y)=x2−y2:∇f=(2x,−2y)⊤=(2,−4)⊤ and ,H=diag(2,−2), so .δ=−H−1∇f=−(1,2)⊤=(−1,−2)⊤.Partial derivatives; H is constant and indefinite, and .H−1=diag(21,−21).
.∇f⊤δ=2⋅(−1)+(−4)⋅(−2)=−2+8=6>0.A positive directional derivative: f increases along ,δ, so δ is an ascent direction. The step lands on ,(0,0), the saddle, where .f′=0.
From :x0=−21:,x1=−1.25,,x2=−1.025, converging to the local maximum ;x=−1; for x2−y2 at (1,2) the Newton step (−1,−2)⊤ has ,∇f⊤δ=6>0, an ascent direction, and lands on the saddleNewton's method finds critical points; which kind depends on the sign of the curvature it sees, and a loss with saddles, which every neural network has, hands it a step that may go up. The test is ,∇f⊤δ=−∇f⊤H−1∇f, which is negative for every nonzero gradient exactly when .H≻0. The fixes all modify :H: add μI with μ>−λmin (Problem 8), flip the negative eigenvalues (saddle-free Newton), or use Gauss–Newton, whose J⊤J is PSD by construction (Problem 7). Mistake 3 hands the uphill direction to a line search.
Problem 7
For f(θ)=21∥r(θ)∥2 with r:Rp→RN and Jacobian ,J, show that ∇f=J⊤r and .∇2f=J⊤J+∑n=1Nrn∇2rn. The Gauss–Newton step drops the second term: .δGN=−(J⊤J)−1J⊤r. Show that δGN is the least-squares solution of the linearised problem ,minδ∥r+Jδ∥2, and that for a linear residual r(θ)=Aθ−b Gauss–Newton equals Newton and reaches the solution in one step.
,f=21∑nrn2, so .∂θj∂f=∑nrn∂θj∂rn=(J⊤r)j.Chain rule on each square; ,Jnj=∂rn/∂θj, so the sum over n is the j-th entry of .J⊤r.
.∂θi∂θj∂2f=∑n∂θi∂rn∂θj∂rn+∑nrn∂θi∂θj∂2rn=(J⊤J)ij+(∑nrn∇2rn)ij.Product rule on :rn∂rn/∂θj: differentiate the first factor to get the Jacobian product, the second to get the residual times its Hessian.
∥r+Jδ∥2 is a quadratic in δ with gradient ,2J⊤(r+Jδ), zero when .J⊤Jδ=−J⊤r.The least-squares page's normal equations with design matrix J and target ;−r;J⊤J≻0 when J has full column rank.
δGN=−(J⊤J)−1J⊤r is that solution.Step 3 solved for ;δ; it is the Newton step for the model in which r is replaced by its linearisation .r+Jδ.
For :r=Aθ−b:J=A and ,∇2rn=0, so ∇2f=A⊤A=J⊤J and .δGN=δNewton=−(A⊤A)−1A⊤(Aθ−b)=(A⊤A)−1A⊤b−θ.The dropped term is exactly zero for a linear residual; expand the product.
,θ+δGN=(A⊤A)−1A⊤b, the least-squares solution, from any .θ.The θ cancels; one step lands on the minimiser because the model is exact.
;∇f=J⊤r;;∇2f=J⊤J+∑nrn∇2rn;δGN=−(J⊤J)−1J⊤r solves ;minδ∥r+Jδ∥2; for r=Aθ−b it is the Newton step and reaches (A⊤A)−1A⊤b in one stepGauss–Newton keeps the half of the Hessian that is cheap (first derivatives only) and always PSD, and drops the half that needs second derivatives of every residual and can be indefinite. The dropped term is small when the residuals are small at the solution (a good fit) or the model is nearly linear, and then Gauss–Newton converges almost as fast as Newton; with large residuals it converges only linearly or not at all (Mistake 2). In practice the step is computed by solving Jδ≈−r by QR or the SVD rather than forming ,J⊤J, whose condition number is the square of J's. This is the iteration behind nonlinear least squares, bundle adjustment and the natural-gradient methods that use a Gauss–Newton matrix in place of the Hessian.
Problem 8
The damped step is δμ=−(H+μI)−1∇f for μ≥0 with .H⪰0. Show that (a) δμ→δNewton as μ→0 when ,H≻0, and δμ≈−μ1∇f as ;μ→∞; (b) δμ is a descent direction for every ;μ>0; (c) ∥δμ∥ is decreasing in ;μ; (d) δμ minimises .mx(δ)+2μ∥δ∥2.
(a) As ,μ→0,(H+μI)−1→H−1 when H is invertible; as ,μ→∞,.(H+μI)−1=μ1(I+H/μ)−1→μ1I.Matrix inversion is continuous at an invertible matrix; factor μ out and note .H/μ→0.
(b) ∇f⊤δμ=−∇f⊤(H+μI)−1∇f<0 for .∇f=0.H+μI≻0 for μ>0 since its eigenvalues are ,λi+μ>0, and the inverse of a PD matrix is PD (the positive-definite page's Problem 2).
(c) With H=QΛQ⊤ and :g=Q⊤∇f:,∥δμ∥2=∑i(λi+μ)2gi2, and each term decreases as μ grows.(H+μI)−1=Q(Λ+μI)−1Q⊤ and Q preserves norms; the denominators increase with .μ.
(d) .∇δ(mx(δ)+2μ∥δ∥2)=∇f+Hδ+μδ=0⟺(H+μI)δ=−∇f.Problem 1's gradient plus ;∇δ(2μδ⊤δ)=μδ; the Hessian H+μI≻0 makes the critical point the minimum.
δμ→δNewton as μ→0 and δμ≈−μ1∇f as ;μ→∞;∇f⊤δμ<0 for all ;μ>0;∥δμ∥ decreases in ;μ;δμ=argminδ(mx(δ)+2μ∥δ∥2)Damping interpolates between Newton (trust the model, long step) and gradient descent with step 1/μ (distrust it, short step along the gradient), and by (d) it is the model's minimiser under a penalty on the step length, the Lagrangian form of a trust region. Levenberg–Marquardt applies this to Gauss–Newton, ,(J⊤J+μI)δ=−J⊤r, raising μ after a step that increases f and lowering it after one that decreases ;f; because ,J⊤J⪰0, (b) guarantees every step is downhill. For an indefinite H the same algebra works once ,μ>−λmin, which is the standard repair for Problem 6's uphill step. Note that H+μI is not :(1+μ)H: damping turns the step towards the gradient, it does not just shorten it, and (c) is the only sense in which it is a shrinkage.
Problem 9
The secant method replaces g′(xk) in Newton's iteration by the slope .Bk=xk−xk−1g(xk)−g(xk−1). Starting from ,x0=1,x1=23 for ,g(x)=x2−2, compute x2 and x3 and their errors. Show that Bk is the unique scalar satisfying the secant equation ,Bk(xk−xk−1)=g(xk)−g(xk−1), and that for g=f′ this is the one-dimensional case of the quasi-Newton condition Bksk=yk with sk=xk−xk−1 and .yk=∇f(xk)−∇f(xk−1).
,g(x0)=−1,,g(x1)=41,,B1=23−141−(−1)=1/25/4=25, so .x2=x1−B1g(x1)=23−5/21/4=23−101=1.4.The slope of the chord through the two most recent points replaces the tangent slope .2x1=3.
,g(x2)=1.96−2=−0.04,,B2=1.4−1.5−0.04−0.25=−0.1−0.29=2.9, so .x3=1.4−2.9−0.04≈1.41379.The same step with the points .x1,x2.
Errors: ,x2−2≈−1.4×10−2,,x3−2≈−4.2×10−4, and the next is .x4−2≈2.1×10−6.Subtract ;1.41421356…; the signs alternate because the chord's slope lags the tangent's.
Bk(xk−xk−1)=g(xk)−g(xk−1) has the unique solution Bk=xk−xk−1g(xk)−g(xk−1) when .xk=xk−1.A linear equation in one unknown with nonzero coefficient.
With g=f′ this reads Bksk=yk where sk=xk−xk−1 and :yk=f′(xk)−f′(xk−1): the curvature estimate is the change in gradient per unit change in position.Rename; in one dimension the gradient is f′ and the Hessian is the scalar ,f′′, which Bk approximates by a difference quotient.
,x2=1.4,x3≈1.41379 with errors −1.4×10−2 and ;−4.2×10−4;Bk=xk−xk−1g(xk)−g(xk−1) is the unique solution of ,Bksk=yk, the secant equationThe secant method needs no second derivative and converges superlinearly, with order ϕ=21+5≈1.618 rather than :2: the errors here, ,8.6×10−2,,1.4×10−2,,4.2×10−4,,2.1×10−6, gain about 1.6 times as many digits per step as the last. In n dimensions the equation Bksk=yk has infinitely many solutions for the matrix ,Bk, and BFGS picks the one closest to the previous estimate that stays symmetric and positive definite; that choice is all that separates it from this problem, and it is why a quasi-Newton method converges superlinearly without ever forming a Hessian.
Problem 10
Apply Newton's method to g(x)=x3−2x+2 from x0=0 and from .x0=−2. Compute the first iterates in each case, say what happens, and explain the two outcomes in terms of Problem 3.
.g′(x)=3x2−2. From :x0=0:,g(0)=2,,g′(0)=−2, so .x1=0−−22=1.The tangent at 0 has slope −2 and crosses zero at .x=1.
,g(1)=1−2+2=1,,g′(1)=1, so .x2=1−11=0.The tangent at 1 has slope 1 and crosses zero at .x=0.
,x3=1,,x4=0, and so on: the iteration cycles between 0 and 1 for ever and never converges.Steps 1 and 2 repeat exactly; neither point is near a root, since g>0 on [0,1] and in fact for every .x>−1.77.
From :x0=−2:,g(−2)=−8+4+2=−2,,g′(−2)=10,;x1=−2+0.2=−1.8;,g(−1.8)=−0.232,,g′(−1.8)=7.72,;x2≈−1.8+0.03005=−1.76995; then ,x3≈−1.7692927,.x4≈−1.7692924.Two full Newton steps and two more carried to the digits shown; the real root is .x∗≈−1.7692924.
Errors from :−2:,0.23,,3.1×10−2,,6.6×10−4,:3.1×10−7: quadratic, with ek+1/ek2 settling near .2g′(x∗)g′′(x∗)=2(3x∗2−2)6x∗=2⋅7.39−10.6≈−0.72.Problem 3's constant with g′′=6x and ;g′(x∗)≈7.39; the error signs alternate because the constant is negative.
From x0=0 Newton cycles ;0→1→0→⋯; from x0=−2 it converges to x∗≈−1.76929 with errors ,0.23,,0.031,,6.6×10−4,3.1×10−7Problem 3 promises quadratic convergence only once C∣ek∣<1 with C evaluated near the root; from x0=0 the error is ,1.77,g′ changes sign between x0 and x∗ (at ),x=−2/3), and the tangent line is a useless model of g over that distance. The cubic has one real root and two complex ones, and the pair {0,1} is an attracting cycle of the Newton map: a whole interval of starts is pulled into it. For minimisation the same pathology appears when f′′ changes sign between the start and the minimiser. The practical cures are to damp the step (Problem 8) or to accept the full step only when it reduces ∣g∣ or f by enough, a backtracking line search, and then to let the full step take over near the solution, where Problem 3 applies; Mistake 4 reads Problem 3 as a global guarantee.
Where this goes wrong
1. Newton's iteration applied to f instead of f'
The root-finding formula is the one everyone remembers, and the function to hand is the loss.
For a root of :g:xk+1=xk−g(xk)/g′(xk)Right so far: Problem 2.
“To minimise ,f, run Newton on .f.”The habit that causes the mistake: Problem 4 minimised by solving ,f′=0, so the function fed to the root-finder is ,f′, and the division is by .f′′.
xk+1=xk−f(xk)/f′(xk) with f(x)=ex−2xThis looks for a root of ,f, and f has none: its minimum value is .f(log2)=2−2log2≈0.61>0. From :x0=0:,x1=0−1/(−1)=1,,x2=1−(e−2)/(e−2)=0, a two-cycle like Problem 10's, and from other starts the iterates wander. The correct iteration is Problem 4's .xk+1=xk−(exk−2)/exk. The same confusion in n dimensions divides by the gradient instead of the Hessian, which is not even an operation; the step that exists is ,−H−1∇f, and its one-dimensional shadow is .−f′/f′′.
2. Gauss–Newton taken to be the exact Newton step
For a linear residual the two coincide, and the equality is carried over to the nonlinear case.
∇f=J⊤r and, for ,r=Aθ−b,∇2f=J⊤JRight so far: Problem 7, steps 1 and 5.
“The Hessian of a sum of squares is .J⊤J.”The shortcut that causes the mistake: step 2 of Problem 7 has a second term, ,∑nrn∇2rn, that vanishes only when the residuals are linear in θ or zero.
∇2f=J⊤J for ,rn(θ)=θ1eθ2tn−yn, so Gauss–Newton converges quadraticallyFor this residual ∂2rn/∂θ1∂θ2=tneθ2tn and ,∂2rn/∂θ22=θ1tn2eθ2tn, so the true Hessian is ,J⊤J+∑nrn∇2rn, and the check finds the second term far from negligible away from a good fit. Gauss–Newton is Newton on the linearised residual, not on ;f; its convergence is quadratic only if the residuals vanish at the solution, linear with a rate set by the size of the dropped term otherwise, and it can diverge for large-residual problems, which is the case Levenberg–Marquardt's damping (Problem 8) exists to rescue. The thing that is exactly true is weaker and more useful: J⊤J is always PSD, so the Gauss–Newton direction is always downhill.
3. Feeding the Newton direction to a line search without checking its sign
A line search makes any step safe, provided it is a direction along which the function decreases.
δ=−H−1∇f and a line search picks the step length α along δRight so far: the standard damped Newton template.
“The line search will handle any problems with the step.”The habit that causes the mistake: a line search shortens a step; it cannot reverse one, and it assumes .∇f⊤δ<0.
At (1,2) for ,f=x2−y2, search along δ=(−1,−2)⊤∇f⊤δ=6>0 (Problem 6): f increases for every small ,α>0, so a backtracking search halves α until it underflows and the iteration stalls, or an exact search returns .α=0. The direction is uphill because H=diag(2,−2) is indefinite, and no step length fixes a wrong direction. The repair is to the matrix, not the search: use H+μI with μ>2 (Problem 8), which makes ,∇f⊤δμ<0, or replace the negative eigenvalue by its absolute value, which gives δ=(−1,2)⊤ with .∇f⊤δ=−10. Checking the sign of ∇f⊤δ before searching costs one dot product.
4. Reading quadratic convergence as convergence from any start
Newton's method is the fast one, and fast is heard as reliable.
∣ek+1∣≤C∣ek∣2 near a root with g′(x∗)=0Right so far: Problem 3.
“Newton's method converges quadratically, so it converges.”The habit that causes the mistake: Problem 3's bound only shrinks the error when ,C∣ek∣<1, which is a statement about where xk is, not about the method.
For ,g(x)=x3−2x+2, Newton from x0=0 converges quadratically to the rootIt cycles 0→1→0 for ever (Problem 10), and from x0=0.5 it wanders before landing in the same cycle; only starts near enough to ,x∗≈−1.769, where g′ keeps its sign, get the promised doubling of digits. In minimisation the analogue is a start on the far side of an inflection point, where f′′ has the wrong sign and the step goes to a maximum (Problem 6). Gradient descent with a small enough step decreases f from any start on a smooth bounded-below function; Newton trades that guarantee for speed, and the globalisation strategies, damping, line searches and trust regions, are what buy the guarantee back. In practice a first-order method brings the iterate into the basin and the second-order method finishes.
5. Expecting the Newton step to scale with the loss
Dividing a summed loss by the number of examples makes the gradient N times smaller, and the learning rate has to be retuned; the same is expected of the Newton step.
For f~=cf with :c>0:∇f~=c∇f and ∇2f~=c∇2fRight so far: a constant comes through both derivatives.
“Scaling the loss by c scales every step by .c.”The habit that causes the mistake: true for gradient descent, where ;−η∇f~=−cη∇f; Problem 5 showed Newton ignores reparameterisations, and this is the simplest one.
The Newton step for f~ is c times the Newton step for f:−(c∇2f)−1(c∇f)=−c1c(∇2f)−1∇f=−(∇2f)−1∇f: the c cancels, and the step is identical, which is the regression page's observation that Newton's step for logistic regression is the same for the mean loss and the summed loss. Nothing needs retuning when the loss is rescaled, and no learning rate exists to retune, which is one of the method's attractions. The step that does scale is the damped one of Problem 8, because μI is not multiplied by :c:,−(cH+μI)−1c∇f=−(H+cμI)−1∇f, so rescaling the loss is equivalent to rescaling the damping, and Levenberg–Marquardt's μ has to be chosen relative to the size of .J⊤J.