Convergence of SGD in Non-Convex Settings
Non-convex SGD cannot promise a global minimum, so theory guarantees stationarity instead: the gradient shrinks at a one-over-root-T rate.
Why Does This Exist?
In convex optimization SGD chases the global minimum and theory tracks the distance to it. In non-convex training that target does not exist, yet SGD still works. The theory had to change its promise: instead of reaching the best point, SGD reaches a point where the gradient is small, called an approximate stationary point, and it does so at a quantified rate.
That rate guides every training budget. It tells you how many steps buy how much gradient shrinkage, how batch size trades noise for speed, and why decaying steps matter. Pair with saddle-point escape for second-order guarantees and PL condition for the faster linear regime.
The one idea you need first
An unbiased stochastic gradient satisfies with variance bounded by . Mini-batches give exactly this: correct on average, noisy per step. See SGD variants for the estimators.
Think of It Like This
Finding flat ground while wearing blurry glasses
You want flat ground in dark hills, but your slope readings have static: each measurement is correct on average yet jittery. One reading might say tilt left when the true slope tilts right.
You cope by taking small steps and averaging over time. Small steps keep bad readings from throwing you off a cliff. Averaging washes out the static and reveals the true trend. The noisier your glasses, the smaller your steps must be, and the longer the walk takes.
Where the analogy stops: real SGD noise shrinks near interpolating minima, so late training sees clearer readings than early training.
How It Actually Works
Assume -smoothness and variance . SGD with fixed step satisfies:
The two terms pull opposite ways: small kills the noise term but slows the first term. Setting balances them and gives the headline rate. That means halving the gradient takes four times the steps. Larger batches cut linearly, which buys a larger safe step, up to the point where hardware costs dominate.
Worked example
Take with gradient noise each step (variance ), , gap from , steps:
- Optimal step: , capped by . Use .
- Bound: first term . Noise term . Total average squared gradient .
- Double to with : first term , noise , total . Four times the steps halved the bound, exactly the root-T pace.
Code
import numpy as np
rng = np.random.default_rng(1)
def sgd_trace(x0: float, steps: int, eta: float) -> float: x = x0 sq = 0.0 for _ in range(steps): g = 2.0 * x + rng.choice([-1.0, 1.0]) # true grad plus noise x = x - eta * g sq += (2.0 * x) ** 2 return sq / steps # average squared true gradient
print(round(sgd_trace(3.0, 100, 0.3), 3)) # -> about 1.1, near the 1.2 boundprint(round(sgd_trace(3.0, 400, 0.15), 3)) # -> about 0.55, roughly halvedWatch Out For
Keeping the step size constant and expecting convergence
Fixed steps leave the noise term permanently on. The gradient norm plateaus at that floor no matter how long you train, which looks like a saddle but is just noise.
Decay the step (or raise the batch size) once the loss plateaus. Cosine or step decay schedules exist for exactly this transition.
Reading the last iterate instead of the average
The bound covers the average over iterates, not the final point. The last iterate can sit on a noise spike with a large gradient while the average is small.
Track a moving average of the gradient norm or validate on a held-out batch before declaring stationarity.
The Quick Version
- Non-convex theory promises small gradients, not global minima, at an rate.
- Step size trades descent speed against noise: too large diverges, too small crawls.
- Batches cut variance linearly and permit larger steps until hardware costs bind.
- Decay steps or grow batches after plateaus to push past the noise floor.
- Judge the averaged gradient norm, not a single noisy last step.