Broyden–Fletcher–Goldfarb–Shanno Algorithm
The Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm is a quasi-Newton optimization method that minimizes smooth unconstrained functions by iteratively updating a symmetric positive-definite approximation of the Hessian matrix or its inverse using only first-order gradient evaluations.
Broyden–Fletcher–Goldfarb–Shanno algorithm (BFGS) is an iterative quasi-Newton method in numerical optimization and scientific computing for solving unconstrained nonlinear minimization problems minx∈ℝn f(x) where f is twice continuously differentiable. Discovered independently in 1970 by Charles George Broyden, Roger Fletcher, Donald Goldfarb, and David F. Shanno, the BFGS algorithm bridges the gap between first-order gradient descent—which requires only O(n) operations per step but converges slowly on ill-conditioned valleys—and second-order Newton's method, which achieves quadratic convergence but requires evaluating and factoring the n × n Hessian matrix ∇2f(xk) at a cost of O(n3) operations per step.
Instead of computing second derivatives directly, BFGS accumulates curvature information across successive steps by enforcing the secant equation on the observed step displacement sk = xk+1 − xk and gradient change yk = ∇f(xk+1) − ∇f(xk). By applying a symmetric rank-two update directly to the inverse Hessian approximation Hk ≈ [∇2f(xk)]−1, BFGS computes each search direction in O(n2) operations without solving a linear system via Cholesky decomposition or LU decomposition, while achieving local superlinear convergence.
The Secant Equation and Symmetric Rank-Two Updates
At iteration k, BFGS constructs a local quadratic model of the objective function around xk:
mk(p) = f(xk) + ∇f(xk)Tp + (1/2) pTBkp,
where Bk ∈ ℝn×n is a symmetric positive-definite matrix approximating the true Hessian ∇2f(xk). Minimizing mk(p) yields the quasi-Newton search direction pk = −Bk−1∇f(xk) = −Hk∇f(xk), where Hk = Bk−1 denotes the inverse Hessian approximation. After stepping to xk+1 = xk + αkpk along a step length αk > 0, the updated Hessian approximation Bk+1 is required to mimic the action of the true Hessian along the most recent displacement sk = xk+1 − xk:
Bk+1 sk = yk, or equivalently Hk+1 yk = sk,
where yk = ∇f(xk + sk) − ∇f(xk). Because the secant equation imposes only n linear constraints on the n(n + 1)/2 independent entries of the symmetric matrix Hk+1, infinitely many symmetric matrices satisfy Hk+1yk = sk.
Variational Derivation and the BFGS Update Formulas
Whereas the earlier Davidon–Fletcher–Powell (DFP) formula minimizes the weighted Frobenius distance ‖W1/2(B − Bk)W1/2‖F on the forward Hessian B, BFGS solves the dual variational problem on the inverse Hessian H:
minH ‖W1/2(H − Hk)W1/2‖F subject to H = HT and Hyk = sk,
where W is any symmetric positive-definite weight matrix satisfying Wsk = yk (such as the average Gauss–Newton Hessian). Solving this constrained matrix minimization yields the BFGS inverse Hessian update:
Hk+1 = (I − ρkskykT) Hk (I − ρkykskT) + ρkskskT, where ρk = 1 / (ykTsk).
Applying the Sherman–Morrison–Woodbury matrix inversion identity produces the corresponding forward Hessian BFGS update, which modifies Bk by a rank-two correction:
Bk+1 = Bk − (BkskskTBk) / (skTBksk) + (ykykT) / (ykTsk).
Curvature Condition, Wolfe Line Search, and Superlinear Convergence
Hereditary Positive-Definiteness via the Wolfe Conditions
For pk+1 = −Hk+1∇f(xk+1) to remain a strict descent direction, Hk+1 must inherit positive-definiteness from Hk. For any non-zero vector z ∈ ℝn, forming the quadratic form zTHk+1z shows that Hk+1 is positive-definite if and only if the curvature condition holds:
skTyk > 0.
Geometrically, skTyk = αk [∇f(xk+1)Tpk − ∇f(xk)Tpk] > 0 means that the directional slope along pk becomes less negative between xk and xk+1. This condition is automatically enforced whenever the step size αk satisfies the Wolfe line-search conditions:
- Armijo sufficient decrease: f(xk + αkpk) ≤ f(xk) + c1αk∇f(xk)Tpk (typically c1 = 10−4)
- Curvature condition: ∇f(xk + αkpk)Tpk ≥ c2∇f(xk)Tpk (typically c2 = 0.9).
Because 0 < c1 < c2 < 1 and ∇f(xk)Tpk < 0, any Wolfe step guarantees skTyk ≥ (1 − c2) |αk∇f(xk)Tpk| > 0. By the Dennis–Moré theorem (1974), BFGS with unit step length αk = 1 accepted asymptotically achieves Q-superlinear convergence (limk→∞ ‖xk+1 − x‖ / ‖xk − x‖ = 0) and self-corrects poor initial Hessian scalings far more rapidly than DFP.
| Quasi-Newton / First-Order Variant | Memory Footprint | Per-Step Flops | Convergence Rate | Primary Application Domain |
|---|---|---|---|---|
| Dense BFGS | O(n2) floats | O(n2) | Superlinear | Medium-scale smooth optimization (n ≤ 104) |
| Limited-Memory BFGS (L-BFGS) | O(mn) floats (m ≈ 5–20) | 4mn + O(n) | Fast linear / quasi-superlinear | High-dimensional ML, PDE inverse problems, DFT |
| L-BFGS-B (Box-Constrained) | O(mn) floats | O(m2n) | Superlinear on active face | Bound-constrained parameter estimation |
| DFP (Dual Rank-2 Update) | O(n2) floats | O(n2) | Superlinear (prone to stalling) | Historical precursor to BFGS |
| Nelder–Mead Method | O(n2) simplex vertices | O(n) | Heuristic (no gradients) | Low-dimensional noisy or non-smooth black-box objectives |
Limited-Memory BFGS (L-BFGS) and L-BFGS-B for High Dimensions
When the number of variables n exceeds 104—as in neural network training, seismic waveform inversion, numerical weather variational data assimilation, or electronic-structure geometry relaxation—storing a dense n × n matrix Hk is impossible. Introduced by Jorge Nocedal in 1980, Limited-Memory BFGS (L-BFGS) never forms Hk explicitly. Instead, it stores only the m most recent vector pairs {(si, yi)}i=k−mk−1 (with m typically between 5 and 20) and computes the matrix-vector product Hk∇f(xk) directly using Nocedal's two-loop recursion in 4mn multiplications, starting from the scaled identity seed Hk(0) = [(sk−1Tyk−1)/(yk−1Tyk−1)] I. Its bound-constrained extension L-BFGS-B combines gradient projection along the box constraints l ≤ x ≤ u with subspace minimization over the free variables.
Frequently Asked Questions
Why is BFGS preferred over the DFP update in numerical software?
Although DFP and BFGS are mathematical duals (interchanging B ↔ H and sk ↔ yk), numerical analysis by Powell and Byrd–Nocedal showed that when Hk accidentally acquires a tiny eigenvalue, DFP struggles to recover and can stall for hundreds of iterations, whereas the rank-one term +ρkskskT in the BFGS inverse update immediately restores step length along sk.
How should the initial inverse Hessian matrix H0 be chosen?
Setting H0 = I takes a first step identical to steepest descent, after which scaling H0 ← [(s0Ty0)/(y0Ty0)] I before applying the first BFGS update matches the inverse Rayleigh quotient of the true Hessian along s0, making the second step scale-invariant.
References
- Broyden, C. G. (1970). The convergence of a class of double-rank minimization algorithms 1. General considerations. Journal of the Institute of Mathematics and Its Applications, 6(1), 76–90. https://doi.org/10.1093/imamat/6.1.76
- Fletcher, R. (1970). A new approach to variable metric algorithms. The Computer Journal, 13(3), 317–322. https://doi.org/10.1093/comjnl/13.3.317
- Goldfarb, D. (1970). A family of variable-metric methods derived by variational means. Mathematics of Computation, 24(109), 23–26. https://doi.org/10.1090/S0025-5718-1970-0258249-6
- Shanno, D. F. (1970). Conditioning of quasi-Newton methods for function minimization. Mathematics of Computation, 24(111), 647–656. https://doi.org/10.1090/S0025-5718-1970-0274029-X
- Liu, D. C., & Nocedal, J. (1989). On the limited memory BFGS method for large scale optimization. Mathematical Programming, 45(1), 503–528. https://doi.org/10.1007/BF01589116