Gradient Descent

Gradient descent is an iterative first-order optimization algorithm that minimizes a differentiable function by repeatedly stepping in the direction of the negative gradient. Key result: for a step size small enough, each iteration decreases the function value, and for convex functions it converges to a global minimum. Where it applies: machine learning, deep neural networks, logistic/linear regression, numerical optimization, signal processing, and any large-scale problem where computing a Hessian is too expensive. Who/when: the method traces to Augustin-Louis Cauchy (1847), with modern stochastic and accelerated variants developed through the 20th and 21st centuries.

Gradient descent finds a local minimum of a differentiable function by exploiting the fact that the gradient points in the direction of steepest increase; moving in the opposite direction therefore decreases most rapidly (locally). At each step the algorithm updates the current estimate by a fraction (the learning rate or step size) of the negative gradient. It matters because it is the computational workhorse behind nearly all of modern machine learning: training a billion-parameter neural network is, at heart, gradient descent on a loss function. A surprising fact is that despite being a "greedy" local method that only ever looks one step ahead, on convex problems it provably reaches the global optimum, and even on the wildly non-convex landscapes of deep learning it reliably finds solutions that generalize well.

The Core Insight

The gradient is the direction of fastest increase of at . Therefore is the direction of fastest decrease. By taking small steps "downhill" along , we slide toward a minimum — just as a ball rolls down the steepest slope of a valley. The only tuning knob is how big a step to take: too small and we crawl; too large and we overshoot or diverge.

Formal Statement

Gradient Descent Iteration

Let be differentiable. Starting from an initial point , gradient descent generates a sequence by the update rule:

1
⟳subtract a multiple of the gradient because is the steepest-descent direction; scales how far to move.

where:

  • is the iterate (current estimate of the minimizer) at step ,
  • is the step size (learning rate); it may be constant () or vary with ,
  • evaluated at is the gradient vector.

The iteration stops when a convergence criterion is met, e.g. for a small tolerance .

The justification that is "best" comes from the directional derivative. For a unit vector , the rate of change of at in direction is:

2
⟳the directional derivative is the dot product of the gradient with the direction; expand the dot product using the angle between them.

This is minimized (most negative) when , i.e. when .

Descent Lemma and Convergence (L-smooth case)

Suppose is -smooth, meaning its gradient is Lipschitz continuous:

3

⟳this is the definition of an -Lipschitz gradient; it bounds how fast the gradient can change.

Then for the constant step size , the iterates satisfy the sufficient decrease property:

4
⟳apply the quadratic upper bound (descent lemma) at and minimize the right side over .

Consequently is monotonically non-increasing, and the gradients vanish: at rate . If, in addition, is convex, then ; if is -strongly convex, convergence is linear (geometric):

5

⟳combine strong convexity (a lower quadratic bound) with the descent lemma to get a contraction factor per step.

Why It Holds / Derivation

Descent Lemma → Sufficient Decrease

Step 1 — Quadratic upper bound. If is -smooth, then for any :
6
⟳integrate along the segment from to , then bound the gradient difference using the Lipschitz condition .
Step 2 — Substitute the update. Put and . Then , and:
7
⟳plug into ; the dot product .
Step 3 — Choose the step size. Collect the gradient-norm terms:
8
⟳factor out of the last two terms of .

The coefficient is positive for and is maximized at , giving the factor and recovering . Whenever , the function strictly decreases.

Step 4 — Telescoping for the rate. Sum over :
9
⟳rearrange to , then sum; the right side telescopes.

so the smallest gradient norm satisfies , the rate.

Augustin-Louis Cauchy | 1789–1857

The French mathematician Cauchy introduced the method of steepest descent in an 1847 note to the Académie des Sciences, "Méthode générale pour la résolution des systèmes d'équations simultanées." His motivation was astronomical: solving large systems of equations arising in orbit computations, where direct elimination was impractical. Cauchy proposed minimizing a sum of squares by repeatedly moving along the direction of greatest decrease — precisely . He worked without the modern vocabulary of vector calculus, but the geometric idea (follow the steepest slope) was fully present. The method lay relatively dormant until the rise of numerical computing in the mid-20th century revived it as the foundation of large-scale optimization.

Building Intuition

Imagine you are standing on a foggy mountainside and want to reach the valley bottom, but you can only see the ground directly at your feet. The sensible strategy: feel which way the slope goes down most steeply, take a step that way, and repeat. The gradient is your "feel for the slope," and the step size is your stride length.

Two things can go wrong. If your stride is tiny, you'll reach the valley eventually but it takes forever. If your stride is huge, you might leap clear across the valley and end up higher on the opposite slope, then leap back even higher — oscillating and diverging. The "just right" stride depends on how curved the terrain is (encoded by , the smoothness constant).

In a long, narrow valley (an ill-conditioned problem where the function is much steeper in one direction than another), gradient descent zig-zags inefficiently across the valley walls instead of running straight down its length. This is why conditioning — the ratio — controls convergence speed in .

Gradient descent zig-zagging down an elliptical bowl toward the minimum

minimum x* x0 Concentric ellipses = level sets of f. Steps cross perpendicular to contours, zig-zagging in the narrow valley.

Worked Examples

Minimizing a 1-D quadratic by hand

Given: , so . Use step size , start at . Update rule: . Steps:

Since , the sequence converges geometrically to the true minimizer.

Check the limit on : here , so we need . With we are safely inside, and the contraction factor is , matching the computation.

Linear regression via gradient descent — one step with numbers

Given: Fit to two data points and . Mean-squared loss:
Gradient:
Start , step size . Step 1: .
Step 2: .
Step 3: .

Setting gives the exact least-squares solution . The iterates climb steadily toward it.

