numerical optimization
Gradient Descent and First-Order Methods
You should know: convex functions, gradient
Overview
Gradient descent is an iterative first-order optimisation algorithm that moves in the direction of steepest descent of a function. For convex functions it converges to a global minimum; for non-convex functions it converges to a stationary point. Variants including stochastic gradient descent (SGD), momentum methods, and Nesterov's accelerated gradient are the workhorses of modern machine learning and large-scale optimisation.
Intuition
Gradient descent is like descending a foggy mountain by always stepping in the direction that goes most steeply downhill. The step size (learning rate) controls how far to step each time: too large and you overshoot; too small and convergence is slow. Momentum methods remember recent steps to avoid oscillating in narrow valleys.
Formal Definition
Given a differentiable function f: ℝⁿ → ℝ, the gradient descent iteration with step size α > 0 is:
Notation
| Notation | Meaning |
|---|---|
| Step size (learning rate) | |
| Lipschitz constant of ∇f: ‖∇f(x)-∇f(y)‖ ≤ L‖x-y‖ | |
| Strong convexity constant: f(y) ≥ f(x)+∇f(x)ᵀ(y-x)+μ/2‖y-x‖² | |
| Condition number — governs convergence rate |
Properties
Convergence for smooth convex functions
Linear convergence for strongly convex functions
Nesterov acceleration
Worked Examples
- 1
∇f(x) = 2x.
- 2
x¹ = 4 - 0.3·2·4 = 4 - 2.4 = 1.6.
- 3
x² = 1.6 - 0.3·3.2 = 1.6 - 0.96 = 0.64.
- 4
x³ = 0.64 - 0.3·1.28 = 0.256.
✓ Answer
After 3 steps: x ≈ 0.256, converging to x* = 0. Each step multiplies error by (1-2α) = 0.4.
Practice Problems
Show that for f(x) = (1/2)xᵀQx (Q symmetric PD) gradient descent with α = 1/λ_max(Q) converges linearly with rate (1 - λ_min/λ_max).
Common Mistakes
Choosing a step size that is too large
If α > 2/L (where L is the Lipschitz constant of ∇f), gradient descent can diverge. The safe choice is α ≤ 1/L.
Quiz
Historical Background
The basic gradient descent idea dates to Cauchy (1847). Nesterov's 1983 accelerated gradient method achieved the optimal convergence rate O(1/k²) for smooth convex functions, matching an information-theoretic lower bound. Stochastic gradient descent, popularised by Robbins and Monro (1951) and rediscovered for neural networks in the 1980s-90s, now drives deep learning.
- 1847
Cauchy proposes gradient descent (the 'method of steepest descent')
Augustin-Louis Cauchy
- 1951
Robbins-Monro stochastic approximation framework
Herbert Robbins, Sutton Monro
- 1983
Nesterov's accelerated gradient method with O(1/k²) rate
Yurii Nesterov
Summary
- Gradient descent: x^(k+1) = x^(k) - α∇f(x^(k)); step toward steepest descent.
- For L-smooth convex f with α=1/L: convergence rate O(1/k) in function value.
- For strongly convex f: linear (geometric) convergence rate 1-μ/L per step.
- Nesterov acceleration achieves optimal O(1/k²) rate via momentum extrapolation.
References
- BookBoyd, S. and Vandenberghe, L. — Convex Optimization (2004), Chapter 9. Free at https://web.stanford.edu/~boyd/cvxbook/
- BookNesterov, Y. — Introductory Lectures on Stochastic Optimization (2004), Springer
- WebsiteWikipedia — Gradient descent
Mathematics