Foundations to Frontier
Tests
A. Mathematical Foundations › A6 Optimization › Foundations

Line Search: the Armijo and Wolfe Conditions

Once you have a descent direction, how far should you go? A line search answers this at every iteration, so you never have to hand-tune a step size. You will learn the Armijo sufficient-decrease condition and backtracking, the Wolfe curvature condition that rules out timid steps, exact line search on quadratics, interpolation tricks, and the Zoutendijk theorem that makes line-search methods globally convergent. Then you'll combine Newton with backtracking to fit a grasp-success model in a handful of iterations.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Try a big step, and shrink it if it doesn’t help

You know which direction is downhill, but not how far to walk. A simple rule works well: try a long stride. If you didn’t get noticeably lower, try half that stride, then half again, until it works. That’s backtracking.

There’s also a second rule against being too timid. If the ground is still sloping steeply downhill where you’d land, you could have gone further. Together these rules make the step size choose itself.

How far to step? Armijo backtracking and the Wolfe conditions
start:
step α → 0.431
φ′(0) = -2.00 · trials: 4 · accepted α = 1.25e-1 · decrease 0.2100 · strong Wolfe at accepted α: yes
Thick curve: φ(α), the objective along the search direction. Grey: its tangent at 0. Green dashed: the Armijo line, flatter than the tangent by the factor c₁; a step is acceptable if φ lies below it. Shaded: steps that also satisfy the strong Wolfe curvature condition (the slope has flattened enough, so the step isn't timidly short). Backtracking tries α₀, ρα₀, ρ²α₀, … and accepts the first Armijo point. On Rosenbrock's steep wall only tiny steps qualify, while along the valley floor large ones do.
Why engineers care

Line searches make optimizers robust without hand-tuning. They’re built into L-BFGS (used for calibration, SLAM initialization and scientific ML), into damped Newton and interior-point solvers for MPC, and into trajectory optimizers. A fixed step that works on one problem diverges on the next; a line search adapts.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Backtracking means…
  2. 2. The second (curvature) rule prevents steps that are…
  3. 3. With a line search, the step size is…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

The one-dimensional problem

Given xkx_k and a descent direction dkd_k (∇f(xk)⊤dk<0\nabla f(x_k)^\top d_k < 0), define φ(α)=f(xk+αdk)\varphi(\alpha) = f(x_k + \alpha d_k). Then φ′(0)=∇f(xk)⊤dk<0\varphi'(0) = \nabla f(x_k)^\top d_k < 0. We want an α>0\alpha > 0 that decreases φ\varphi enough, cheaply.

Armijo (sufficient decrease)

φ(α)≤φ(0)+c1 α φ′(0),0<c1<1 (typically 10−4)\varphi(\alpha)\le\varphi(0) + c_1\,\alpha\,\varphi'(0),\qquad 0 < c_1 < 1\ (\text{typically }10^{-4})

The step must achieve at least a fraction c1c_1 of the decrease predicted by the tangent line.

Backtracking: start from α0\alpha_0 (1 for Newton and quasi-Newton). While Armijo fails, set α←ρα\alpha\leftarrow\rho\alpha with ρ∈(0,1)\rho\in(0, 1), often 12\tfrac12. Because φ′(0)<0\varphi'(0) < 0, small enough steps always pass, so the loop terminates.

📝 Quick check (Level 1)
0/3 answered
  1. 1. Armijo compares φ(α) with…
  2. 2. Backtracking always terminates because…
  3. 3. A typical value of c₁ is…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.

The Wolfe conditions

Armijo alone accepts arbitrarily tiny steps. The curvature condition rules them out:

φ′(α)≥c2 φ′(0),c1<c2<1\varphi'(\alpha)\ge c_2\,\varphi'(0),\qquad c_1 < c_2 < 1

The slope at the new point must have flattened. Strong Wolfe also bounds overshooting: ∣φ′(α)∣≤c2∣φ′(0)∣|\varphi'(\alpha)|\le c_2|\varphi'(0)|. Typical values: c2=0.9c_2 = 0.9 for Newton and quasi-Newton, and c2=0.1c_2 = 0.1 for nonlinear conjugate gradient. For a smooth ff bounded below, steps satisfying both conditions always exist.

Why it matters: BFGS needs sk⊤yk>0s_k^\top y_k > 0 to keep its Hessian approximation positive definite (A6.3-5). The Wolfe curvature condition guarantees it.

On a quadratic 12x⊤Hx−b⊤x\frac12x^\top Hx - b^\top x along d=−gd = -g: α⋆=g⊤gg⊤Hg\alpha^\star = \dfrac{g^\top g}{g^\top Hg}. Successive gradients are then orthogonal, which causes the classic zig-zag. Even with exact steps, steepest descent’s rate in ff is (κ−1κ+1)2\big(\frac{\kappa - 1}{\kappa + 1}\big)^2. A line search fixes the step length, not the direction.

Smarter backtracking

Fit a parabola through φ(0)\varphi(0), φ′(0)\varphi'(0) and the rejected φ(α)\varphi(\alpha), and jump to its minimum:

αnew=−φ′(0) α22(φ(α)−φ(0)−φ′(0)α)\alpha_{\text{new}} = -\frac{\varphi'(0)\,\alpha^2}{2\big(\varphi(\alpha) - \varphi(0) - \varphi'(0)\alpha\big)}

Cubic interpolation and zoom procedures (Moré and Thuente, 1994) find strong-Wolfe steps in a couple of evaluations.