Note: , so the stable range is ; our converges.

Common Misconceptions

Larger step size is NOT always faster

A bigger learning rate can speed early progress, but past the stability threshold the iteration diverges. In Example 1, taking gives contraction factor , so blows up. Choosing is a genuine trade-off, not "the bigger the better." Practical schemes use line search, adaptive rates (Adam, AdaGrad), or learning-rate decay.

Gradient descent finds local, not global, minima

For a non-convex , gradient descent converges only to a stationary point (), which may be a local minimum, a saddle point, or a plateau — not necessarily the global minimum. Convexity is what upgrades the guarantee from "local" to "global." Where the algorithm ends up depends on the starting point .

A non-convex function trapping gradient descent

Consider (a double-well shape). Its derivative has three roots; two are local minima of differing depth and one is a local maximum. Starting at , gradient descent slides into the right well (the shallower local minimum near ), never discovering the deeper left well near that is the true global minimum. No amount of tuning escapes this — only a different initialization (or a global method) reaches the global optimum. This illustrates why initialization and restarts matter in non-convex optimization.

Connections

Gradient descent is one node in a dense web of optimization ideas. It is the first-order cousin of Newton's Method, which additionally uses the Hessian Matrix to capture curvature and converges quadratically near the optimum (at the cost of inverting an matrix each step). The directional-derivative justification in rests on the Gradient and Directional Derivative from multivariable calculus. The convergence guarantees rely on Convex Functions and the notion of Lipschitz Continuity. When the full gradient is too expensive, one replaces it with a noisy estimate to obtain Stochastic Gradient Descent, the engine of deep learning. Acceleration techniques connect it to Momentum Methods and Nesterov Acceleration, which improve the convex rate from to . The continuous-time limit of gradient descent is the Gradient Flow ordinary differential equation .

Real-World Applications

  1. Training neural networks — Backpropagation computes gradients of a loss over millions of weights; (stochastic) gradient descent updates them. This underlies GPT-style language models, image classifiers (ResNet), and AlphaGo's policy networks.
  2. Logistic & linear regression — Standard statistical models in econometrics, epidemiology, and credit scoring are routinely fit by gradient descent when datasets are too large for closed-form normal equations.
  3. Recommender systems — Matrix-factorization models at Netflix and Amazon learn user/item latent factors by minimizing reconstruction error with SGD.
  4. Inverse problems in imaging — CT/MRI reconstruction and seismic imaging minimize a data-fidelity-plus-regularization objective via (proximal) gradient methods.
  5. Robotics & optimal control — Trajectory optimization and reinforcement-learning policy gradients descend a cost surface to plan motions.
  6. Portfolio optimization — Large-scale convex risk-minimization in quantitative finance uses gradient and projected-gradient methods.
  7. Natural-language and speech models — Transformers and recurrent networks for translation and transcription are trained almost exclusively with gradient-based optimizers (Adam, a gradient-descent descendant).

Historical Development

  • 1847 — Augustin-Louis Cauchy publishes the method of steepest descent for solving systems of equations arising in astronomy.
  • 1907 — Jacques Hadamard independently studies the steepest-descent approach in the context of integral approximation.
  • 1944 — Haskell Curry analyzes the method of steepest descent for nonlinear minimization, providing convergence conditions.
  • 1951 — Herbert Robbins and Sutton Monro introduce the stochastic approximation method, the theoretical seed of stochastic gradient descent.
  • 1952 — Magnus Hestenes and Eduard Stiefel publish conjugate gradients, an acceleration over plain steepest descent for quadratic problems.
  • 1964 — Boris Polyak introduces the heavy-ball (momentum) method, accelerating gradient descent.
  • 1983 — Yurii Nesterov publishes his accelerated gradient method, achieving the optimal rate for smooth convex functions.
  • 1986 — Rumelhart, Hinton, and Williams popularize backpropagation, making gradient descent practical for multilayer neural networks.
  • 2011–2015 — Adaptive learning-rate methods (AdaGrad 2011, RMSProp 2012, Adam 2014/15) become the de-facto optimizers for deep learning.

Subtleties & Limits

Several deep questions remain active research:

  • Why does SGD generalize? In over-parameterized deep networks the loss surface has infinitely many global minima of zero training error, yet SGD tends to find ones that generalize well to unseen data. The precise mechanism (implicit regularization, flat-minima preference) is not fully understood.
  • Saddle points vs. minima. High-dimensional non-convex landscapes are dominated by saddle points rather than poor local minima. How quickly (and reliably) does gradient descent — possibly with noise — escape saddles? Sharp characterizations are still being developed.
  • Optimal step-size schedules. The theoretically optimal learning-rate schedule for non-convex problems is unknown; practitioners rely on heuristics (warmup, cosine decay).
  • Lower bounds and acceleration limits. Nesterov's is optimal for first-order methods on smooth convex functions, but the landscape of optimal rates under different assumptions (non-smooth, stochastic, distributed) is incompletely mapped.

See Also

Gradient · Newton's Method · Stochastic Gradient Descent · Convex Functions · Lipschitz Continuity · Momentum Methods · Nesterov Acceleration · Gradient Flow · Backpropagation · Hessian Matrix · Directional Derivative · Conjugate Gradient Method

Before this

  • Gradient — the negative gradient is the descent direction; the whole method is built on it.
  • Directional Derivative — justifies why $-\nabla f$ is steepest descent (equation $[2]$).
  • Convex Functions — convexity is what guarantees convergence to a global minimum.
  • Multivariable Calculus — partial derivatives, Taylor expansion, and the quadratic bound $[6]$.
  • Lipschitz Continuity — the $L$-smoothness assumption that yields the step-size rule $\alpha = 1/L$.

Where this leads