Lecture 14 (29 Sep): Newton's method (tangent lines, quadratic models, one-step convergence on quadratics), Nesterov's local quadratic convergence theorem and his example of divergence, how practical codes tame Newton, and the quasi-Newton methods SR1, DFP and BFGS that learn curvature from gradients alone. The part ends with every method of the course racing on the same functions.
Newton's method: follow the tangent, jump to the bottom of the model
Newton's method replaces the function by its best quadratic approximation at the current point and jumps straight to that approximation's stationary point.
Gradient descent knows which way is downhill but not how far to go, so it zig-zags when $\kappa$ is large ($\kappa$ is the condition number, largest over smallest Hessian eigenvalue; large means long thin level sets). Newton also uses curvature: on a quadratic it finishes in one step, whatever $\kappa$ is.
Parking a car by eye: you don't creep forward a fixed amount at a time; you judge the distance and the curve, then move to where you think the space is, and correct once.
Problem: gradient descent is slow when the level sets are long and thin (large condition number $\kappa$, see Part M.1), because it uses only the slope.
The idea: at the current point $\x_k$, replace $f$ by its quadratic Taylor model (Part M.2) and jump to the bottom of that bowl.
In words: $\x_{k+1}=\x_k-[\hess f(\x_k)]^{-1}\grad f(\x_k)$ means "take the gradient, multiply by the inverse of the Hessian (the matrix of second derivatives), and subtract". The step $\d_k$ solves $\hess f(\x_k)\d_k=-\grad f(\x_k)$.
On a strictly convex quadratic this lands on the minimizer in exactly one step, and it does not care about $\kappa$.
For the exam: be able to do one Newton step by hand (gradient, Hessian, solve a $2\times2$ system), state why the step is a descent direction when the Hessian is positive definite, and say what goes wrong when it is not.
Where it comes from: solving an equation with tangent lines
Forget minimization for a moment. You want a number $t^\star$ with $\phi(t^\star)=0$, for some smooth function $\phi:\R\to\R$. You are at a guess $t_k$. Close to $t_k$, the graph of $\phi$ looks like its tangent line:
$$\phi(t_k+\Delta t)\approx\phi(t_k)+\phi'(t_k)\,\Delta t.$$
Pretend this approximation is exact and solve $\phi(t_k)+\phi'(t_k)\Delta t=0$ for the move $\Delta t$. That gives Newton's iteration for a root:
$$t_{k+1}=t_k-\frac{\phi(t_k)}{\phi'(t_k)}\qquad(\phi'(t_k)\ne0).$$
Geometrically: draw the tangent at $(t_k,\phi(t_k))$ and walk down it to where it crosses the axis.
Example: $\phi(t)=t^2-2$ (root $\sqrt2$) from $t_0=1$. The iterates and their errors:
$$\begin{aligned}t_0&=1 &&\text{error }0.41\\ t_1&=1.5 &&\text{error }0.086\\ t_2&=1.416667 &&\text{error }0.0025\\ t_3&=1.4142157 &&\text{error }2.1\times10^{-6}\\ t_4&=1.414213562375 &&\text{error }1.6\times10^{-12}\end{aligned}$$
Once close, each step roughly doubles the number of correct digits. Chapter 2 makes this precise.
From roots to minima
A minimizer of a smooth $f$ must satisfy the first-order condition $\grad f(\x)=\0$ (the gradient vanishes at a minimizer; Part M.2). So minimizing is "finding a root of the gradient". In one variable, apply the tangent-line rule to $\phi=f'$, whose derivative is $f''$:
$$x_{k+1}=x_k-\frac{f'(x_k)}{f''(x_k)}.$$
In $n$ variables the gradient is a map $\R^n\to\R^n$, and its "derivative" (its Jacobian matrix, the table of all partial derivatives) is the Hessian $\hess f$, the symmetric matrix of second partial derivatives. Linearizing $\grad f(\x_k+\d)\approx\grad f(\x_k)+\hess f(\x_k)\d$ and setting this to $\0$ gives the multivariable rule.
Intuition first. Two pictures lead to the same rule. Picture 1: minimizing means making the gradient zero, and a straight-line (tangent) approximation of the gradient can be set to zero by solving a linear equation. Picture 2: replace the function by a bowl-shaped quadratic that matches its value, slope and curvature at the current point, and jump to the bottom of that bowl. The rule below is the result. Before reading it, recall that $\grad f$ is the gradient (vector of slopes), $\hess f$ is the Hessian (matrix of second derivatives, symmetric), and that "solve $M\d=\v$" means find the vector $\d$ with $M\d=\v$ (Part M.2).
Given $f\in C^2$ (twice continuously differentiable) and a start $\x_0$, repeat:
- solve the linear system $\hess f(\x_k)\,\d_k=-\grad f(\x_k)$ for the Newton direction $\d_k$;
- set $\x_{k+1}=\x_k+\d_k$.
In one formula, $\x_{k+1}=\x_k-[\hess f(\x_k)]^{-1}\grad f(\x_k)$. In practice the inverse is never formed: one factorizes $\hess f(\x_k)=LDL^\top$ (or Cholesky), which costs about $\tfrac16n^3$ multiplications ([FR] p.44) and also reveals whether the Hessian is positive definite (all eigenvalues positive, written $\succ0$, so the quadratic model is a bowl).
What this says. At the current point, measure the slope $\grad f(\x_k)$ and the curvature $\hess f(\x_k)$. Then ask: "which move $\d$ would make the slope vanish if the curvature stayed constant?" That move is the Newton direction. In one variable, $d=-f'(x_k)/f''(x_k)$: slope divided by curvature, with a minus sign. Numeric example: $f(x)=x-\ln x$ at $x_k=0.5$:
$$\begin{aligned}f'(x_k)&=1-1/x_k=-1\\ f''(x_k)&=1/x_k^2=4\\ d&=-f'/f''=0.25\\ x_{k+1}&=0.75\end{aligned}$$
Careful: the sign. The direction is $-[\hess f]^{-1}\grad f$, so it points against the gradient when $\hess f\succ0$. In the numeric example above the slope is negative (the function is decreasing), so the step is positive (to the right). Also, the step $\d_k$ is the whole move, with no extra step size: Newton's "step length" is built in.
The second derivation: minimize the quadratic model
Taylor's theorem (Part M.2) says that near $\x_k$, $f(\x_k+\d)\approx q_k(\d)$, where $\g_k=\grad f(\x_k)$ and
$$q_k(\d):=f(\x_k)+\g_k^\top\d+\tfrac12\d^\top\hess f(\x_k)\,\d .$$
This quadratic model $q_k$ is a bowl when $\hess f(\x_k)\succ0$. Its gradient is $\grad q_k(\d)=\grad f(\x_k)+\hess f(\x_k)\d$, which vanishes exactly at the Newton direction. So Newton jumps to the bottom of the local quadratic model ([FR] (3.1.1)). Gradient descent, by contrast, uses the model $f(\x_k)+\grad f(\x_k)^\top\d+\frac1{2\alpha}\norm{\d}^2$, which pretends the curvature is the same, $1/\alpha$, in every direction.
The derivation, line by line. We find the $\d$ that minimizes $q_k(\d)$.
- Write the model. Write $H_k:=\hess f(\x_k)$ for the Hessian at the current point. The model is
$$q_k(\d)=f(\x_k)+\g_k^\top\d+\tfrac12\d^\top H_k\d.$$
The unknown is the step $\d$. Everything else is known: the value $f(\x_k)$, the gradient $\g_k$ and the Hessian $H_k$. Reason: this is the second-order Taylor expansion of $f$ at $\x_k$ (Part M.2).
- Differentiate with respect to $\d$. Take the three terms one at a time:
- The constant $f(\x_k)$ has gradient $\0$.
- The linear term $\g_k^\top\d$ has gradient $\g_k$.
- The quadratic term $\tfrac12\d^\top H_k\d$ has gradient $H_k\d$, because $H_k$ is symmetric.
Adding up: $\grad q_k(\d)=\g_k+H_k\d$. Reason: gradient rules for linear and quadratic forms.
- Set the gradient to zero. This gives the linear system $H_k\d=-\g_k$. Reason: a stationary point of a function is where its gradient vanishes. For a convex function (here, when $H_k\succ0$) that stationary point is the global minimizer of $q_k$.
- Solve. The Newton direction is $\d_k=-H_k^{-1}\g_k$, and the new point is $\x_{k+1}=\x_k+\d_k$. Reason: $H_k\succ0$ implies that $H_k$ is invertible.
- Value at the bottom (optional). Substituting back:
$$\min_\d q_k=f(\x_k)-\tfrac12\g_k^\top H_k^{-1}\g_k$$
So the model predicts a decrease of $\tfrac12\g_k^\top H_k^{-1}\g_k\ge0$.
Numeric check (1-D). Take $f(x)=x-\ln x$ at the point $x_k=0.5$. The three known numbers are:
- Value: $f=1.1931$.
- Slope: $f'=-1$.
- Curvature: $f''=4$.
$$\begin{aligned}q(d)&=1.1931-d+2d^2\\ q'(d)&=-1+4d=0 &&\Rightarrow\ d=0.25\\ q(0.25)&=1.1931-\tfrac12\cdot\tfrac14=1.0681 &&\text{(predicted)}\\ f(0.75)&=0.75-\ln0.75=1.0377 &&\text{(true)}\end{aligned}$$
The model is not exact, but the step is good.
Picture it: gradient descent stands on a hillside and asks only "which way is steepest?". Newton also feels how the slope is changing under its feet, fits a bowl to what it feels, and leaps to the bottom of that bowl. If the hill really is a bowl, one leap is enough.
Try it
Start with $\sqrt{1+t^2}$ in "root of $f'$" mode and press Step a few times from $t_0=0.9$: each tangent to $f'$ lands much closer to 0. Now set $t_0=1.05$ and watch the tangents overshoot further each time. Switch to "minimize $f$" to see the same iterates as jumps to the bottom of dashed parabolas. Then try $t^3/3-2t$ from a negative start (Newton happily converges to a local maximum) and the cycle function from $t_0=0$.
Newton's method is applied to the strictly convex quadratic $f(\x)=\tfrac12\x^\top A\x-\b^\top\x$ ($A\succ0$) from a start far from the minimizer. How many steps does it need?
About $\kappa$ steps, like gradient descent
That's gradient descent's problem: it ignores curvature. What does Newton's model look like when $f$ is itself quadratic?
At most $n$ steps, like CG
CG needs up to $n$ because it learns curvature one direction at a time. Newton is handed all of it at once.
Exactly one step
The quadratic model of a quadratic is the function itself, so the bottom of the model is the true minimizer.
Take $f(\x)=\tfrac12\x^\top A\x-\b^\top\x$ with $A\succ0$. Its gradient and Hessian are $\grad f(\x_0)=A\x_0-\b$ and $\hess f=A$. So for every starting point $\x_0$:
$$\begin{aligned}\x_1&=\x_0-A^{-1}(A\x_0-\b) &&\text{(Newton step)}\\ &=\x_0-\x_0+A^{-1}\b &&\text{(expand)}\\ &=A^{-1}\b=\x^\star\end{aligned}$$
On the running example (fit the line) the data are:
- Matrix: $A=\begin{pmatrix}28&12\\12&6\end{pmatrix}$.
- Right-hand side: $\b=(46,20)$.
- Condition number: $\kappa\approx46.2$.
One Newton step from anywhere lands on $(w,c)=(1.5,\tfrac13)$. Gradient descent with the best fixed step needs hundreds of steps for ten digits.
What the proposition says. If $f$ is already a quadratic, its Taylor model is $f$ itself, so "the bottom of the model" is the true minimizer. One step from any starting point suffices. Numeric example, with:
- Matrix: $A=\begin{pmatrix}2&1\\1&3\end{pmatrix}$.
- Right-hand side: $\b=(3,4)^\top$.
- Starting point: $\x_0=(5,-7)^\top$.
$$\begin{aligned}A\x_0&=(3,-16)^\top\\ \g_0&=A\x_0-\b=(0,-20)^\top\\ A^{-1}&=\tfrac15\begin{pmatrix}3&-1\\-1&2\end{pmatrix}\\ A^{-1}\g_0&=(4,-8)^\top\\ \x_1&=(5,-7)^\top-(4,-8)^\top=(1,1)^\top\\ A\x_1&=(3,4)^\top=\b &&\text{(check)}\end{aligned}$$
The same system appeared in Part 8.
Why Newton doesn't care about $\kappa$: affine invariance
Plan. "Affine invariance" means: if you relabel the coordinates by an invertible linear change $\x=S\y$, Newton produces the same sequence of points. We check this with the chain rule. Since $\kappa$ is a property of how stretched the coordinates are, and Newton is unaffected by stretching, $\kappa$ cannot matter.
Change variables $\x=S\y$ with an invertible matrix $S$, and let $g(\y)=f(S\y)$. The chain rule gives $\grad g(\y)=S^\top\grad f(\x)$ and $\hess g(\y)=S^\top\hess f(\x)S$. So the Newton step in $\y$ is
$$\begin{aligned}-\big(S^\top\hess f\,S\big)^{-1}S^\top\grad f&=-S^{-1}[\hess f]^{-1}S^{-\top}S^\top\grad f &&\text{(invert the product)}\\ &=-S^{-1}[\hess f]^{-1}\grad f &&\text{(}S^{-\top}S^\top=I)\end{aligned}$$
This is exactly the Newton step in $\x$, mapped back by $S^{-1}$. Stretching or rotating the coordinates changes nothing: the iterates correspond one-to-one. Gradient descent is not like this, because $\grad g=S^\top\grad f$ points somewhere else; that is why its speed depends on $\kappa$ (Part 5; see Part M.5) and Newton's doesn't. Newton is steepest descent measured in the Hessian's own metric, the metric that turns the elliptical level sets into circles.
Is the Newton direction downhill?
Intuition first. "Downhill" at $\x_k$ means moving a small amount along $\d$ lowers $f$, which happens exactly when the slope along $\d$, the number $\grad f^\top\d$, is negative. Newton's direction is a "cleaned" version of $-\grad f$; the cleaning matrix $[\hess f]^{-1}$ preserves the downhill property provided it is positive definite.
A direction $\d$ is a descent direction when $\grad f(\x_k)^\top\d\lt0$. For the Newton direction,
$$\grad f(\x_k)^\top\d_k=-\grad f(\x_k)^\top[\hess f(\x_k)]^{-1}\grad f(\x_k).$$
If $\hess f(\x_k)\succ0$ then its inverse is also positive definite (eigenvalues $1/\lambda_i>0$), so this is negative whenever $\grad f(\x_k)\ne\0$: descent. If the Hessian is indefinite, the Newton direction may point uphill or towards a saddle point; Part 3 showed Newton walking into a saddle (a point where the gradient is zero but which is not a minimum: a minimum in some directions, a maximum in others). Newton is a root-finder for $\grad f=\0$, and maxima and saddles are roots too.
Numeric check. In the worked example below we find:
- Gradient: $\g_0=(0.4375,0.25)^\top$.
- Newton direction: $\d_0=(-0.05,-0.1)^\top$.
The slope along the direction is:
$$\g_0^\top\d_0=-0.021875-0.025=-0.046875\lt0\qquad\text{(downhill)}$$
One-dimensional contrast: take $f(t)=t^3/3-2t$ at the point $t=-1$.
$$\begin{aligned}f'&=1-2=-1\\ f''&=2t=-2\lt0\\ d&=-f'/f''=-0.5\\ f'd&=+0.5\gt0 &&\text{(uphill)}\end{aligned}$$
Newton moves uphill, toward the local maximum at $t=-\sqrt2$.
Careful: "Newton's method" in this course means the iteration for minimization, $\x_{k+1}=\x_k-[\hess f]^{-1}\grad f$. It uses second derivatives of $f$. The root-finding version $t_{k+1}=t_k-\phi/\phi'$ uses first derivatives of $\phi$; the two are the same method once $\phi=f'$.
[FR] (3.1.3). Given:
- Function: $f(\x)=x_1^4+x_1x_2+(1+x_2)^2$.
- Starting point: $\x_0=(0.75,-1.25)^\top$.
Take one Newton step, and check that $f$ decreased.
Gradient: $\grad f=\big(4x_1^3+x_2,\ x_1+2(1+x_2)\big)$. At $\x_0$:
$$\begin{aligned}\partial_1f&=4(0.421875)-1.25=0.4375\\ \partial_2f&=0.75+2(-0.25)=0.25\\ \g_0&=(0.4375,\ 0.25)\end{aligned}$$
Differentiate term by term: $x_1x_2$ contributes $x_2$ to $\partial_1f$ and $x_1$ to $\partial_2f$.
Hessian:
$$\begin{aligned}\hess f&=\begin{pmatrix}12x_1^2&1\\1&2\end{pmatrix}\\ \hess f(\x_0)&=\begin{pmatrix}6.75&1\\1&2\end{pmatrix}\\ \det&=13.5-1=12.5\gt0\end{aligned}$$
The diagonal is positive too, so the matrix is positive definite.
For a $2\times2$ symmetric matrix, positive diagonal and positive determinant mean both eigenvalues are positive, so the Newton direction will be a descent direction.
Solve $\hess f(\x_0)\d_0=-\g_0$:
$$\begin{aligned}\d_0&=-\frac1{12.5}\begin{pmatrix}2&-1\\-1&6.75\end{pmatrix}\begin{pmatrix}0.4375\\0.25\end{pmatrix}\\ &=-\frac1{12.5}\begin{pmatrix}0.625\\1.25\end{pmatrix}=\begin{pmatrix}-0.05\\-0.1\end{pmatrix}\end{aligned}$$
The $2\times2$ inverse is $\frac1{\det}\begin{pmatrix}d&-b\\-c&a\end{pmatrix}$. For bigger systems you'd factorize instead.
Move and compare:
$$\begin{aligned}\x_1&=\x_0+\d_0=(0.70,\ -1.35)\\ f(\x_0)&=-0.55859375\\ f(\x_1)&=0.2401-0.945+0.1225=-0.5824 &&\text{(lower)}\\ \norm{\g}&:\ 0.504\to0.022\end{aligned}$$
These match [FR] Table 3.1.1. The next steps give $\norm{\g}=1.4\times10^{-4}$, then $5.8\times10^{-9}$: the quadratic convergence of Chapter 2.
Cross-check the descent property: $\g_0^\top\d_0=0.4375(-0.05)+0.25(-0.1)=-0.046875\lt0$.
This is the quantity $-\g^\top H^{-1}\g$ from the descent argument above; it is negative because $H_0\succ0$.
Newton's root iteration and its error, in numbers. Given:
- Function: $f(x)=e^x-2x$.
- Derivatives: $f'=e^x-2$ and $f''=e^x$.
- Minimizer: $x^\star=\ln2=0.693147\ldots$
- Starting point: $x_0=0$.
Compute four steps and watch the error.
The rule is $x_{k+1}=x_k-\dfrac{e^{x_k}-2}{e^{x_k}}=x_k-1+2e^{-x_k}$.
Slope over curvature, with a minus sign.
Iterate:
$$\begin{aligned}x_1&=0-1+2=1\\ x_2&=1-1+2e^{-1}=0.735759\\ x_3&=0.735759-1+2e^{-0.735759}=0.694042\\ x_4&=0.693148\end{aligned}$$
Each step uses only the current $x_k$.
Errors $e_k=|x_k-\ln2|$:
$$\begin{aligned}e_0&=0.6931\\ e_1&=0.3069\\ e_2&=0.0426\\ e_3&=8.95\times10^{-4}\\ e_4&=4.0\times10^{-7}\end{aligned}$$
The number of correct decimals goes $0,\ 0,\ 1,\ 3,\ 6$: it roughly doubles.
Ratios $e_{k+1}/e_k^2$:
$$0.64,\quad 0.45,\quad 0.49,\quad 0.4999$$
They settle near $\tfrac12=\dfrac{f'''(x^\star)}{2f''(x^\star)}$.
A bounded ratio $e_{k+1}/e_k^2$ is exactly what quadratic convergence means (Chapter 2). The limit $\tfrac{f'''}{2f''}$ is what the proof skeleton in Chapter 2 produces in one dimension.
Newton's root iteration for $\phi(t)=t^2-2$ from $t_0=1$. What is $t_2$? (A fraction or a decimal with 5 places.)
$t_{k+1}=t_k-\frac{t_k^2-2}{2t_k}=\frac{t_k}2+\frac1{t_k}$. First compute $t_1$.
$$\begin{aligned}t_1&=\tfrac12+1=\tfrac32\\ t_2&=\tfrac34+\tfrac23=\tfrac{17}{12}\approx1.41667\end{aligned}$$
For comparison, $\sqrt2=1.41421\ldots$
Minimize $f(x)=x-\ln x$ on $x\gt0$ with Newton's method from $x_0=0.5$. Derive the iteration and give $x_2$.
$f'(x)=1-1/x$ and $f''(x)=1/x^2$, so $x_{k+1}=x_k-(1-1/x_k)x_k^2$. Simplify.
Simplify the iteration, then run it:
$$\begin{aligned}x_{k+1}&=x_k-x_k^2+x_k=2x_k-x_k^2\\ x_1&=1-0.25=0.75\\ x_2&=1.5-0.5625=0.9375\end{aligned}$$
Note $1-x_{k+1}=(1-x_k)^2$: the error is squared at every step ($0.5\to0.25\to0.0625$).
Given:
- Function: $f(x,y)=x^4+y^2+xy$.
- Starting point: $(1,0)$.
Take one Newton step. Give the new point.
At $(1,0)$ the gradient is $\grad f=(4x^3+y,\ 2y+x)=(4,1)$. The Hessian there is $\hess f=\begin{pmatrix}12x^2&1\\1&2\end{pmatrix}=\begin{pmatrix}12&1\\1&2\end{pmatrix}$. Then solve $\hess f\,\d=-\grad f$.
$$\begin{aligned}\det&=23\\ \d&=-\frac1{23}\begin{pmatrix}2&-1\\-1&12\end{pmatrix}\begin{pmatrix}4\\1\end{pmatrix}=-\frac1{23}\begin{pmatrix}7\\8\end{pmatrix}\\ \x_1&=(1-\tfrac7{23},\ -\tfrac8{23})=(\tfrac{16}{23},-\tfrac8{23})\approx(0.6957,-0.3478)\end{aligned}$$
Given: $f(x)=e^x-2x$, starting at $x_0=0$.
Run Newton's method. What is $x_2$? (Five decimal places.)
$x_{k+1}=x_k-(e^{x_k}-2)/e^{x_k}$. First compute $x_1$.
$$\begin{aligned}x_1&=0-(1-2)/1=1\\ x_2&=1-(e-2)/e=1-1+2/e=2/e\approx0.73576\end{aligned}$$
The minimizer is $\ln2\approx0.69315$, so the error has gone from $0.693$ to $0.307$ to $0.043$.
Newton on $f(x)=x-\ln x$ (defined for $x\gt0$, strictly convex there) is started at $x_0=3$. What happens?
Use $x_{k+1}=2x_k-x_k^2$ from the previous problem.
$x_1=2(3)-3^2=-3$, which is outside the domain $x\gt0$: $\ln(-3)$ is undefined. Since $1-x_{k+1}=(1-x_k)^2$, the method converges exactly when $|1-x_0|\lt1$, i.e. $0\lt x_0\lt2$. Strict convexity does not save pure Newton from a far start.
- Derive the Newton step both ways: root of the linearized gradient, and minimizer of the quadratic model
- Solve $\hess f\,\d=-\grad f$ rather than inverting the Hessian
- Check that $\hess f(\x_k)\succ0$ before trusting the direction to be downhill
- On a quadratic, say "one step" and prove it in one line
- Writing $\x_{k+1}=\x_k-\hess f\,\grad f$ (the Hessian must be inverted, i.e. solved with)
- Assuming Newton finds minima: it finds stationary points, including maxima and saddles
- Forgetting that the root form $t-\phi/\phi'$ uses $\phi=f'$, so $\phi'=f''$
- Newton's step solves $\hess f(\x_k)\d_k=-\grad f(\x_k)$: it is the root of the linearized gradient and the stationary point of the quadratic model $q_k$.
- On a strictly convex quadratic it lands on $\x^\star=A^{-1}\b$ in one step, and it is affine invariant, so the condition number does not slow it down.
- The direction is downhill when $\hess f(\x_k)\succ0$; otherwise it can go uphill or to a maximum or saddle.
At the point $\x_k$ we know:
- Hessian: $\hess f(\x_k)=\begin{pmatrix}2&0\\0&-2\end{pmatrix}$.
- Gradient: $\grad f(\x_k)=(0,1)$.
The Newton direction $\d_k$ and the slope $\grad f^\top\d_k$ are…
$\d_k=(0,-\tfrac12)$, slope $-\tfrac12$: downhill
Solve $\hess f\,\d=-\grad f$ carefully: the second equation is $-2d_2=-1$.
$\d_k=(0,\tfrac12)$, slope $+\tfrac12$: uphill
$-2d_2=-1$ gives $d_2=\tfrac12$, and $\grad f^\top\d=\tfrac12\gt0$. With an indefinite Hessian the Newton direction can go uphill.
$\d_k=(0,-1)$, the negative gradient
That is the gradient-descent direction; Newton rescales it by the inverse Hessian.
Newton's method and gradient descent are both run on $f(\x)=\tfrac12\x^\top A\x$ and on $g(\y)=f(S\y)$ for an invertible $S$. Which statement is true?
Both methods produce corresponding iterates $\x_k=S\y_k$
Check gradient descent: $\grad g=S^\top\grad f$, which is not $S^{-1}$ times anything natural.
Newton's iterates correspond ($\x_k=S\y_k$); gradient descent's generally do not
The Newton step in $\y$ is $S^{-1}$ times the Newton step in $\x$. That's affine invariance.
Neither, because the Hessians differ
They do differ ($S^\top AS$ vs $A$), but for Newton the difference cancels exactly.
In one dimension, the Newton step for minimization is $x_{k+1}=x_k-f'(x_k)/f''(x_k)$. Which picture describes it?
Walk down the tangent line to $f$ until it meets the $x$-axis
That finds a root of $f$, not a minimizer. Which function's root do we want?
Walk down the tangent line to $f'$ until it meets the axis, i.e. jump to the vertex of the osculating parabola of $f$
The root of $f'$'s tangent and the stationary point of $f$'s quadratic model are the same point.
Move a fixed distance downhill
That's gradient descent with a step size. Newton's step length is set by the curvature $f''$.
Why do practical codes solve $\hess f\,\d=-\grad f$ with an $LDL^\top$ or Cholesky factorization instead of computing $[\hess f]^{-1}$?
Because the inverse doesn't exist when $\hess f\succ0$
A positive definite matrix is always invertible.
Because the factorization gives a different, better direction
Both give exactly the same $\d$ in exact arithmetic.
It's cheaper and more stable, and it reveals whether $\hess f$ is positive definite
About $\frac16n^3$ multiplications ([FR] p.44), and a non-positive pivot flags an indefinite Hessian.
How fast Newton is, why, and where it breaks
Close to a minimizer with a positive definite Hessian (all eigenvalues positive), Newton's error is squared at every step, so the number of correct digits doubles; far away it can diverge.
The proof of this (Nesterov's Theorem 1.2.5) is examinable, and so is the example where Newton diverges on a perfectly nice convex function. Practical codes add damping and Hessian fixes for exactly that reason.
A strong swimmer near the shore reaches it in a few strokes, but drop the same swimmer far out in a current and strong strokes in the wrong direction only make things worse.
Problem: how fast is Newton's method, and when can you trust it? Convergence rates are defined in Part M.5.
The idea: near a minimizer where the Hessian is positive definite, the quadratic model is almost exact, so the error is squared each step: $r_{k+1}\le c\,r_k^2$ with $r_k=\norm{\x_k-\x^\star}$. The number of correct digits doubles.
The catch: this is local. The theorem needs the start within radius $\bar r=2\ell/(3M)$ of $\x^\star$, where $\ell$ is the smallest curvature at $\x^\star$ and $M$ says how fast the Hessian can change (its Lipschitz constant). Outside that ball Newton can diverge, even on a convex function such as $\sqrt{1+t^2}$.
Practical fixes: damp the step with a line search (Part M.4), or add $\nu I$ to the Hessian so it is positive definite.
For the exam: define linear, superlinear and quadratic convergence, run the iteration $t_{k+1}=-t_k^3$, and reproduce proof steps A to E.
Measuring speed: rates of convergence
Intuition first. To compare methods we need a way to say how fast the error $r_k$ (the distance to the answer) shrinks. Three patterns matter. Linear: the error is multiplied by the same factor below 1 every step. Superlinear: the factor itself keeps getting smaller. Quadratic: the new error is a constant times the square of the old one, so tiny errors become far tinier. Squaring a small number is dramatic: $10^{-2}\to10^{-4}\to10^{-8}\to10^{-16}$.
Let $\x_k\to\x^\star$ and write $r_k=\norm{\x_k-\x^\star}$ for the error.
- Linear: $r_{k+1}\le q\,r_k$ for some fixed $q\in(0,1)$ and all large $k$. Each step gains a fixed number of digits. Gradient descent on a strongly convex function (Part 7) and CG's bound (Part 9) are of this type.
- Superlinear: $r_{k+1}/r_k\to0$ (the ratio of successive errors tends to zero). Each step gains more digits than the last.
- Quadratic: $r_{k+1}\le c\,r_k^2$ for some constant $c\gt0$ and all large $k$. For example, if $c\,r_k=10^{-2}$, then $c\,r_{k+1}\le10^{-4}$, then $10^{-8}$, then $10^{-16}$. So the number of correct digits doubles each step.
Quadratic $\Rightarrow$ superlinear $\Rightarrow$ linear. (Slower still is sublinear, like the $O(1/k)$ bound of Part 7.)
What this says, with numbers. Three error sequences:
- Linear with $q=\tfrac12$: $1,\ 0.5,\ 0.25,\ 0.125,\ 0.0625,\dots$ (one more binary digit per step).
- Superlinear: $1,\ 0.5,\ 0.1,\ 0.002,\ 10^{-6},\dots$ (ratios $0.5,\ 0.2,\ 0.02,\ 0.0005$ tend to $0$).
- Quadratic with $c=1$: $0.5,\ 0.25,\ 0.0625,\ 0.0039,\ 1.5\times10^{-5},\dots$ (each is the square of the one before).
To diagnose a rate from data, compute $r_{k+1}/r_k$ (constant means linear) and $r_{k+1}/r_k^2$ (bounded means quadratic).
Careful: quadratic convergence only helps once the error is small: $r_{k+1}\le c\,r_k^2$ shrinks the error only when $c\,r_k\lt1$. If $c=100$ and $r_k=0.1$, then $c\,r_k=10$ and the "bound" says $r_{k+1}\le1$, which is useless. That is why Newton's guarantee is local (the ball $\bar r$ below).
Try it
Compare the columns: for Newton on $t-\ln t$ the "correct decimals" bar doubles and $e_{k+1}/e_k^2$ stays near 1, while gradient descent gains about one digit every three steps with $e_{k+1}/e_k$ stuck near 0.5. Then look at $t^4$, whose minimizer is degenerate: Newton is suddenly only linear.
Nesterov's example: Newton can diverge on a convex function
Intuition first. Newton trusts a parabola fitted at the current point. If the real function bends away from that parabola quickly, the bottom of the parabola can be a terrible guess. The function $\sqrt{1+t^2}$ is convex and has a clean minimizer at $0$, yet far from $0$ it looks like a straight line (curvature almost zero), so the fitted parabola is very flat and its bottom is far away, on the other side. The calculation below shows the effect exactly.
Find the root $t^\star=0$ of the function
$$\phi(t)=\dfrac{t}{\sqrt{1+t^2}}.$$
This $\phi$ is the derivative $f'$ of the strictly convex function $f(t)=\sqrt{1+t^2}$, so this is also Newton's method for minimizing $f$. By the quotient rule, the derivative of $\phi$ is
$$\phi'(t)=\dfrac{\sqrt{1+t^2}-t^2/\sqrt{1+t^2}}{1+t^2}=\dfrac1{(1+t^2)^{3/2}},$$
so the iteration becomes
$$\begin{aligned}t_{k+1}&=t_k-\frac{t_k}{\sqrt{1+t_k^2}}\,(1+t_k^2)^{3/2}\\&=t_k-t_k(1+t_k^2)=-t_k^3 .\end{aligned}$$
Three cases:
- If $|t_0|\lt1$, then $|t_k|=|t_0|^{3^k}\to0$ extremely fast. Starting from $0.9$ the iterates are
$$0.9,\ -0.729,\ 0.387,\ -0.058,\ 2.0\times10^{-4},\ -7.6\times10^{-12}.$$
- If $|t_0|=1$, it oscillates between $\pm1$ forever.
- If $|t_0|\gt1$, it diverges. Starting from $1.05$ the iterates are
$$-1.16,\ 1.55,\ -3.73,\ 52,\ -1.4\times10^5.$$
What this says. The rule $t_{k+1}=-t_k^3$ cubes the distance from $0$ and flips its sign. If $|t_k|\lt1$, cubing makes it smaller (convergence, even faster than quadratic). If $|t_k|\gt1$, cubing makes it larger (divergence). The boundary is $|t_0|=1$. Check one step by hand at $t_0=2$:
$$\begin{aligned}\phi&=2/\sqrt5=0.894\\ \phi'&=5^{-3/2}=0.0894\\ t_1&=2-0.894/0.0894=2-10=-8=-2^3\end{aligned}$$
The fitted parabola is so flat that the jump overshoots by a factor of $4$.
The lesson: Newton's method is a local method. Its guarantees need the start to be close enough to $\x^\star$. Far out, $\sqrt{1+t^2}$ is nearly linear ($f''$ is tiny), so the quadratic model is a very flat parabola whose bottom lies far beyond the true minimizer.
The local convergence theorem
Intuition first. The example shows that a guarantee must restrict the starting point. The theorem says exactly how: if the Hessian does not change too fast (constant $M$), and the bowl at the minimizer has genuine curvature in every direction (constant $\ell$), then starting within the radius $\frac{2\ell}{3M}$ is enough, and then the error is squared, up to a constant, at every step. Read it as: curvature $\ell$ at the bottom helps; how fast the curvature changes, $M$, hurts. The ratio $\ell/M$ is the size of the safe ball.
Nesterov works under three assumptions ([Y] p.34):
- (N1) The function $f\in C^{2,2}_M(\R^n)$ is twice differentiable, and its Hessian is Lipschitz with constant $M$. A Lipschitz function cannot change faster than $M$ times the distance moved. In symbols, for all $\x,\y$:
$$\norm{\hess f(\x)-\hess f(\y)}\le M\norm{\x-\y}.$$
Here $\norm{\cdot}$ on matrices is the operator norm (the largest stretch factor; for symmetric matrices, the largest $|\lambda|$). The constant $M$ measures how far $f$ is from quadratic, and $M=0$ for a quadratic.
- (N2) There is a local minimizer $\x^\star$ with $\hess f(\x^\star)\succeq\ell I$ for some $\ell\gt0$ ([Y] (1.2.22)). The notation $\succeq\ell I$ means every eigenvalue of the Hessian is at least $\ell$. In words: the bowl is genuinely curved in every direction at the bottom. The number $\ell$ plays the role that $\mu$ played for strong convexity in Part 7 (the guaranteed smallest curvature; Part M.3), but only at $\x^\star$.
- (N3) The start $\x_0$ is close enough to $\x^\star$.
Under (N1)–(N2), if $\norm{\x_0-\x^\star}\lt\bar r:=\dfrac{2\ell}{3M}$, then $\norm{\x_k-\x^\star}\lt\bar r$ for all $k$, every Newton step is well defined, and
$$\norm{\x_{k+1}-\x^\star}\le\frac{M\norm{\x_k-\x^\star}^2}{2\big(\ell-M\norm{\x_k-\x^\star}\big)} .$$
In particular $r_{k+1}\le\frac{3M}{2\ell}r_k^2$: quadratic convergence. ([FR] Thm 3.1.1 states the same fact with less explicit constants.)
What this says. $r_k=\norm{\x_k-\x^\star}$ is the distance to the minimizer. Inside the ball of radius $\bar r$ the next distance is at most a constant times the square of the current one, and the iterates never leave the ball. Numeric illustration, with:
- Constants: $M=\ell=1$, so the radius is $\bar r=\tfrac23$.
- Starting distance: $r_0=0.5$.
The bound then gives:
$$\begin{aligned}r_1&\le\frac{0.25}{2(0.5)}=0.25\\ r_2&\le\frac{0.0625}{2(0.75)}=0.0417\\ r_3&\le\frac{0.001736}{2(0.9583)}=9.06\times10^{-4}\\ r_4&\le4.1\times10^{-7}\end{aligned}$$
The digit count doubles. (These are upper bounds; the true errors can be smaller.)
Proof skeleton to remember. Five steps, A to E:
- A: write the new error as $H_k^{-1}G_k$ times the old error. Here $G_k$ measures how much the Hessian changed between $\x_k$ and the segment to $\x^\star$.
- B: Lipschitz continuity of $\hess f$ gives $\norm{G_k}\le\frac M2r_k$.
- C: curvature $\ell$ at $\x^\star$, plus the same Lipschitz bound, gives $\norm{H_k^{-1}}\le\frac1{\ell-Mr_k}$.
- D: multiply the two bounds to get $r_{k+1}\le\frac{Mr_k^2}{2(\ell-Mr_k)}$.
- E: if $r_k\lt\frac{2\ell}{3M}$, the factor in front of $r_k$ is below $1$. The next iterate is again in the ball, so we can repeat.
In one dimension this is the whole story of "error squared". The new error is the old error times two factors: one over the curvature, and the change of the curvature over a distance of about $e_k$. The change of curvature is about $Me_k$, so $e_{k+1}\approx\frac{M}{f''(x_k)}e_k^2$.
Prove Theorem 1.2.5. (Examinable: know steps A–E and why $\bar r=2\ell/(3M)$.) Notation:
- Error: $r_k=\norm{\x_k-\x^\star}$.
- Hessian at the iterate: $H_k=\hess f(\x_k)$.
Step A (exact error formula). Goal: express the new error through the old error with no approximation. Since $\grad f(\x^\star)=\0$, the fundamental theorem of calculus along the segment from $\x^\star$ to $\x_k$ gives
$$\begin{aligned}\grad f(\x_k)&=\grad f(\x_k)-\grad f(\x^\star)\\ &=\int_0^1\hess f\big(\x^\star+\tau(\x_k-\x^\star)\big)(\x_k-\x^\star)\,d\tau\end{aligned}$$
Newton's rule is $\x_{k+1}=\x_k-H_k^{-1}\grad f(\x_k)$, and $H_k^{-1}H_k=I$. Therefore:
$$\begin{aligned}\x_{k+1}-\x^\star&=\x_k-\x^\star-H_k^{-1}\grad f(\x_k) &&\text{(Newton's rule)}\\ &=H_k^{-1}G_k(\x_k-\x^\star) &&\text{(use the integral)}\end{aligned}$$
Here
$$G_k:=\int_0^1\big[H_k-\hess f(\x^\star+\tau(\x_k-\x^\star))\big]d\tau$$
Differentiate $\tau\mapsto\grad f(\x^\star+\tau(\x_k-\x^\star))$ by the chain rule to get the integrand; the fundamental theorem of calculus then recovers the difference of the gradients at the ends ($\tau=1$ and $\tau=0$). The integral is an average of Hessians along the segment from $\x^\star$ to $\x_k$. Then write $\x_k-\x^\star=H_k^{-1}H_k(\x_k-\x^\star)$ to pull out the common factor $H_k^{-1}$.
Step B ($G_k$ is small). Goal: show $G_k$ is of the size of the error $r_k$ (which is why the product is of size $r_k^2$). The two points compared inside $G_k$ are $\x_k$ and $\x^\star+\tau(\x_k-\x^\star)$, which differ by $(1-\tau)(\x_k-\x^\star)$. By (N1),
$$\norm{G_k}\le\int_0^1M(1-\tau)r_k\,d\tau=\frac M2r_k .$$
The norm of an integral is at most the integral of the norm, and $\int_0^1(1-\tau)d\tau=\tfrac12$.
Step C ($H_k$ is safely invertible). Goal: make sure the inverse $H_k^{-1}$ in Step A exists and is not huge. For any unit vector $\u$:
$$\begin{aligned}\u^\top H_k\u&\ge\u^\top\hess f(\x^\star)\u-\norm{H_k-\hess f(\x^\star)} &&\text{(perturbation)}\\ &\ge\ell-Mr_k &&\text{(N1), (N2)}\end{aligned}$$
So if $r_k\lt\ell/M$, every eigenvalue of $H_k$ is at least $\ell-Mr_k\gt0$, and $\norm{H_k^{-1}}\le\dfrac1{\ell-Mr_k}$.
This is [Y] Corollary 1.2.2 with (N2). The smallest eigenvalue is the minimum of $\u^\top H\u$ over unit $\u$ (Part M.1), and the inverse has eigenvalues $1/\lambda_i$.
Step D (combine). Goal: bound the product in Step A by the product of the bounds.
$$r_{k+1}\le\norm{H_k^{-1}}\,\norm{G_k}\,r_k\le\dfrac{Mr_k^2}{2(\ell-Mr_k)}$$
Take norms in Step A and use $\norm{AB\v}\le\norm A\norm B\norm\v$.
Step E (staying in the ball; where $2\ell/3M$ comes from). Suppose $r_k\lt\bar r=\frac{2\ell}{3M}$. Then $Mr_k\lt\frac23\ell$, so $\ell-Mr_k\gt\frac\ell3$. In particular $r_k\lt\ell/M$, so Step C applies. Therefore
$$r_{k+1}\le\frac{Mr_k^2}{2\ell/3}=r_k\cdot\frac{3Mr_k}{2\ell}\lt r_k\lt\bar r$$
By induction from $r_0\lt\bar r$, this holds for every $k$, and $r_{k+1}\le\frac{3M}{2\ell}r_k^2$.
Why induction: Step D gives a bound only if $r_k\lt\ell/M$, so we need every iterate to stay in the ball; Step E shows it does, because the new distance is smaller than the old one. $\bar r$ is exactly the radius at which the contraction factor $\frac{Mr_k}{2(\ell-Mr_k)}$ equals 1: solve $Mr=2(\ell-Mr)$ to get $r=\frac{2\ell}{3M}$.
Careful: in this proof $\ell$ is the smallest eigenvalue of the Hessian at the minimizer, and $M$ is a bound on how fast the Hessian changes; neither is the condition number. Also, the theorem is a sufficient condition. For $\sqrt{1+t^2}$, $\ell=f''(0)=1$ and the Lipschitz constant of $f''$ is $M=\max|f'''|\approx0.859$, so $\bar r\approx0.776$. Newton actually converges for all $|t_0|\lt1$: the guaranteed ball is smaller than the true basin, but it is never wrong.
[Y] (p.36) notes that this ball has almost the same size as the region where gradient descent is guaranteed to converge linearly ($\bar r=2\ell/M$). Hence the standard plan: use a globally safe method to get close, then let Newton finish.
Making Newton practical
- Damped Newton (idea: keep Newton's direction, but check that the step actually lowers $f$, and shorten it if not; [Y] p.34): $\x_{k+1}=\x_k-h_k[\hess f(\x_k)]^{-1}\grad f(\x_k)$, with the step $h_k$ chosen by a line search (Armijo backtracking: shrink the step until $f$ drops by a guaranteed fraction of what the slope predicts; Part M.4) early on and $h_k=1$ near the solution. Whenever $\hess f\succ0$ the direction is downhill, so the line search always finds an acceptable step.
- Hessian modification ([FR] pp.47–49): Idea: if the quadratic model is not a bowl, make it one by adding curvature. If $\hess f(\x_k)$ is not positive definite, replace it by a positive definite matrix, e.g. $\hess f(\x_k)+\nu I$ with $\nu\gt0$ large enough (Levenberg–Marquardt style), or a modified $LDL^\top$ factorization. As $\nu\to\infty$ the step turns into a short gradient-descent step. Numeric example: $f(t)=t^3/3-2t$ at $t=-1$ has $f'=-1$, $f''=-2\lt0$, so pure Newton goes uphill (previous chapter). With $\nu=3$:
$$\begin{aligned}f''+\nu&=-2+3=1\gt0 &&\text{(modified curvature)}\\ d&=-f'/1=+1\\ f&:\ f(-1)=1.667\to f(0)=0\end{aligned}$$
- Cost: each step needs the $\tfrac12n(n+1)$ second derivatives and an $n\times n$ solve (about $\frac16n^3$ multiplications). For $n=10^6$ that is out of the question. This is what quasi-Newton methods (Chapter 3) remove.
- Degenerate minimizers: if $\hess f(\x^\star)$ is singular, (N2) fails and the rate can drop to linear. For $f(x)=x^4$: $x_{k+1}=x_k-\frac{4x_k^3}{12x_k^2}=\tfrac23x_k$.
Damped Newton in numbers. Given:
- Function: $f(x)=x-\ln x$, defined for $x\gt0$.
- Starting point: $x_0=3$, where pure Newton jumps to $-3$ (Chapter 1).
- Armijo constant: $c=10^{-4}$.
Use backtracking: try $h=1,\tfrac12,\tfrac14,\dots$ until $f(\x+h\d)\le f(\x)+c\,h\,f'(\x)\,d$.
Compute at $x=3$:
$$\begin{aligned}f'(3)&=1-\tfrac13=\tfrac23\\ f''(3)&=\tfrac19\\ d&=-f'/f''=-6\\ f'd&=-4\lt0 &&\text{(downhill)}\\ f(3)&=3-\ln3=1.9014\end{aligned}$$
The direction is fine; the length is the problem.
Trial $h=1$ gives $x=-3$, outside the domain, so it is rejected. Trial $h=\tfrac12$ gives $x=0$, where $\ln0$ is undefined, so it is rejected.
A trial point outside the domain is never acceptable.
Try $h=\tfrac14$:
$$\begin{aligned}x&=3-1.5=1.5\\ f(1.5)&=1.5-\ln1.5=1.0945\\ \text{Armijo bound}&=1.9014+10^{-4}\cdot\tfrac14\cdot(-4)=1.9013\end{aligned}$$
Since $1.0945\le1.9013$, accept.
The sufficient decrease test compares the actual drop ($0.81$) with a small fraction of the drop the slope alone predicts.
Now $x_1=1.5$, and pure Newton works (using $x_{k+1}=2x_k-x_k^2$ from Chapter 1):
$$\begin{aligned}x_2&=2(1.5)-1.5^2=0.75\\ x_3&=0.9375\end{aligned}$$
The iterates converge to $1$ with $h=1$ accepted.
Near the solution the full step is accepted, so the quadratic rate returns. This is the practical recipe: damping far away, full steps nearby.
Try it
Fit-the-line: pure Newton lands on $(1.5,\tfrac13)$ in one step from anywhere, while GD + Armijo crawls (drag the start: the purple ellipse is Newton's model, and its centre is the next iterate). Rosenbrock: pure Newton is fast from $(-1.2,1)$ but jumps wildly; the damped version follows the valley. Saddle trap: from $(1.5,0.3)$ pure Newton converges to the saddle $(0,0)$ in 3 steps because the Hessian there is indefinite; the modified version goes to a minimizer. $\sqrt{1+x^2}+\sqrt{1+y^2}$ from $(1.3,0.6)$: pure Newton diverges along $x$ (Example 1.2.4 in each coordinate).
Given:
- Function: $f(t)=\sqrt{1+t^2}$, with minimizer $t^\star=0$.
- Curvature constant: $\ell=f''(0)$.
- Lipschitz constant: $M=\max_t|f'''(t)|$ (a Lipschitz constant for $f''$ by the mean value theorem).
Compute $\bar r=\frac{2\ell}{3M}$ from Theorem 1.2.5.
The derivatives are $f''(t)=(1+t^2)^{-3/2}$ and $f'''(t)=-3t(1+t^2)^{-5/2}$. Maximize $3t(1+t^2)^{-5/2}$ by setting its derivative to zero: you will get $t^2=\tfrac14$.
$$\begin{aligned}\ell&=f''(0)=1\\ \tfrac{d}{dt}\big[3t(1+t^2)^{-5/2}\big]&=3(1+t^2)^{-7/2}(1+t^2-5t^2)=0 &&\Rightarrow\ t=\tfrac12\\ M&=\tfrac32(1.25)^{-5/2}\approx0.8587\\ \bar r&=\frac2{3(0.8587)}\approx0.776\end{aligned}$$
The theorem guarantees quadratic convergence for $|t_0|\lt0.776$; the true basin, from $t_{k+1}=-t_k^3$, is $|t_0|\lt1$.
Given: $f(x)=x^4$, starting at $x_0=3$.
Run Newton's method and find $x_3$. (Then ask yourself which hypothesis of Theorem 1.2.5 fails.)
$x_{k+1}=x_k-\frac{4x_k^3}{12x_k^2}$.
The iteration is $x_{k+1}=\tfrac23x_k$, so $x_3=3\cdot\tfrac8{27}=\tfrac89\approx0.889$. The convergence is only linear, with ratio $\tfrac23$. The reason is that $f''(0)=0$, so no $\ell\gt0$ exists and (N2) fails.
In [Y] Example 1.2.4 with $t_0=0.95$, what is the smallest $k$ with $|t_k|\lt10^{-6}$?
$|t_k|=0.95^{3^k}$. Take logarithms: you need $3^k\,|\ln0.95|\gt\ln10^6$.
$$\ln10^6/|\ln0.95|=13.816/0.0513\approx269.3$$
Since $3^5=243\lt269.3\lt729=3^6$, the answer is $k=6$:
$$\begin{aligned}|t_5|&=0.95^{243}\approx3.9\times10^{-6}\\ |t_6|&\approx6\times10^{-17}\end{aligned}$$
Slow at first (close to 1 the cubing barely helps), then explosive.
Given:
- Function: $f(x)=x-\ln x$, defined for $x\gt0$.
- Starting point: $x_0=3$.
- Trial step lengths: $h=1,\tfrac12,\tfrac14,\tfrac18,\dots$
- Acceptance rule: the trial point stays in the domain $x\gt0$ and satisfies $f(x_0+hd)\lt f(x_0)$.
Damped Newton is used. Which $h$ is the first accepted?
The Newton direction is $d=-6$. Compute $x_0+hd$ for each $h$.
$$\begin{aligned}h=1&:\ x=-3 &&\text{(outside)}\\ h=\tfrac12&:\ x=0 &&\text{(outside)}\\ h=\tfrac14&:\ x=1.5,\ f=1.0945\lt1.9014=f(3) &&\text{(accepted)}\end{aligned}$$
The answer is $\tfrac14$.
Suppose (N1)–(N2) hold. Given:
- Lipschitz constant: $M=1$.
- Curvature constant: $\ell=1$.
- Current error: $r_k=0.1$.
What upper bound does Theorem 1.2.5 give for $r_{k+1}$? Is $r_k$ inside the ball $\bar r$?
$\bar r=\frac2{3}$. Plug into $\frac{Mr_k^2}{2(\ell-Mr_k)}$.
$0.1\lt\bar r=0.667$, so the theorem applies:
$$\begin{aligned}r_{k+1}&\le\frac{0.01}{2(0.9)}=\frac1{180}\approx0.00556\\ r_{k+2}&\lesssim\frac{3.1\times10^{-5}}{1.99}\approx1.5\times10^{-5}\end{aligned}$$
The digits double.
- State all three hypotheses of Thm 1.2.5 (Lipschitz Hessian $M$, $\hess f(\x^\star)\succeq\ell I$, $r_0\lt2\ell/3M$) before using it
- Reproduce the identity $\x_{k+1}-\x^\star=H_k^{-1}G_k(\x_k-\x^\star)$ and the bound $\norm{G_k}\le\frac M2r_k$
- Use damping and a Hessian fix when starting far away
- Diagnose the rate from the ratios $r_{k+1}/r_k$ and $r_{k+1}/r_k^2$
- Calling Newton "globally convergent": Example 1.2.4 diverges on a strictly convex function
- Expecting quadratic convergence at a degenerate minimizer like $x^4$
- Reading $\bar r$ as the exact basin: it is only a guaranteed region
- Quadratic convergence means $r_{k+1}\le c\,r_k^2$: the number of correct digits doubles each step.
- [Y] Thm 1.2.5: suppose the Hessian is $M$-Lipschitz and $\hess f(\x^\star)\succeq\ell I$. Then Newton converges quadratically from any start $\x_0$ with $\norm{\x_0-\x^\star}\lt\frac{2\ell}{3M}$.
- The proof rests on two bounds: $\norm{H_k^{-1}}\le\frac1{\ell-Mr_k}$ and $\norm{G_k}\le\frac M2r_k$.
- Pure Newton is local: $t_{k+1}=-t_k^3$ diverges for $|t_0|\gt1$. Practical Newton adds a line search and makes the Hessian positive definite.
An algorithm's errors are $10^{-1},\ 10^{-2},\ 10^{-4},\ 10^{-8}$. The convergence looks…
linear with ratio 0.1
Linear would give $10^{-3}$ after $10^{-2}$. Look at what happens to the exponent.
quadratic
Each error is the square of the previous one: $r_{k+1}=r_k^2$.
sublinear
Sublinear is slower than any geometric sequence; this is much faster.
In the proof of Thm 1.2.5, where does the hypothesis $\hess f(\x^\star)\succeq\ell I$ enter?
In bounding $\norm{G_k}\le\frac M2r_k$
That bound only uses the Lipschitz constant $M$.
In showing $\hess f(\x_k)\succeq(\ell-Mr_k)I$, so $\norm{[\hess f(\x_k)]^{-1}}\le\frac1{\ell-Mr_k}$
Without $\ell\gt0$ the Hessian near $\x^\star$ could be nearly singular and its inverse huge.
In the integral formula for $\grad f(\x_k)$
That formula only needs $\grad f(\x^\star)=\0$ and the chain rule.
Pure Newton on $f(x,y)=x^2+\tfrac14y^4-\tfrac12y^2$ from $(1.5,\,0.3)$ converges to $(0,0)$. Why?
Because $(0,0)$ is the global minimizer
$f(0,\pm1)=-\tfrac14\lt0=f(0,0)$. What kind of point is $(0,0)$?
Because the step size was too large
Pure Newton has no step size to tune; the direction itself is the issue.
$(0,0)$ is a nondegenerate stationary point (a saddle), and Newton is attracted to stationary points; at $y=0.3$ the Hessian is indefinite
$\partial_{yy}f=3y^2-1\lt0$ there, so the model is saddle-shaped and the step heads to its stationary point.
Damped Newton with Armijo backtracking is used on a strictly convex $C^2$ function. Compared with pure Newton, it…
is safe from far away and still converges quadratically near $\x^\star$, where the full step $h_k=1$ gets accepted
Each Newton direction is downhill (Hessian PD), the line search forces decrease, and near the solution the unit step passes the Armijo test.
is always slower, because it takes shorter steps
Near the solution it takes exactly the same steps as pure Newton.
only converges linearly
That happens only if the step stays below 1 forever; Armijo starting from $h=1$ accepts the full step when it's good.
Quasi-Newton methods: learning curvature from gradients
Quasi-Newton methods (Newton-like: they imitate Newton without computing the Hessian) keep a matrix $H_k$ that approximates the inverse Hessian and correct it after every step using only how the gradient changed.
They need no second derivatives, cost $O(n^2)$ per step instead of $O(n^3)$, always go downhill, and still converge superlinearly (the ratio of successive errors tends to zero). BFGS is the default unconstrained optimizer in most software.
Learning a city by walking: every street you walk teaches you how far things really are in that direction. After enough walks in enough directions, your mental map is accurate.
Problem: Newton needs the Hessian and an $n\times n$ solve every step, which is too costly for large $n$.
The idea: keep a matrix $H_k$ that approximates the inverse Hessian, and fix it after each step using only the step $\boldsymbol\delta_k=\x_{k+1}-\x_k$ and the gradient change $\boldsymbol\gamma_k=\g_{k+1}-\g_k$.
The rule that every update must obey is the secant condition $H_{k+1}\boldsymbol\gamma_k=\boldsymbol\delta_k$: the new matrix must map the observed gradient change back to the observed step. SR1, DFP and BFGS are three different ways to satisfy it.
Search direction: $\d_k=-H_k\g_k$, followed by a line search. If $H_k$ is positive definite this is always downhill. DFP and BFGS keep $H_k$ positive definite as long as $\boldsymbol\delta_k^\top\boldsymbol\gamma_k\gt0$, which a Wolfe line search guarantees (this is the $s^\top y\gt0$ of Part M.4).
For the exam: write the three update formulas, check the secant condition by hand, do one BFGS update on a $2\times2$ example, and reproduce the proofs for SR1 termination and for DFP positive definiteness.
The idea
Every step gives free curvature information. In [FR] notation, with $\g_k=\grad f(\x_k)$, define the step and the gradient change ([FR] (3.2.2)–(3.2.3)):
$$\boldsymbol\delta_k=\x_{k+1}-\x_k,\qquad\boldsymbol\gamma_k=\g_{k+1}-\g_k .$$
By Taylor's theorem for the gradient, $\boldsymbol\gamma_k=G\boldsymbol\delta_k+o(\norm{\boldsymbol\delta_k})$, where $G$ is the Hessian ([FR] (3.2.4)) and $o(\norm{\boldsymbol\delta_k})$ is an error that shrinks faster than $\norm{\boldsymbol\delta_k}$. For a quadratic with Hessian $G$ this is exact: $\boldsymbol\gamma_k=G\boldsymbol\delta_k$ ([FR] (3.2.8)). So the true inverse Hessian maps $\boldsymbol\gamma_k$ to $\boldsymbol\delta_k$. In one dimension, $\gamma/\delta$ is a finite-difference estimate of $f''$: this is the old secant method (Newton's root-finding rule with the derivative replaced by the slope between the last two points).
Notation for this chapter ([FR] §3.2)
- $H_k$
- symmetric matrix approximating $[\hess f]^{-1}$, the inverse Hessian; usually $H_1=I$
- $B_k=H_k^{-1}$
- the corresponding approximation of the Hessian itself
- $\d_k=-H_k\g_k$
- the search direction ([FR] calls it $\mathbf s^{(k)}$)
- $\boldsymbol\delta_k,\ \boldsymbol\gamma_k$
- step $\x_{k+1}-\x_k$ and gradient change $\g_{k+1}-\g_k$
- $G$
- the Hessian ($[FR]$'s letter); constant for a quadratic
Reading the symbols aloud.
- Step: $\boldsymbol\delta_k$ is read "delta". It is the step actually taken.
- Gradient change: $\boldsymbol\gamma_k$ is read "gamma". It is the change in the gradient over that step.
- Curvature along the step: $\boldsymbol\delta^\top\boldsymbol\gamma$ is a single number (a dot product), written $\rho$ below.
- Outer product: $\boldsymbol\delta\boldsymbol\delta^\top$ is a column times a row. It is an $n\times n$ matrix with entries $\delta_i\delta_j$, and it has rank one.
For any vector $\z$, the outer product satisfies $\z^\top(\boldsymbol\delta\boldsymbol\delta^\top)\z=(\z^\top\boldsymbol\delta)^2\ge0$. We will use this repeatedly.
One 2-by-2 data set, used for all three updates below.
- Current inverse-Hessian guess: $H=I$.
- Step: $\boldsymbol\delta=(1,1)^\top$.
- Gradient change: $\boldsymbol\gamma=(3,2)^\top$.
These come from the quadratic with Hessian $G=\begin{pmatrix}2&1\\1&1\end{pmatrix}$, since $G\boldsymbol\delta=(3,2)^\top$. Then:
$$\begin{aligned}\rho&=\boldsymbol\delta^\top\boldsymbol\gamma=5\gt0\\ H\boldsymbol\gamma&=(3,2)^\top\\ \boldsymbol\gamma^\top H\boldsymbol\gamma&=13\end{aligned}$$
The current $H=I$ fails the secant condition: $H\boldsymbol\gamma=(3,2)^\top\ne\boldsymbol\delta$. Each update repairs it.
Choose a starting point $\x_1$ and a symmetric positive definite matrix $H_1$ (often the identity $I$). Then for $k=1,2,\dots$ do:
- Direction: set $\d_k=-H_k\g_k$.
- Move: line search along $\d_k$ for a step length $\alpha_k$, and set $\x_{k+1}=\x_k+\alpha_k\d_k$.
- Update: change $H_k$ into $H_{k+1}$, using the step $\boldsymbol\delta_k$ and the gradient change $\boldsymbol\gamma_k$.
Advantages over Newton ([FR] p.50): (i) only first derivatives; (ii) $H_k\succ0$ makes $\d_k$ a descent direction, since $\g_k^\top\d_k=-\g_k^\top H_k\g_k\lt0$, even where the true Hessian is indefinite; (iii) $O(n^2)$ multiplications per step, because we update an inverse and never solve a system.
Careful: following [FR] and the course notes, quasi-Newton iterations are counted from 1 ($\x_1$, $H_1$), while Newton's were counted from 0. With $H_1=I$, the first quasi-Newton step is a steepest-descent step.
The quasi-Newton (secant) condition
We cannot ask $H_k$ to satisfy $H_k\boldsymbol\gamma_k=\boldsymbol\delta_k$: the step was taken with $H_k$ before $\boldsymbol\gamma_k$ was known. So we demand it of the next matrix.
The picture in one dimension (in words). Draw the graph of the slope function $f'$. Newton would draw the tangent line to this graph at the newest point; its slope is $f''$, which we are trying to avoid computing. We do know two points on the graph: $(x_k,f'(x_k))$ and $(x_{k+1},f'(x_{k+1}))$. Draw the straight line through those two points (the secant or chord). Its slope is $\gamma/\delta=\dfrac{f'(x_{k+1})-f'(x_k)}{x_{k+1}-x_k}$, a free estimate of $f''$ lying between the values of $f''$ at the two points. The Newton step is $-f'/f''=-H\,f'$ with $H=1/f''$, so the secant estimate is $H=\delta/\gamma$. This is exactly the condition $H_{k+1}\gamma_k=\delta_k$. Numbers: take $f=x-\ln x$ with the two points $x_k=1.5$ and $x_{k+1}=1.2$. Then:
$$\begin{aligned}\delta&=-0.3\\ \gamma&=\tfrac16-\tfrac13=-\tfrac16\\ \gamma/\delta&=0.556 &&\text{(chord slope)}\\ H&=\delta/\gamma=1.8\end{aligned}$$
The chord slope lies between $f''(1.5)=0.444$ and $f''(1.2)=0.694$.
In $n$ dimensions. The gradient is now a map from $\R^n$ to $\R^n$, and the "slope of the chord" is replaced by a statement about matrices. The Hessian approximation $B$ must send the step $\boldsymbol\delta$ to the observed gradient change $\boldsymbol\gamma$, that is, $B\boldsymbol\delta=\boldsymbol\gamma$. (For a quadratic this is exactly true with the true Hessian: $G\boldsymbol\delta=\boldsymbol\gamma$.) Equivalently, $H=B^{-1}$ must send $\boldsymbol\gamma$ back to $\boldsymbol\delta$. One step reveals what the Hessian does along one direction, $\boldsymbol\delta$, not the whole matrix. That is why the condition fixes only $n$ numbers out of the $\frac12n(n+1)$ in a symmetric matrix, and why the method has to keep learning, one step at a time.
$$H_{k+1}\boldsymbol\gamma_k=\boldsymbol\delta_k,$$ or equivalently, for $B=H^{-1}$, $B_{k+1}\boldsymbol\delta_k=\boldsymbol\gamma_k$.
This is $n$ equations for the $\tfrac12n(n+1)$ unknowns of a symmetric $H_{k+1}$, so for $n\ge2$ there are many solutions. Each choice of update formula is a different method. In one dimension it fixes $H_{k+1}=\delta_k/\gamma_k$ uniquely: the secant method.
Rank one: SR1
Intuition first. We want to change $H$ as little as possible while satisfying the secant condition. The smallest kind of change is a rank-one matrix, which alters $H$ in one direction only. The condition then dictates both the direction and the size of the change, so there is only one such update (the symmetric one).
Try the simplest symmetric correction, a rank-one matrix (a matrix $a\u\u^\top$ built from one vector, so it changes $H$ along one direction only): $H_{k+1}=H+a\u\u^\top$ (dropping the index $k$ on the right, as [FR] does, (3.2.6)). The secant condition requires:
$$\begin{aligned}H\boldsymbol\gamma+a\,\u(\u^\top\boldsymbol\gamma)&=\boldsymbol\delta &&\text{(secant condition)}\\ a(\u^\top\boldsymbol\gamma)\,\u&=\boldsymbol\delta-H\boldsymbol\gamma &&\text{(rearrange)}\end{aligned}$$
So $\u$ must be parallel to $\boldsymbol\delta-H\boldsymbol\gamma$. Take $\u=\boldsymbol\delta-H\boldsymbol\gamma$; then $a\,\u^\top\boldsymbol\gamma=1$, which gives the symmetric rank-one formula ([FR] (3.2.7)):
$$H_{k+1}^{\rm SR1}=H+\frac{(\boldsymbol\delta-H\boldsymbol\gamma)(\boldsymbol\delta-H\boldsymbol\gamma)^\top}{(\boldsymbol\delta-H\boldsymbol\gamma)^\top\boldsymbol\gamma}.$$
Reading the formula, symbol by symbol.
- $H$ is the current inverse-Hessian guess.
- $H\boldsymbol\gamma$ is where the current guess sends the observed gradient change. The truth should be $\boldsymbol\delta$.
- $\u=\boldsymbol\delta-H\boldsymbol\gamma$ is therefore the error of the current guess on this pair.
- The numerator $\u\u^\top$ is a rank-one matrix pointing along that error.
- The denominator $\u^\top\boldsymbol\gamma$ is a number that scales the correction. After adding it, the guess sends $\boldsymbol\gamma$ exactly to $\boldsymbol\delta$.
The scaling works because $(\u\u^\top/\u^\top\boldsymbol\gamma)\boldsymbol\gamma=\u$, and then $H\boldsymbol\gamma+\u=\boldsymbol\delta$.
Numeric check on the shared data.
$$\begin{aligned}\u&=\boldsymbol\delta-H\boldsymbol\gamma=(1,1)^\top-(3,2)^\top=(-2,-1)^\top\\ \u^\top\boldsymbol\gamma&=-6-2=-8\\ H_{\rm new}&=I+\tfrac1{-8}\begin{pmatrix}4&2\\2&1\end{pmatrix}=\begin{pmatrix}\tfrac12&-\tfrac14\\-\tfrac14&\tfrac78\end{pmatrix}\\ H_{\rm new}\boldsymbol\gamma&=(\tfrac32-\tfrac12,\ -\tfrac34+\tfrac74)^\top=(1,1)^\top=\boldsymbol\delta &&\text{(secant check)}\end{aligned}$$
Here the result is positive definite (determinant $\tfrac7{16}-\tfrac1{16}=\tfrac38\gt0$ and positive diagonal), but in general SR1 gives no such guarantee (practice problem 2).
Intuition first. On a quadratic, each step reveals $G\boldsymbol\delta_j$ exactly. If the update never forgets what earlier steps taught (the hereditary property), then after $n$ independent steps $H$ has been taught what $G^{-1}$ does on $n$ independent vectors, which determines the whole matrix. The proof is an induction showing the new correction is "invisible" to earlier pairs.
Let $f$ be quadratic with positive definite Hessian $G$. If the SR1 update is well defined at every step and $\boldsymbol\delta_1,\dots,\boldsymbol\delta_n$ are linearly independent, then $H_{n+1}=G^{-1}$, so the method terminates in at most $n+1$ line searches.
Proof. Goal: prove the hereditary property $H_i\boldsymbol\gamma_j=\boldsymbol\delta_j$ for all $j\lt i$ ([FR] (3.2.9)), then read off $H_{n+1}=G^{-1}$.
- Induction setup. For $i=2$ the property is the secant condition. Assume it for $i$, and let $\u_i=\boldsymbol\delta_i-H_i\boldsymbol\gamma_i$.
- Case $j=i$. The secant condition gives $H_{i+1}\boldsymbol\gamma_i=\boldsymbol\delta_i$.
- Case $j\lt i$. Apply the SR1 update to the old gradient change $\boldsymbol\gamma_j$:
$$H_{i+1}\boldsymbol\gamma_j=H_i\boldsymbol\gamma_j+\u_i\frac{\u_i^\top\boldsymbol\gamma_j}{\u_i^\top\boldsymbol\gamma_i}$$
We show that the correction vanishes, that is, $\u_i^\top\boldsymbol\gamma_j=0$:
$$\begin{aligned}\u_i^\top\boldsymbol\gamma_j&=\boldsymbol\delta_i^\top\boldsymbol\gamma_j-\boldsymbol\gamma_i^\top H_i\boldsymbol\gamma_j &&\text{(}H_i\text{ symmetric)}\\&=\boldsymbol\delta_i^\top G\boldsymbol\delta_j-\boldsymbol\gamma_i^\top\boldsymbol\delta_j &&\text{(hypothesis; }\boldsymbol\gamma_j=G\boldsymbol\delta_j)\\&=\boldsymbol\delta_i^\top G\boldsymbol\delta_j-\boldsymbol\delta_i^\top G\boldsymbol\delta_j &&\text{(}\boldsymbol\gamma_i=G\boldsymbol\delta_i)\\&=0\end{aligned}$$
So $H_{i+1}\boldsymbol\gamma_j=H_i\boldsymbol\gamma_j=\boldsymbol\delta_j$.
- Conclusion. At $i=n+1$ we have $H_{n+1}G\boldsymbol\delta_j=\boldsymbol\delta_j$ for $n$ independent vectors $\boldsymbol\delta_j$. Hence $H_{n+1}G=I$. $\square$
What this says. On a quadratic, SR1 learns the exact inverse Hessian after $n$ steps, whichever line searches are used, as long as the updates are defined and the steps are independent. Then the next Newton-like step lands on the minimizer.
Proof skeleton to remember.
- Prove the hereditary property $H_i\boldsymbol\gamma_j=\boldsymbol\delta_j$ for all $j\lt i$, by induction.
- The new correction is a multiple of $\u_i$.
- Show that $\u_i^\top\boldsymbol\gamma_j=0$ for old $j$, so the correction does not change what $H$ does to $\boldsymbol\gamma_j$.
Reading the key computation.
- Expand $\u_i=\boldsymbol\delta_i-H_i\boldsymbol\gamma_i$ and transpose, using $H_i^\top=H_i$. This gives $\u_i^\top\boldsymbol\gamma_j=\boldsymbol\delta_i^\top\boldsymbol\gamma_j-\boldsymbol\gamma_i^\top H_i\boldsymbol\gamma_j$.
- Replace $H_i\boldsymbol\gamma_j$ by $\boldsymbol\delta_j$ (induction hypothesis). The second term becomes $\boldsymbol\gamma_i^\top\boldsymbol\delta_j=\boldsymbol\delta_i^\top G\boldsymbol\delta_j$, using $\boldsymbol\gamma_i=G\boldsymbol\delta_i$ and $G=G^\top$.
- The first term is $\boldsymbol\delta_i^\top\boldsymbol\gamma_j=\boldsymbol\delta_i^\top G\boldsymbol\delta_j$, using $\boldsymbol\gamma_j=G\boldsymbol\delta_j$.
- The two terms cancel.
- Last step: if $H_{n+1}G\boldsymbol\delta_j=\boldsymbol\delta_j$ for $n$ independent vectors $\boldsymbol\delta_j$, then $H_{n+1}G-I$ kills a basis, so it is the zero matrix.
The proof never used exact line searches. But SR1 has two flaws ([FR] p.53): $H_{k+1}$ need not stay positive definite (so $\d_k$ may stop being downhill), and the denominator $(\boldsymbol\delta-H\boldsymbol\gamma)^\top\boldsymbol\gamma$ can be zero or tiny. Practical codes skip the update in that case.
Rank two: DFP
Intuition first. SR1 can lose positive definiteness. A second rank-one term gives enough freedom to keep it. The recipe can be remembered as two actions: add what the new step teaches (the term along $\boldsymbol\delta$) and remove what the old matrix claimed in the direction $H\boldsymbol\gamma$ (the term that cancels the old answer).
Allow two terms, $H_{k+1}=H+a\u\u^\top+b\v\v^\top$. The secant condition becomes $H\boldsymbol\gamma+a\u(\u^\top\boldsymbol\gamma)+b\v(\v^\top\boldsymbol\gamma)=\boldsymbol\delta$. The natural choice ([FR] (3.2.10)) is one term that produces $\boldsymbol\delta$ and one that cancels $H\boldsymbol\gamma$: $\u=\boldsymbol\delta$, $\v=H\boldsymbol\gamma$, with $a=1/\boldsymbol\delta^\top\boldsymbol\gamma$ and $b=-1/\boldsymbol\gamma^\top H\boldsymbol\gamma$:
$$H_{k+1}^{\rm DFP}=H+\frac{\boldsymbol\delta\boldsymbol\delta^\top}{\boldsymbol\delta^\top\boldsymbol\gamma}-\frac{H\boldsymbol\gamma\boldsymbol\gamma^\top H}{\boldsymbol\gamma^\top H\boldsymbol\gamma}$$ ([FR] (3.2.11); Davidon 1959, Fletcher and Powell 1963).
Secant check:
$$\begin{aligned}H_{k+1}\boldsymbol\gamma&=H\boldsymbol\gamma+\boldsymbol\delta\frac{\boldsymbol\delta^\top\boldsymbol\gamma}{\boldsymbol\delta^\top\boldsymbol\gamma}-H\boldsymbol\gamma\frac{\boldsymbol\gamma^\top H\boldsymbol\gamma}{\boldsymbol\gamma^\top H\boldsymbol\gamma}\\ &=H\boldsymbol\gamma+\boldsymbol\delta-H\boldsymbol\gamma=\boldsymbol\delta\end{aligned}$$
Read it as: add the new information along $\boldsymbol\delta$, remove what $H$ used to say along $\boldsymbol\gamma$.
Reading the formula, symbol by symbol.
- $H$ is the old guess.
- $\boldsymbol\delta\boldsymbol\delta^\top/\boldsymbol\delta^\top\boldsymbol\gamma$ is a rank-one matrix along the step, scaled by $1/\rho$. Applied to $\boldsymbol\gamma$, it returns exactly $\boldsymbol\delta$.
- $H\boldsymbol\gamma\boldsymbol\gamma^\top H/\boldsymbol\gamma^\top H\boldsymbol\gamma$ is a rank-one matrix along $H\boldsymbol\gamma$. Applied to $\boldsymbol\gamma$, it returns exactly $H\boldsymbol\gamma$, and it is subtracted.
- Net effect on $\boldsymbol\gamma$: $H\boldsymbol\gamma+\boldsymbol\delta-H\boldsymbol\gamma=\boldsymbol\delta$.
Numeric check on the shared data, where $\rho=5$ and $\boldsymbol\gamma^\top H\boldsymbol\gamma=13$:
$$\begin{aligned}H_{\rm new}&=I+\tfrac15\begin{pmatrix}1&1\\1&1\end{pmatrix}-\tfrac1{13}\begin{pmatrix}9&6\\6&4\end{pmatrix}=\tfrac1{65}\begin{pmatrix}33&-17\\-17&58\end{pmatrix}\\ H_{\rm new}\boldsymbol\gamma&=\tfrac1{65}(99-34,\ -51+116)^\top=(1,1)^\top=\boldsymbol\delta &&\text{(secant check)}\end{aligned}$$
The determinant is $\tfrac{5}{13}\gt0$ with positive diagonal: positive definite.
Intuition first. Positive definiteness of $H$ is what makes $-H\g$ a descent direction. The question is whether an update can break it. The first update term subtracts something; the proof shows the subtraction is always repaid by the added term, using the Cauchy–Schwarz inequality, and the added term is positive precisely because $\boldsymbol\delta^\top\boldsymbol\gamma\gt0$.
If $H\succ0$ and $\boldsymbol\delta^\top\boldsymbol\gamma\gt0$, then $H_{k+1}^{\rm DFP}\succ0$. Hence if $\boldsymbol\delta_k^\top\boldsymbol\gamma_k\gt0$ for all $k$ and $H_1\succ0$, every $H_k$ is positive definite.
What this says. If the current matrix is positive definite and the step shows positive curvature ($\boldsymbol\delta^\top\boldsymbol\gamma\gt0$), the updated matrix is positive definite too. So the search direction $-H_{k+1}\g_{k+1}$ stays downhill, for every $k$.
Proof skeleton to remember.
- Factor $H=LL^\top$.
- Write $\z^\top H_{k+1}\z$ as a Cauchy–Schwarz gap (which is $\ge0$) plus a square over $\rho$ (also $\ge0$).
- Show that both cannot be zero at once.
Prove [FR] Theorem 3.2.2. (Examinable.)
Since $H\succ0$, write $H=LL^\top$ with $L$ invertible (Cholesky factorization: every positive definite matrix has one). Take any nonzero $\z$ and set:
$$\begin{aligned}\a&=L^\top\z\\ \b&=L^\top\boldsymbol\gamma\end{aligned}$$
Then the three $H$-weighted products become ordinary dot products:
$$\begin{aligned}\z^\top H\z&=\a^\top\a\\ \z^\top H\boldsymbol\gamma&=\a^\top\b\\ \boldsymbol\gamma^\top H\boldsymbol\gamma&=\b^\top\b\end{aligned}$$
The factorization turns every $H$-weighted product into an ordinary dot product, so Cauchy–Schwarz ($(\a^\top\b)^2\le\norm\a^2\norm\b^2$) becomes available.
Dot the DFP formula with $\z$ on both sides. A term $\u\u^\top/c$ contributes $(\z^\top\u)^2/c$, so:
$$\z^\top H_{k+1}\z=\z^\top H\z+\dfrac{(\z^\top\boldsymbol\delta)^2}{\boldsymbol\delta^\top\boldsymbol\gamma}-\dfrac{(\z^\top H\boldsymbol\gamma)^2}{\boldsymbol\gamma^\top H\boldsymbol\gamma}$$
Substitute the quantities of the first step:
$$\z^\top H_{k+1}\z=\underbrace{\a^\top\a-\frac{(\a^\top\b)^2}{\b^\top\b}}_{\ge0}+\underbrace{\frac{(\z^\top\boldsymbol\delta)^2}{\boldsymbol\delta^\top\boldsymbol\gamma}}_{\ge0}.$$
The first bracket is $\ge0$ by Cauchy–Schwarz, $(\a^\top\b)^2\le\norm\a^2\norm\b^2$. The second is a square divided by the positive number $\boldsymbol\delta^\top\boldsymbol\gamma$.
Both terms can vanish only if $\a$ is parallel to $\b$. That means $\z=c\boldsymbol\gamma$ for some $c\ne0$, because $L^\top$ is invertible. But then the second term is positive:
$$\frac{c^2(\boldsymbol\gamma^\top\boldsymbol\delta)^2}{\boldsymbol\delta^\top\boldsymbol\gamma}=c^2\,\boldsymbol\delta^\top\boldsymbol\gamma\gt0$$
So $\z^\top H_{k+1}\z\gt0$ for every $\z\ne\0$. Induction on $k$ finishes the proof.
The two terms are never zero together: this is exactly where $\boldsymbol\delta^\top\boldsymbol\gamma\gt0$ is needed.
- Quadratic with $G\succ0$: $\boldsymbol\delta^\top\boldsymbol\gamma=\boldsymbol\delta^\top G\boldsymbol\delta\gt0$.
- Exact line search along a descent direction: $\g_{k+1}^\top\boldsymbol\delta_k=0$ and $\g_k^\top\boldsymbol\delta_k\lt0$, so $\boldsymbol\delta^\top\boldsymbol\gamma=-\g_k^\top\boldsymbol\delta_k\gt0$.
- Wolfe line search (Part 6, Lecture 7; Part M.4: Armijo decrease plus a curvature condition on the slope at the new point): the curvature condition is $\g_{k+1}^\top\d_k\ge c_2\,\g_k^\top\d_k$ with $c_2\lt1$. It gives:
$$\begin{aligned}\boldsymbol\delta^\top\boldsymbol\gamma&=\alpha_k(\g_{k+1}-\g_k)^\top\d_k &&(\boldsymbol\delta_k=\alpha_k\d_k)\\ &\ge\alpha_k(c_2-1)\g_k^\top\d_k &&\text{(curvature condition)}\\ &\gt0 &&\text{(both factors negative)}\end{aligned}$$
The quantity $\boldsymbol\delta^\top\boldsymbol\gamma$ is the $s^\top y$ of Part M.4 (step dotted with gradient change). This is why quasi-Newton methods are paired with Wolfe line searches: they guarantee that DFP and BFGS stay positive definite.
BFGS, and duality
Intuition first. BFGS applies the DFP idea to the Hessian approximation $B=H^{-1}$ instead of to $H$: "add what the step teaches, remove what $B$ used to claim". Inverting the result gives a formula for $H$. In practice BFGS has better behaviour with inexact line searches, and it is the standard method.
$$\begin{aligned}H_{k+1}^{\rm BFGS}=H&+\Big(1+\frac{\boldsymbol\gamma^\top H\boldsymbol\gamma}{\boldsymbol\delta^\top\boldsymbol\gamma}\Big)\frac{\boldsymbol\delta\boldsymbol\delta^\top}{\boldsymbol\delta^\top\boldsymbol\gamma}\\&-\frac{\boldsymbol\delta\boldsymbol\gamma^\top H+H\boldsymbol\gamma\boldsymbol\delta^\top}{\boldsymbol\delta^\top\boldsymbol\gamma}.\end{aligned}$$
Equivalently, for $B=H^{-1}$: $\displaystyle B_{k+1}^{\rm BFGS}=B+\frac{\boldsymbol\gamma\boldsymbol\gamma^\top}{\boldsymbol\gamma^\top\boldsymbol\delta}-\frac{B\boldsymbol\delta\boldsymbol\delta^\top B}{\boldsymbol\delta^\top B\boldsymbol\delta}$.
Secant check (write $\rho=\boldsymbol\delta^\top\boldsymbol\gamma$, a scalar):
$$\begin{aligned}H_{k+1}\boldsymbol\gamma&=H\boldsymbol\gamma+\big(1+\tfrac{\boldsymbol\gamma^\top H\boldsymbol\gamma}{\rho}\big)\boldsymbol\delta-\tfrac{\boldsymbol\delta(\boldsymbol\gamma^\top H\boldsymbol\gamma)+H\boldsymbol\gamma\,\rho}{\rho}\\ &=H\boldsymbol\gamma+\boldsymbol\delta+\tfrac{\boldsymbol\gamma^\top H\boldsymbol\gamma}{\rho}\boldsymbol\delta-\tfrac{\boldsymbol\gamma^\top H\boldsymbol\gamma}{\rho}\boldsymbol\delta-H\boldsymbol\gamma\\ &=\boldsymbol\delta\end{aligned}$$
In $B$-form it is even quicker:
$$B_{k+1}\boldsymbol\delta=B\boldsymbol\delta+\boldsymbol\gamma-B\boldsymbol\delta=\boldsymbol\gamma$$
Reading the $B$-form, symbol by symbol.
- $B$ is the old Hessian guess.
- $\boldsymbol\gamma\boldsymbol\gamma^\top/\boldsymbol\gamma^\top\boldsymbol\delta$ is rank one along the observed gradient change. Applied to $\boldsymbol\delta$, it returns $\boldsymbol\gamma$ (the new information).
- $B\boldsymbol\delta\boldsymbol\delta^\top B/\boldsymbol\delta^\top B\boldsymbol\delta$ is rank one along $B\boldsymbol\delta$. Applied to $\boldsymbol\delta$, it returns $B\boldsymbol\delta$ (the old claim, which is removed).
This is the DFP formula with $H\to B$ and $\boldsymbol\delta\leftrightarrow\boldsymbol\gamma$.
Numeric check on the shared data. The data are:
- Current guess: $H=I$.
- Step: $\boldsymbol\delta=(1,1)$.
- Gradient change: $\boldsymbol\gamma=(3,2)$.
- Curvature along the step: $\rho=5$.
Compute the pieces:
$$\begin{aligned}1+\boldsymbol\gamma^\top H\boldsymbol\gamma/\rho&=1+\tfrac{13}5=\tfrac{18}5\\ \tfrac{18}5\cdot\tfrac{\boldsymbol\delta\boldsymbol\delta^\top}{5}&=\tfrac{18}{25}\begin{pmatrix}1&1\\1&1\end{pmatrix}\\ \boldsymbol\delta\boldsymbol\gamma^\top H+H\boldsymbol\gamma\boldsymbol\delta^\top&=\begin{pmatrix}3&2\\3&2\end{pmatrix}+\begin{pmatrix}3&3\\2&2\end{pmatrix}=\begin{pmatrix}6&5\\5&4\end{pmatrix}\end{aligned}$$
Assemble and check:
$$\begin{aligned}H_{\rm new}&=I+\tfrac{18}{25}\begin{pmatrix}1&1\\1&1\end{pmatrix}-\tfrac15\begin{pmatrix}6&5\\5&4\end{pmatrix}=\tfrac1{25}\begin{pmatrix}13&-7\\-7&23\end{pmatrix}\\ H_{\rm new}\boldsymbol\gamma&=\tfrac1{25}(39-14,\ -21+46)^\top=(1,1)^\top=\boldsymbol\delta &&\text{(secant check)}\\ \det H_{\rm new}&=\tfrac{299-49}{625}=\tfrac25\gt0\end{aligned}$$
So $H_{\rm new}$ is positive definite. All three updates satisfy the same secant condition and give three different matrices.
Duality. The $B$-form of BFGS is the DFP formula with $H\leftrightarrow B$ and $\boldsymbol\delta\leftrightarrow\boldsymbol\gamma$ swapped ([FR] p.55: the two are dual or complementary; (3.2.14) is the dual $B$-form of DFP). Because Theorem 3.2.2's proof only needs a positive definite matrix and $\boldsymbol\gamma^\top\boldsymbol\delta\gt0$, it applies to $B_{k+1}^{\rm BFGS}$ too, so $H^{\rm BFGS}_{k+1}=(B^{\rm BFGS}_{k+1})^{-1}\succ0$ whenever $\boldsymbol\delta^\top\boldsymbol\gamma\gt0$.
Properties of DFP and BFGS ([FR] p.54, proved in [FR] §3.3–3.4). On a quadratic with exact line searches: (i) termination in at most $n$ iterations with $H_{n+1}=G^{-1}$; (ii) the hereditary property; (iii) the directions are $G$-conjugate (that is, $\boldsymbol\delta_i^\top G\boldsymbol\delta_j=0$ for $i\ne j$), and with $H_1=I$ the iterates are exactly those of conjugate gradients (Parts 8–9). On general functions: (iv) $H_k\succ0$; (v) about $3n^2$ multiplications per iteration; (vi) superlinear local convergence; (vii) global convergence on strictly convex functions with exact line searches. BFGS is the more robust of the two with inexact line searches and is the standard choice.
Why BFGS stays positive definite, step by step
Intuition first. The BFGS formula looks messy, but it hides a simple structure. The new matrix is the old one "squeezed" through a fixed matrix $V$ (a congruence), plus a rank-one positive piece. A congruence of a positive definite matrix is positive semidefinite, and the extra piece fixes the one direction that could be lost.
Skeleton to remember:
- Rewrite the update as $H^{\rm BFGS}_{k+1}=V^\top HV+\boldsymbol\delta\boldsymbol\delta^\top/\rho$.
- Both terms are $\ge0$ as quadratic forms.
- If the sum is $0$, both terms are $0$, which forces $\z=\0$.
Setup. Assume:
- The old matrix is positive definite: $H\succ0$.
- The curvature along the step is positive: $\rho=\boldsymbol\delta^\top\boldsymbol\gamma\gt0$.
Define the $n\times n$ matrix $V=I-\dfrac{\boldsymbol\gamma\boldsymbol\delta^\top}{\rho}$.
- Product form. $V^\top=I-\dfrac{\boldsymbol\delta\boldsymbol\gamma^\top}{\rho}$. Multiply out:
$$V^\top HV=H-\dfrac{H\boldsymbol\gamma\boldsymbol\delta^\top}{\rho}-\dfrac{\boldsymbol\delta\boldsymbol\gamma^\top H}{\rho}+\dfrac{\boldsymbol\gamma^\top H\boldsymbol\gamma}{\rho^2}\boldsymbol\delta\boldsymbol\delta^\top$$
Adding $\boldsymbol\delta\boldsymbol\delta^\top/\rho$ gives exactly the BFGS matrix: the coefficient of $\boldsymbol\delta\boldsymbol\delta^\top$ becomes $\frac1\rho(1+\frac{\boldsymbol\gamma^\top H\boldsymbol\gamma}{\rho})$. So:
$$H^{\rm BFGS}_{k+1}=V^\top HV+\dfrac{\boldsymbol\delta\boldsymbol\delta^\top}{\rho}$$ Reason: expansion of a product of three matrices, using $(\boldsymbol\gamma\boldsymbol\delta^\top)^\top=\boldsymbol\delta\boldsymbol\gamma^\top$.
- Quadratic form. For any $\z$:
$$\z^\top H_{k+1}\z=(V\z)^\top H(V\z)+\dfrac{(\boldsymbol\delta^\top\z)^2}{\rho}$$ Reason: $\z^\top V^\top HV\z=(V\z)^\top H(V\z)$, and $\z^\top\boldsymbol\delta\boldsymbol\delta^\top\z=(\boldsymbol\delta^\top\z)^2$.
- Both terms are nonnegative. The first term is $\ge0$ because $H\succ0$: a positive definite matrix gives $\w^\top H\w\ge0$ for every $\w$, and here $\w=V\z$. The second term is $\ge0$ because it is a square divided by $\rho\gt0$. This is where $\rho\gt0$ is used.
- The sum can be zero only if both are zero. Suppose $\z^\top H_{k+1}\z=0$. Then two things follow:
- The second term vanishes, so $\boldsymbol\delta^\top\z=0$.
- The first term vanishes, so $(V\z)^\top H(V\z)=0$. Since $H\succ0$, this forces $V\z=\0$.
- Conclude. Using $\boldsymbol\delta^\top\z=0$:
$$V\z=\z-\boldsymbol\gamma\,\dfrac{\boldsymbol\delta^\top\z}{\rho}=\z$$
So $V\z=\0$ means $\z=\0$. Hence $\z^\top H_{k+1}\z\gt0$ for every nonzero $\z$. Together with symmetry, $H_{k+1}$ is positive definite. $\blacksquare$
Numeric check. On the shared data, with $H=I$:
$$\begin{aligned}V&=I-\tfrac15\begin{pmatrix}3\\2\end{pmatrix}(1,1)=\begin{pmatrix}\tfrac25&-\tfrac35\\-\tfrac25&\tfrac35\end{pmatrix}\\ V^\top V&=\tfrac1{25}\begin{pmatrix}8&-12\\-12&18\end{pmatrix}\\ V^\top V+\tfrac15\begin{pmatrix}1&1\\1&1\end{pmatrix}&=\tfrac1{25}\begin{pmatrix}13&-7\\-7&23\end{pmatrix}\end{aligned}$$
This is the matrix found above. ✓
Careful: the assumption $\boldsymbol\delta^\top\boldsymbol\gamma\gt0$ is not automatic. A line search that only decreases $f$ can produce $\boldsymbol\delta^\top\boldsymbol\gamma\le0$, and then BFGS (and DFP) can lose positive definiteness or divide by zero or a negative number. The Wolfe curvature condition, or an exact line search, guarantees $\rho\gt0$ (see the box above). Numeric example of failure: the step $\boldsymbol\delta=(1,0)$ and gradient change $\boldsymbol\gamma=(-1,2)$ give $\rho=-1\lt0$. No valid update exists for a positive definite $H$ in the sense of the theorem.
Quasi-Newton on a quadratic with exact line search: the link to conjugate directions (Part 8)
Intuition first. Part 8 showed that conjugate directions with exact line searches solve an $n$-variable quadratic in $n$ steps, and that CG generates such directions cheaply. DFP and BFGS reach the same conclusion by a different road: the matrix $H_k$ is the memory of earlier steps, and the direction $-H_k\g_k$ is automatically conjugate to all earlier ones. Here is why, in three facts.
- Fact 1 (hereditary property, [FR] §3.3). For DFP and BFGS on a quadratic with Hessian $G$ and exact line searches, $H_{k+1}\boldsymbol\gamma_j=\boldsymbol\delta_j$ for all $j\le k$, not only for $j=k$. (Same idea as SR1's hereditary property: the update does not undo what earlier pairs taught.)
- Fact 2 (Part 8, Expanding Subspace). Suppose the directions $\d_1,\dots,\d_k$ are $G$-conjugate and the line searches are exact. Then $\g_{k+1}^\top\d_j=0$ for $j\le k$. Since $\boldsymbol\delta_j=\alpha_j\d_j$, also $\g_{k+1}^\top\boldsymbol\delta_j=0$.
- Fact 3 (the induction). Suppose $\d_1,\dots,\d_k$ are mutually conjugate. For $j\le k$ compute:
$$\begin{aligned}\d_{k+1}^\top G\boldsymbol\delta_j&=-\g_{k+1}^\top H_{k+1}G\boldsymbol\delta_j &&\text{(}\d_{k+1}=-H_{k+1}\g_{k+1};\ H_{k+1}\text{ symmetric)}\\ &=-\g_{k+1}^\top H_{k+1}\boldsymbol\gamma_j &&\text{(}\boldsymbol\gamma_j=G\boldsymbol\delta_j)\\ &=-\g_{k+1}^\top\boldsymbol\delta_j &&\text{(Fact 1)}\\ &=0 &&\text{(Fact 2)}\end{aligned}$$
As $\boldsymbol\delta_j$ is a nonzero multiple of $\d_j$, $\d_{k+1}$ is conjugate to every earlier direction. Induction (starting from $\d_1$ alone) gives the whole list.
Consequence. DFP and BFGS are conjugate direction methods on a quadratic with exact line searches, so by the Conjugate Direction Theorem (Part 8) they reach $\x^\star$ in at most $n$ steps. With $H_1=I$ the first direction is $-\g_1$, as in CG, and [FR] shows the whole sequence of iterates coincides with CG's.
Numeric verification with Fletcher's example (above), which has:
- Hessian: $G=\mathrm{diag}(20,2)$.
- Starting point: $\x_1=(0.1,1)^\top$.
BFGS gave the second direction $\d_2=-H_2\g_2=\tfrac1{121}(36,-360)^\top$. Run CG from the same start:
$$\begin{aligned}\g_1&=(2,2)^\top,\quad \d_1=(-2,-2)^\top\\ \g_2&=(-\tfrac{18}{11},\tfrac{18}{11})^\top &&\text{(exact step }\tfrac1{11})\\ \beta&=\norm{\g_2}^2/\norm{\g_1}^2=\tfrac{648/121}{8}=\tfrac{81}{121}\\ -\g_2+\beta\d_1&=(\tfrac{18}{11}-\tfrac{162}{121},\ -\tfrac{18}{11}-\tfrac{162}{121})^\top\\ &=\tfrac1{121}(36,-360)^\top\end{aligned}$$
The two directions are identical. Conjugacy check:
$$\d_2^\top G\d_1=\tfrac1{121}\big(36\cdot20\cdot(-2)+(-360)\cdot2\cdot(-2)\big)=\tfrac{-1440+1440}{121}=0$$
Careful: these statements need a quadratic and exact line searches. With Wolfe or Armijo steps the directions are no longer conjugate, there is no $n$-step termination, and the CG connection is lost (the Try-it below shows this with "Armijo (inexact)"). What remains true in general is $H_k\succ0$ (when $\boldsymbol\delta^\top\boldsymbol\gamma\gt0$) and superlinear local convergence.
[FR] Table 3.2.1. Given:
- Function: $f(\x)=10x_1^2+x_2^2$, so the Hessian is $G=\mathrm{diag}(20,2)$.
- Starting point: $\x_1=(0.1,\,1)^\top$.
- Initial matrix: $H_1=I$.
- Line searches: exact.
Do the BFGS iteration by hand until it stops.
First step (steepest descent):
$$\begin{aligned}\g_1&=G\x_1=(2,2)\\ \d_1&=-\g_1=(-2,-2)\\ \alpha_1&=\dfrac{-\g_1^\top\d_1}{\d_1^\top G\d_1}=\dfrac8{80+8}=\dfrac1{11} &&\text{(exact step)}\\ \x_2&=(0.1-\tfrac2{11},\ 1-\tfrac2{11})=(-\tfrac9{110},\ \tfrac9{11})\\ \g_2&=(-\tfrac{18}{11},\ \tfrac{18}{11})\end{aligned}$$
With $H_1=I$ the first step is steepest descent with exact line search (Part 5's formula).
Step and gradient change:
$$\begin{aligned}\boldsymbol\delta_1&=-\tfrac2{11}(1,1)\\ \boldsymbol\gamma_1&=G\boldsymbol\delta_1=-\tfrac4{11}(10,1)\\ \boldsymbol\delta_1^\top\boldsymbol\gamma_1&=\tfrac8{121}\cdot11=\tfrac8{11}\gt0\end{aligned}$$
On a quadratic you can get $\boldsymbol\gamma$ as $G\boldsymbol\delta$ instead of subtracting gradients. Always check $\boldsymbol\delta^\top\boldsymbol\gamma\gt0$ before a DFP/BFGS update.
With $H=I$, compute the scalars and matrices:
$$\begin{aligned}\boldsymbol\gamma^\top\boldsymbol\gamma&=\tfrac{16}{121}\cdot101=\tfrac{1616}{121}\\ 1+\frac{\boldsymbol\gamma^\top\boldsymbol\gamma}{\boldsymbol\delta^\top\boldsymbol\gamma}&=1+\frac{1616/121}{8/11}=\frac{213}{11}\\ \frac{\boldsymbol\delta\boldsymbol\delta^\top}{\boldsymbol\delta^\top\boldsymbol\gamma}&=\frac1{22}\begin{pmatrix}1&1\\1&1\end{pmatrix}\\ \frac{\boldsymbol\delta\boldsymbol\gamma^\top+\boldsymbol\gamma\boldsymbol\delta^\top}{\boldsymbol\delta^\top\boldsymbol\gamma}&=\frac1{11}\begin{pmatrix}20&11\\11&2\end{pmatrix}\end{aligned}$$
Compute the scalars first, then the three matrices; this keeps the fractions manageable.
$$H_2=I+\frac{213}{242}\begin{pmatrix}1&1\\1&1\end{pmatrix}-\frac1{242}\begin{pmatrix}440&242\\242&44\end{pmatrix}=\frac1{242}\begin{pmatrix}15&-29\\-29&411\end{pmatrix}.$$ Check the secant condition:
$$H_2\boldsymbol\gamma_1=\frac1{242}\cdot\big(-\tfrac4{11}\big)(150-29,\ -290+411)^\top=-\tfrac2{11}(1,1)^\top=\boldsymbol\delta_1\ \checkmark$$
Always verify the secant condition: it catches arithmetic slips immediately. (SR1 and DFP give different matrices, $\frac1{382}\begin{pmatrix}21&-19\\-19&381\end{pmatrix}$ and $\frac1{2222}\begin{pmatrix}123&-119\\-119&2301\end{pmatrix}$, but they satisfy the same check.)
Second step:
$$\begin{aligned}\d_2&=-H_2\g_2=\tfrac1{121}(36,-360)^\top &&\text{(parallel to }(1,-10))\\ \alpha_2&=\tfrac{11}{40}\\ \x_3&=(0,0)^\top=\x^\star\\ H_3&=\mathrm{diag}(\tfrac1{20},\tfrac12)=G^{-1} &&\text{(one more update)}\end{aligned}$$
$n=2$ iterations, as property (i) promises, and the matrix has learned the inverse Hessian exactly. All three updates produce directions parallel to $(1,-10)$ here, so all three reach $\x^\star$ at step 2.
Try it
Fletcher's example is loaded with BFGS and exact line searches. Slide $k$ from 1 to 3: the purple ellipse of $H_k$ starts as a circle ($H_1=I$), gets the right width along one direction after one update (the secant condition), and coincides with the gold ellipse of $G^{-1}$ at $k=3$. Read off $H_2$ and compare with the worked example. Switch to SR1 and DFP: different $H_2$, same end. Then choose "Armijo (inexact)": termination in $n$ steps is lost, but DFP and BFGS stay positive definite. Try SR1 on a tilted bowl with Armijo steps and watch for a non-positive-definite $H_k$.
Given:
- Function: $f(\x)=x_1^2+2x_2^2$, so the Hessian is $G=\mathrm{diag}(2,4)$.
- Starting point: $\x_1=(1,1)$.
- Initial matrix: $H_1=I$.
- Line search: exact.
Compute $H_2$ by the BFGS formula.
The ingredients are:
- Gradient: $\g_1=(2,4)$.
- Step length: $\alpha_1=\frac{20}{72}=\frac5{18}$.
- Step: $\boldsymbol\delta_1=-\frac59(1,2)$.
- Gradient change: $\boldsymbol\gamma_1=-\frac59(2,8)$.
- Curvature along the step: $\boldsymbol\delta_1^\top\boldsymbol\gamma_1=\frac{50}9$.
The scalar factor is $1+\frac{\boldsymbol\gamma^\top\boldsymbol\gamma}{\boldsymbol\delta^\top\boldsymbol\gamma}=\frac{43}9$.
Compute the two matrices, then assemble:
$$\begin{aligned}\frac{\boldsymbol\delta\boldsymbol\delta^\top}{\boldsymbol\delta^\top\boldsymbol\gamma}&=\frac1{18}\begin{pmatrix}1&2\\2&4\end{pmatrix}\\ \frac{\boldsymbol\delta\boldsymbol\gamma^\top+\boldsymbol\gamma\boldsymbol\delta^\top}{\boldsymbol\delta^\top\boldsymbol\gamma}&=\frac1{18}\begin{pmatrix}4&12\\12&32\end{pmatrix}\\ H_2&=I+\frac{43}{162}\begin{pmatrix}1&2\\2&4\end{pmatrix}-\frac9{162}\begin{pmatrix}4&12\\12&32\end{pmatrix}\\ &=\frac1{162}\begin{pmatrix}169&-22\\-22&46\end{pmatrix}\end{aligned}$$
Check the secant condition:
$$H_2\boldsymbol\gamma_1=-\frac59\cdot\frac1{162}(338-176,\ -44+368)^\top=-\frac59(1,2)^\top=\boldsymbol\delta_1\ \checkmark$$
Given:
- Current guess: $H=I$.
- Step: $\boldsymbol\delta=(1,0)$.
- Gradient change: $\boldsymbol\gamma=(\tfrac12,1)$.
These come from the positive definite quadratic with $G=\begin{pmatrix}0.5&1\\1&3\end{pmatrix}$, and $\boldsymbol\delta^\top\boldsymbol\gamma=\tfrac12\gt0$. Compute the SR1 update and its determinant.
First the error vector $\u=\boldsymbol\delta-H\boldsymbol\gamma=(\tfrac12,-1)$. Then the denominator $\u^\top\boldsymbol\gamma=\tfrac14-1=-\tfrac34$.
$$\begin{aligned}H_{\rm new}&=I-\tfrac43\begin{pmatrix}\frac14&-\frac12\\-\frac12&1\end{pmatrix}=\begin{pmatrix}\frac23&\frac23\\\frac23&-\frac13\end{pmatrix}\\ \det H_{\rm new}&=-\tfrac29-\tfrac49=-\tfrac23\lt0\end{aligned}$$
So $H_{\rm new}$ is indefinite, even though $\boldsymbol\delta^\top\boldsymbol\gamma\gt0$. It still satisfies $H_{\rm new}\boldsymbol\gamma=(1,0)=\boldsymbol\delta$. (BFGS on the same pair gives $\begin{pmatrix}6&-2\\-2&1\end{pmatrix}$, determinant 2, positive definite.)
In one dimension, minimize $f(x)=x-\ln x$ by the quasi-Newton iteration $x_{k+1}=x_k-H_kf'(x_k)$ with unit steps. Given:
- First point: $x_0=1.5$.
- Second point: $x_1=1.2$.
Compute $H_1$ from the secant condition, and then $x_2$.
The derivative is $f'(x)=1-1/x$, so $f'(1.5)=\tfrac13$ and $f'(1.2)=\tfrac16$. The secant condition in one dimension is $H_1=\delta/\gamma$.
$$\begin{aligned}\delta&=1.2-1.5=-0.3\\ \gamma&=\tfrac16-\tfrac13=-\tfrac16\\ H_1&=\delta/\gamma=1.8\\ x_2&=1.2-1.8\cdot\tfrac16=0.9\end{aligned}$$
Here $H_1$ estimates $1/f''$ (the true $1/f''(1.2)=1.44$). With $n=1$ the secant condition determines $H$ uniquely, so SR1, DFP and BFGS all give this same secant step.
Given:
- Current guess: $H=I$.
- Step: $\boldsymbol\delta=(1,1)$.
- Gradient change: $\boldsymbol\gamma=(3,2)$.
Compute the DFP update $H+\dfrac{\boldsymbol\delta\boldsymbol\delta^\top}{\boldsymbol\delta^\top\boldsymbol\gamma}-\dfrac{H\boldsymbol\gamma\boldsymbol\gamma^\top H}{\boldsymbol\gamma^\top H\boldsymbol\gamma}$ and check the secant condition.
The two scalars are $\boldsymbol\delta^\top\boldsymbol\gamma=5$ and $\boldsymbol\gamma^\top\boldsymbol\gamma=13$. The two matrices are $\frac15\begin{pmatrix}1&1\\1&1\end{pmatrix}$ and $\frac1{13}\begin{pmatrix}9&6\\6&4\end{pmatrix}$.
$$\begin{aligned}H_{\rm new}&=\begin{pmatrix}1+\frac15-\frac9{13}&\frac15-\frac6{13}\\\frac15-\frac6{13}&1+\frac15-\frac4{13}\end{pmatrix}=\frac1{65}\begin{pmatrix}33&-17\\-17&58\end{pmatrix}\\ H_{\rm new}\boldsymbol\gamma&=\frac1{65}(99-34,\ -51+116)^\top=(1,1)^\top=\boldsymbol\delta &&\text{(check)}\end{aligned}$$
Fletcher's example: BFGS and CG produce the same second direction. Given:
- Hessian: $G=\mathrm{diag}(20,2)$.
- Starting point: $\x_1=(0.1,1)$, with exact line searches.
- First gradient: $\g_1=(2,2)$.
- Second gradient: $\g_2=(-\tfrac{18}{11},\tfrac{18}{11})$.
Compute CG's weight $\beta=\norm{\g_2}^2/\norm{\g_1}^2$.
$\norm{\g_1}^2=8$ and $\norm{\g_2}^2=2\cdot\frac{324}{121}$.
$$\begin{aligned}\norm{\g_2}^2&=\frac{648}{121}\\ \beta&=\frac{648}{121\cdot8}=\frac{81}{121}\approx0.669\end{aligned}$$
Then $-\g_2+\beta\d_1=\frac1{121}(36,-360)$, the BFGS direction.
Given:
- Current guess: $H=I\succ0$.
- Step: $\boldsymbol\delta=(1,0)$.
- Gradient change: $\boldsymbol\gamma=(-1,2)$.
Does the theorem guarantee that the BFGS update is positive definite?
What condition does the proof use besides $H\succ0$?
The proof needs $\rho=\boldsymbol\delta^\top\boldsymbol\gamma\gt0$. Here $\rho=-1\lt0$, so the guarantee does not apply (and the denominators in the update have the wrong sign). A Wolfe line search would have prevented this pair.
Given:
- Current guess: $H=I$.
- Step: $\boldsymbol\delta=(2,0)$.
- Gradient change: $\boldsymbol\gamma=(1,1)$.
Which of SR1, DFP, BFGS can be applied?
Compute the SR1 denominator $(\boldsymbol\delta-H\boldsymbol\gamma)^\top\boldsymbol\gamma$, and the DFP/BFGS denominators $\boldsymbol\delta^\top\boldsymbol\gamma$ and $\boldsymbol\gamma^\top H\boldsymbol\gamma$.
Check the denominators:
$$\begin{aligned}\boldsymbol\delta-\boldsymbol\gamma&=(1,-1)^\top\\ (1,-1)\cdot(1,1)&=0 &&\text{(SR1 denominator)}\\ \boldsymbol\delta^\top\boldsymbol\gamma&=2\gt0 &&\text{(DFP, BFGS)}\\ \boldsymbol\gamma^\top\boldsymbol\gamma&=2\gt0 &&\text{(DFP)}\end{aligned}$$
The SR1 denominator vanishes although the numerator is not zero, so SR1 is undefined (practical codes skip the update). DFP and BFGS are defined and positive definite.
- Write the secant condition with the new matrix: $H_{k+1}\boldsymbol\gamma_k=\boldsymbol\delta_k$
- Check $\boldsymbol\delta^\top\boldsymbol\gamma\gt0$ before a DFP/BFGS update, and verify $H_{k+1}\boldsymbol\gamma=\boldsymbol\delta$ after it
- Use a Wolfe line search with quasi-Newton methods
- Know which properties need a quadratic and exact line searches (termination, conjugacy) and which hold in general (positive definiteness, $O(n^2)$ cost)
- Mixing up $H$ (inverse Hessian, $H\boldsymbol\gamma=\boldsymbol\delta$) with $B$ (Hessian, $B\boldsymbol\delta=\boldsymbol\gamma$): DFP in $H$-form looks like BFGS in $B$-form
- Assuming SR1 keeps $H$ positive definite
- Claiming $n$-step termination with an inexact line search
- Quasi-Newton methods move along $-H_k\g_k$, where $H_k\approx[\hess f]^{-1}$. After each step they update $H_k$ so that $H_{k+1}\boldsymbol\gamma_k=\boldsymbol\delta_k$. They need only gradients, $O(n^2)$ work per step, and converge superlinearly.
- SR1 is the unique symmetric rank-one update and has the hereditary property on quadratics, but can lose positive definiteness or break down; DFP and BFGS are dual rank-two updates that stay positive definite whenever $\boldsymbol\delta^\top\boldsymbol\gamma\gt0$, which a Wolfe line search guarantees.
- On a quadratic with exact line searches, DFP/BFGS from $H_1=I$ reproduce the CG iterates and end with $H_{n+1}=G^{-1}$.
Why is the secant condition imposed on $H_{k+1}$ and not on $H_k$?
Because $H_k$ is always the identity
Only $H_1$ is usually $I$; later matrices have been updated.
Because $\boldsymbol\gamma_k=\g_{k+1}-\g_k$ is only known after the step taken with $H_k$
The pair $(\boldsymbol\delta_k,\boldsymbol\gamma_k)$ is new information; the next matrix is built to agree with it.
Because $H_k\boldsymbol\gamma_k=\boldsymbol\delta_k$ would make $H_k$ indefinite
It has nothing to do with definiteness: it's a matter of what is known when.
With a Wolfe line search ($c_2\lt1$) along a descent direction $\d_k$, $\boldsymbol\delta_k^\top\boldsymbol\gamma_k$ is…
zero
That's $\g_{k+1}^\top\boldsymbol\delta_k$ under an exact line search, not $\boldsymbol\delta^\top\boldsymbol\gamma$.
possibly negative, so BFGS may fail
The curvature condition rules this out. Write $\boldsymbol\delta^\top\boldsymbol\gamma=\alpha_k(\g_{k+1}-\g_k)^\top\d_k$.
at least $\alpha_k(c_2-1)\g_k^\top\d_k\gt0$
Both $c_2-1$ and $\g_k^\top\d_k$ are negative, so the product is positive and DFP/BFGS stay positive definite.
On a strictly convex quadratic in $\R^n$ with exact line searches and $H_1=I$, BFGS…
needs about $\kappa$ iterations
That's gradient descent's behaviour. BFGS learns the curvature.
produces the same iterates as CG and terminates in at most $n$ iterations with $H_{n+1}=G^{-1}$
[FR] p.54 properties (i)–(iii).
terminates in one iteration like Newton
It starts knowing nothing ($H_1=I$), so its first step is steepest descent.
The $B$-form of BFGS, $B+\frac{\boldsymbol\gamma\boldsymbol\gamma^\top}{\boldsymbol\gamma^\top\boldsymbol\delta}-\frac{B\boldsymbol\delta\boldsymbol\delta^\top B}{\boldsymbol\delta^\top B\boldsymbol\delta}$, is obtained from DFP's $H$-form by…
taking the inverse of each term
Inverses of sums are not sums of inverses. It's a symbolic swap.
transposing
All these matrices are symmetric; transposing changes nothing.
swapping $H\leftrightarrow B$ and $\boldsymbol\delta\leftrightarrow\boldsymbol\gamma$
The two formulas are dual, and the secant condition $H\boldsymbol\gamma=\boldsymbol\delta$ turns into $B\boldsymbol\delta=\boldsymbol\gamma$ under the same swap.
The race: gradient descent, CG, Newton and quasi-Newton compared
Every method in this course trades cost per step against the number of steps; which one wins depends on $n$, on what derivatives you can afford, and on how far you start.
Exam questions often ask you to compare methods or to choose one for a situation, with reasons in terms of cost, storage and rate.
Walking, cycling, driving and flying all get you there; which is fastest depends on the distance, the traffic, and how long it takes to get to the airport.
Problem: given a task, which method should you use?
The idea: every method trades cost per step against the number of steps. Gradient descent is cheap and slow (linear, depends on $\kappa$). CG is cheap and faster on quadratics. Newton takes few steps but each is $O(n^3)$. BFGS sits between: about $3n^2$ work per step and superlinear convergence.
Read the table by columns: what the method needs (gradient only, or also the Hessian), the work and storage per step, how it does on a quadratic, and its rate near the solution.
For the exam: given $n$ and the cost of gradients and Hessians, compare the methods in terms of cost, storage and rate, and recommend one with reasons.
Intuition first. Think of total cost as (cost per step) times (number of steps). Gradient descent has the cheapest steps and needs the most of them. Newton has the most expensive steps and needs the fewest. CG and BFGS sit in between: each tries to get close to Newton's step count while paying close to gradient descent's price. The table puts the numbers side by side; the notes after it give the relationships you can use to argue a choice.
| Method | Uses | Work per step | Storage | On a quadratic | Local rate (general $f$) | From far away |
| Gradient descent | $\g$ | $O(n)$ + 1 gradient | $O(n)$ | never exact; factor $\frac{\kappa-1}{\kappa+1}$ per step | linear | safe with Armijo/Wolfe |
| CG (linear, Parts 8–9) | $A\v$ products | 1 mat-vec (matrix times vector) + $O(n)$ | $O(n)$ | $\le n$ steps; factor $\frac{\sqrt\kappa-1}{\sqrt\kappa+1}$ | — | — |
| Nonlinear CG (Fletcher–Reeves, CG extended to general $f$) | $\g$ | $O(n)$ + line search | $O(n)$ | $\le n$ steps (exact l.s.) | linear, often fast | safe with strong Wolfe |
| Newton | $\g$, $\hess f$ | $\frac16n^3$ + Hessian | $O(n^2)$ | 1 step | quadratic | may diverge: damp and modify |
| Quasi-Newton (BFGS) | $\g$ | $\approx3n^2$ + line search | $O(n^2)$ | $\le n$ steps (exact l.s.) | superlinear | safe with Wolfe |
What this says. Read one row at a time. Example: BFGS needs only gradients, spends about $3n^2$ multiplications per step and stores an $n\times n$ matrix, finishes a quadratic in at most $n$ steps with exact line searches, and converges superlinearly near a solution. For $n=1000$ that is about $3\times10^6$ multiplications per step against about $1.7\times10^8$ for Newton's factorization.
Careful: "converges in at most $n$ steps" is a statement about quadratics and exact line searches. On a general function with inexact line searches, no method here terminates in $n$ steps; compare methods by their local rates instead. Also, "quadratic" is used in two senses: a quadratic function (the test case, where Newton takes 1 step) and quadratic convergence (a rate, where the error is squared each step). Newton has both properties in different settings.
How to choose, in words
- Can you afford second derivatives, and is $n$ small (up to a few hundred)? Use Newton, damped and with a positive definite Hessian fix. Few iterations, high accuracy.
- Only gradients, $n$ moderate (up to a few thousand)? Use BFGS with a Wolfe line search: $O(n^2)$ per step, superlinear.
- Huge $n$? Use CG (for $A\x=\b$ or nonlinear CG) or limited-memory BFGS: $O(n)$ or $O(mn)$ storage.
- Everything is cheap and you want robustness only? Gradient descent with Armijo or Wolfe steps, accepting the slow rate.
How the methods are related
In the table, "exact l.s." means exact line search, $O(n^2)$ means work growing like $n^2$, and "factor" is the error-reduction ratio per step (Part M.5).
- CG = steepest descent + memory: $\d_k=-\g_k+\beta_k\d_{k-1}$.
- Newton = steepest descent in the Hessian's metric: it rescales space so the level sets become circles, which is why $\kappa$ disappears.
- Quasi-Newton = Newton with a learned metric: $H_k$ is assembled from the pairs $(\boldsymbol\delta_k,\boldsymbol\gamma_k)$.
- Quasi-Newton = CG on quadratics: with $H_1=I$ and exact line searches, DFP and BFGS produce exactly the CG iterates (Lab 14 confirms agreement to about $10^{-16}$ for $n=8$) and also end with $H_{n+1}=G^{-1}$.
- Quadratic results become local results: near $\x^\star$ every smooth $f$ is close to its quadratic model with $A=\hess f(\x^\star)$, so the quadratic analysis predicts the final phase of every method.
Try it
Rosenbrock from $(-1.2,1)$: GD + Armijo has not converged after 2000 steps, nonlinear CG needs 84, BFGS 35, DFP 37, SR1 43, damped Newton 21 (compare Lab 14: 21, 34, 37, 46). Turn on pure Newton: 6 steps here, but on $\sqrt{1+x^2}+\sqrt{1+y^2}$ it diverges while everything else converges. On Himmelblau, pure Newton converges to the local maximum near $(-0.27,-0.92)$. Finally, type your own $f(x,y)$ (for example (x-1)^2 + 10*(y-x^2)^2) and drag the start around. The lower plot shows $\log_{10}\norm{\grad f}$: straight lines are linear convergence; curves that fall off a cliff are superlinear or quadratic.
You must minimize a smooth function of $n=2000$ variables whose gradient costs about as much as 5 evaluations of $f$, and whose Hessian is available but costs as much as $n$ gradients. Compare one step of Newton and one step of BFGS, and recommend a method.
Newton: the Hessian costs about $2000$ gradient-equivalents, and the factorization about $\frac16n^3\approx1.3\times10^9$ multiplications.
The $\frac16n^3$ figure is for an $LDL^\top$ factorization ([FR] p.44).
BFGS: one gradient (plus a few more inside the Wolfe line search) and about $3n^2=1.2\times10^7$ multiplications for the update and the product $H_k\g_k$.
[FR] p.54, property (v). That is roughly 100 times less arithmetic than Newton's solve, before even counting the Hessian.
Newton needs fewer iterations (quadratic vs superlinear), but typically only a few times fewer; Lab 14's Rosenbrock run had 21 vs 34. That cannot repay a factor of about 100 in arithmetic plus 2000 gradients' worth of Hessian. Recommend BFGS with a Wolfe line search.
Newton wins when the Hessian is cheap and $n$ is small (tens to hundreds), or when very high accuracy is needed quickly. For huge $n$, even $O(n^2)$ storage is too much: use nonlinear CG or limited-memory BFGS.
Go deeper: limited-memory BFGS and superlinear convergence
L-BFGS ([NW] Ch. 9) never stores $H_k$. It keeps only the last $m$ pairs $(\boldsymbol\delta_i,\boldsymbol\gamma_i)$ (typically $m=5$–$20$) and computes $H_k\g_k$ by a two-loop recursion that applies the BFGS update $m$ times to a scaled identity. Work and storage are $O(mn)$, which is why it is the default for large-scale smooth problems, including many machine-learning models.
Why BFGS is superlinear. It is not true that $H_k\to[\hess f(\x^\star)]^{-1}$ in general. The Dennis–Moré condition shows that superlinear convergence only needs $H_k$ to be accurate along the search directions: $\norm{(H_k^{-1}-\hess f(\x^\star))\d_k}/\norm{\d_k}\to0$. The secant condition enforces exactly this kind of accuracy along the steps actually taken ([NW] §6.4). This is beyond the lecture.
Using [FR]'s counts, Newton's factorization costs about $\frac16n^3$ multiplications and a DFP/BFGS update about $3n^2$. For $n=1000$, how many times more arithmetic is the Newton solve than the quasi-Newton update?
The ratio is $\frac{n^3/6}{3n^2}=\frac n{18}$.
$\frac{1000}{18}\approx55.6$. And Newton also needs the $\tfrac12n(n+1)\approx5\times10^5$ second derivatives.
A quadratic has $\kappa=100$. Using the worst-case factors $\frac{\kappa-1}{\kappa+1}$ per step for steepest descent with exact line search and $2\big(\frac{\sqrt\kappa-1}{\sqrt\kappa+1}\big)^k$ for CG, find the smallest $k$ that guarantees the error has shrunk by a factor $10^{6}$ for each method. (Newton needs 1 step; BFGS with exact line searches at most $n$.)
Steepest descent: $(99/101)^k\le10^{-6}$. CG: $2(9/11)^k\le10^{-6}$. Take logarithms.
Take logarithms for each method:
$$\begin{aligned}\text{Steepest descent: }k&\ge\frac{\ln10^6}{\ln(101/99)}=\frac{13.82}{0.0200}\approx690.8 &&\Rightarrow\ k=691\\ \text{CG: }k&\ge\frac{\ln(2\times10^6)}{\ln(11/9)}=\frac{14.51}{0.2007}\approx72.3 &&\Rightarrow\ k=73\end{aligned}$$
The $\sqrt\kappa$ makes a factor-of-ten difference.
Solve $A\x=\b$ where $A$ is a $10^6\times10^6$ sparse symmetric positive definite matrix with about 10 nonzeros per row. Which method?
Can you store an $n\times n$ dense matrix for $n=10^6$? Which method needs only products $A\v$?
Conjugate gradients: each step costs one sparse product (about $10^7$ operations) and $O(n)$ storage, and it converges at the $\sqrt\kappa$ rate. Newton and BFGS need $O(n^2)=10^{12}$ numbers of storage; gradient descent's rate depends on $\kappa$ instead of $\sqrt\kappa$.
$n=20$, the Hessian is available in closed form and cheap, the start may be far from the solution, and you need 14 correct digits. Which method?
Which method combines global safety with the fastest local rate when second derivatives are cheap?
Damped Newton (with a Hessian modification if needed): the line search makes it safe from far away, and near $\x^\star$ it takes full steps and converges quadratically, so the last ten digits take only a few steps. With $n=20$ the $\frac16n^3\approx1300$ multiplications are negligible.
- Compare methods on four axes: information needed, work per step, storage, rate (local and from far away)
- Count derivative evaluations, not only iterations
- Recommend CG for large sparse quadratics, BFGS for moderate $n$ with gradients, damped Newton when Hessians are cheap
- Judging a method only by its iteration count
- Recommending Newton or BFGS when $n^2$ numbers cannot even be stored
- Forgetting that every fast local rate needs a globalization (line search) to be trusted from a far start
- Per step: GD and CG cost $O(n)$, BFGS $O(n^2)$, Newton $O(n^3)$ plus a Hessian; locally: linear, linear, superlinear, quadratic.
- Newton and BFGS are blind (or nearly blind) to $\kappa$; GD pays $\kappa$ and CG pays $\sqrt\kappa$.
- On quadratics with exact line searches, BFGS/DFP from $H_1=I$ coincide with CG, which ties Parts 8–10 together.
On Rosenbrock's function, gradient descent with a line search needs thousands of iterations while BFGS needs about 35. The main reason is…
BFGS uses exact second derivatives
BFGS uses only gradients.
the valley is badly conditioned, and BFGS learns the curvature while GD's rate is governed by $\kappa$
GD's error ratio is close to 1 in the valley (Lab 14 measured 0.999 per step); BFGS's metric adapts to the valley's shape.
GD's line search is inexact
Even with exact line searches GD zig-zags along a narrow valley.
Which method has the lowest storage requirement?
BFGS
It stores an $n\times n$ matrix $H_k$.
Newton
It stores (and factorizes) the $n\times n$ Hessian.
Nonlinear CG
Only a few vectors: $\x_k$, $\g_k$, $\d_{k-1}$: $O(n)$.
Pure Newton diverges on $\sqrt{1+x^2}+\sqrt{1+y^2}$ from $(1.3,0.6)$, but BFGS converges. Why can BFGS succeed where Newton fails?
BFGS uses the exact Hessian more cleverly
BFGS never computes the Hessian.
Its direction is always downhill ($H_k\succ0$) and its line search forces $f$ to decrease, whereas pure Newton accepts the full step blindly
Globalization by a line search is what saves it; damped Newton converges here too.
BFGS converges quadratically
BFGS is superlinear, not quadratic; and the issue here is global behaviour, not local rate.