🐍 Exercise 1: backtracking on Rosenbrock
Implement Armijo backtracking and a Wolfe checker. Show monotone convergence of GD with line search on Rosenbrock, divergence of a fixed step, and that a tiny step passes Armijo but fails the curvature condition.
📝 Quick check (Level 2)
0/3 answered
  1. 1. The weak Wolfe curvature condition is…
  2. 2. Exact line search on a quadratic along −g gives α* =
  3. 3. BFGS needs Wolfe steps because they guarantee…

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Armijo steps exist and aren’t too small

If ∇f\nabla f is LL-Lipschitz, then φ(α)≤φ(0)+αφ′(0)+Lα22∥d∥2\varphi(\alpha)\le\varphi(0) + \alpha\varphi'(0) + \frac{L\alpha^2}2\|d\|^2. This is below the Armijo line whenever α≤2(1−c1)∣φ′(0)∣L∥d∥2\alpha\le\frac{2(1 - c_1)|\varphi'(0)|}{L\|d\|^2}. So backtracking stops at some α≥ρ⋅2(1−c1)∣φ′(0)∣L∥d∥2\alpha\ge\rho\cdot\frac{2(1 - c_1)|\varphi'(0)|}{L\|d\|^2} (or at α0\alpha_0). For d=−∇fd = -\nabla f that’s α≥2ρ(1−c1)/L\alpha\ge2\rho(1 - c_1)/L. The step is automatically of order 1/L1/L without knowing LL. ∎

Zoutendijk’s theorem

Let cos⁡θk=−∇fk⊤dk/(∥∇fk∥∥dk∥)\cos\theta_k = -\nabla f_k^\top d_k/(\|\nabla f_k\|\|d_k\|). If ff is bounded below with an LL-Lipschitz gradient and the steps satisfy Wolfe, then

∑kcos⁡2θk ∥∇fk∥2<∞\sum_k\cos^2\theta_k\,\|\nabla f_k\|^2 < \infty

So if the directions stay away from orthogonal to the gradient (cos⁡θk≥δ>0\cos\theta_k\ge\delta > 0), we get ∇fk→0\nabla f_k\to0. That’s global convergence to stationary points for steepest descent, damped Newton with positive definite Hessians, and BFGS on convex problems. ∎ (Nocedal and Wright, 2006, Thm 3.2.)

Away from the solution, the Newton direction with backtracking behaves like a scaled gradient method and guarantees descent. Near the solution, α=1\alpha = 1 passes Armijo (for c1<12c_1 < \frac12), and quadratic convergence takes over. Always try α0=1\alpha_0 = 1 first for Newton-type methods.

Exercise 3.1: Backtracking guarantees what minimum step for GD with L = 100, ρ = 0.5, c₁ = 10⁻⁴?

α≥2⋅0.5⋅(1−10−4)/100≈0.01\alpha\ge2\cdot0.5\cdot(1 - 10^{-4})/100\approx0.01, about 1/L1/L.

📝 Quick check (Level 3)
0/3 answered
  1. 1. For GD with backtracking, the accepted step is at least of order…
  2. 2. Zoutendijk's theorem needs directions with…
  3. 3. Near the solution, damped Newton accepts…

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Fitting a grasp-success model

Logistic regression on grasp features (one feature on a 3× larger scale) is smooth and strongly convex with regularization. Steepest descent with backtracking needs hundreds of iterations, because the line search fixes the step length but not the badly scaled direction. Newton with backtracking (try α=1\alpha = 1, halve if needed) converges in about 6 iterations and about a dozen evaluations. This is the IRLS algorithm behind every statistics package’s logistic fit.

🐍 Exercise 2 (research): line-search GD vs damped Newton
Implement the regularized logistic loss, gradient and Hessian, then compare steepest descent and Newton, both with Armijo backtracking, in iterations and function evaluations.

Line searches in AI, robotics and aerospace

  • L-BFGS with a strong-Wolfe line search (Moré–Thuente) is the default in SciPy, PyTorch’s LBFGS, and many calibration and scientific-ML codes (Liu and Nocedal, 1989).
  • Interior-point and SQP solvers (IPOPT, SNOPT) use backtracking, filter or merit-function line searches to globalize Newton steps in trajectory optimization (Gill, Murray and Saunders, 2005).
  • Deep learning: stochastic line searches (Armijo on mini-batches) can replace learning-rate tuning in some regimes (Vaswani et al., 2019).
  • Trust regions are the alternative globalization: limit the step’s length instead of searching along it. They’re used in Ceres and many SLAM back ends.

References

  1. L. Armijo (1966). “Minimization of functions having Lipschitz continuous first partial derivatives.” Pacific Journal of Mathematics, 16(1).
  2. P. Wolfe (1969). “Convergence conditions for ascent methods.” SIAM Review, 11(2).
  3. G. Zoutendijk (1970). “Nonlinear programming, computational methods.” In Integer and Nonlinear Programming, North-Holland.
  4. J. Nocedal, S. Wright (2006). Numerical Optimization, 2nd ed. Springer. Ch. 3.
  5. J. Moré, D. Thuente (1994). “Line search algorithms with guaranteed sufficient decrease.” ACM Transactions on Mathematical Software, 20(3).
  6. D. Liu, J. Nocedal (1989). “On the limited memory BFGS method for large scale optimization.” Mathematical Programming, 45.
  7. P. Gill, W. Murray, M. Saunders (2005). “SNOPT: an SQP algorithm for large-scale constrained optimization.” SIAM Review, 47(1).
  8. S. Vaswani et al. (2019). “Painless stochastic gradient: interpolation, line-search, and convergence rates.” NeurIPS.
  9. A. Conn, N. Gould, P. Toint (2000). Trust-Region Methods. SIAM.
  10. S. Boyd, L. Vandenberghe (2004). Convex Optimization. Cambridge University Press. §9.2.