BFGS updates and curvature conditions
Build a symmetric curvature model from gradient changes and see exactly why the positive-curvature test matters.
On this page
The question for today
What you’ll understand
- Verify the secant equation for a Hessian approximation.
- Compute a BFGS update and check positive definiteness.
- Explain how Wolfe curvature supports the update and where noisy gradients break the argument.
A Hessian can be expensive to form, store, and factor. BFGS replaces repeated full second derivatives with information gathered during accepted steps: how far the point moved and how much its gradient changed. The method builds a symmetric approximate Hessian whose most recent directional behavior matches that evidence. Its effectiveness depends on the quality of that evidence and the step-selection rules. A matrix update is not an independent source of truth when the gradients or the model assumptions are unreliable.
The secant equation is directional evidence
Let s be the displacement between two successive iterates and y the corresponding gradient difference. Integrating the Hessian along their connecting segment shows that y is an average curvature action on s for a C² objective. A new approximation B is asked to satisfy Bs=y. In more than one dimension this secant equation does not determine every matrix entry. Symmetry, preservation of positive definiteness, and a controlled change from the previous approximation guide the update choice.
Use distinct notation for a Hessian approximation B and its inverse approximation H. The step usually solves Bp=−g; an inverse implementation instead multiplies p=−Hg. Confusing their update formulas produces a method that can look plausible in one dimension and fail in larger systems. Storing a dense matrix costs quadratically in dimension, while limited-memory BFGS keeps selected displacement-gradient pairs and applies an implicit inverse action. That memory reduction changes the representation and available history, not the meaning of s and y.
The curvature denominator has content
For a symmetric positive-definite B and a nonzero s, the Hessian-form BFGS update subtracts the old curvature contribution along Bs and adds one along y. The denominators require positive s-transpose-B-s and positive y-transpose-s. Under those conditions the resulting matrix remains symmetric positive definite and satisfies the secant equation. Thus a nonzero gradient produces a descent direction in the next step. The algebra relies on strict positivity; silently dividing by a tiny or negative curvature product defeats the guarantee.
Suppose an accepted step has s=αp with positive α and the direction is descending. The weak Wolfe curvature condition makes the gradient change projected on p positive enough that y-transpose-s is strictly positive. This connects line search to the matrix update. On a nonconvex objective a trial chosen without that safeguard can yield negative observed curvature. Implementations may skip an update, damp it, or modify the curvature pair, and should document which safeguard was used rather than claim unmodified BFGS behavior.
Separate algebra from convergence speed
Positive definiteness of the approximation is an iteration-level safeguard, not a proof that the objective is convex or that the algorithm reaches a global minimum. Standard local superlinear BFGS results apply near a solution with positive-definite true Hessian, sufficiently regular curvature, suitable initial data, and compatible line search. They are not automatic on an arbitrary nonconvex loss. A useful diagnostic distinguishes the model matrix's eigenvalues from the true objective's curvature because the two can disagree deliberately.
Gradient noise is especially damaging when subtracting nearly equal gradients. A small displacement can make y mostly evaluation error, and a positive but tiny product can produce a huge update. Scale-aware curvature tests, careful stopping tolerances, and occasional restarts are practical responses. Verify a new implementation on a low-dimensional quadratic where exact gradient changes are known, then on a nonlinear example. Passing the quadratic check validates update arithmetic but cannot establish behavior on every noisy or ill-conditioned problem.
Work it through
One exact curvature observation
Start with for . Observe displacement s=(1,0). Compute y and the Hessian-form BFGS update.
The true gradient is . A displacement of (1,0) changes it by y=(2,0), independent of the starting point. Consequently and , so both denominators are positive.
The subtraction term is . The addition term is . Adding to the identity gives .
The eigenvalues two and one are positive, and multiplying by s returns (2,0)=y. The first-coordinate curvature is now exact, but the true second-coordinate curvature is three, while the model still uses one. The secant equation only learned the observed direction.
One update preserves a usable positive-definite model while recovering only the curvature information supplied by the displacement.
The living notebook
Explore the model
Interactive lab · matrix
Conditioning is not the determinant
Pause and Reset, then set diagonal scale a=1 and shear b=0. Predict both singular values. Repeat from Reset with both a=1 and b=2; the determinant remains one while stretching and conditioning change. Playback interpolates this fixed triangular matrix geometry; it does not execute BFGS, and its nonsymmetric matrix is not a Hessian.
- Area scale · det A
- 1.4
- Singular values · σmax, σmin
- 1.597, 0.876
- Condition number · κ₂(A)
- 1.823
The selected matrix is A = [[a,b],[0,1]]. Playback interpolates geometry between the identity and A; readouts always describe A. Its determinant is a and its singular values come from AᵀA. Positive a makes every supported matrix invertible. This two-dimensional family is not a general eigensolver or a learned network. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA matrix can preserve area while changing directional scaling substantially; determinant alone cannot diagnose an optimization model.
Pause & reason
Check your understanding
Your turn
Try it yourself
In one dimension take B=4, displacement s=−0.5, and gradient change y=−1.5. Compute the BFGS result and explain what would happen if y were +1.5 instead.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
In one dimension the subtraction removes the old B completely. Relate the remaining value to the secant slope y/s.
Compare with the solution
The curvature product is 0.75>0. The update becomes , which is positive and satisfies . With y=+1.5 the product would be −0.75, and the same formal expression would produce B=−3. It would lose positive definiteness, so an implementation that promises a positive-definite model must reject or modify that curvature pair.
Keep the idea
Take it with you
- The secant equation captures a gradient change along one observed displacement.
- Positive curvature pairs link Wolfe line search to positive-definite BFGS models.
- Model definiteness, true curvature, local speed, and global optimality are separate claims.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.