Skip to content
nonconvexcard

SGD — Convergence Under Every Standard Assumption

Convex, strongly convex and non-convex SGD; constant versus decaying steps; Robbins–Monro; and the difference between expected and high-probability guarantees.

SGDGraduate⏱ 1 day21 min readsgdstochastic approximationrobbins-monronoise floorvariance
7 problems →

Setup

DefinitionThe stochastic gradient oracle
xt+1=xt−ηtgt,x_{t+1} = x_t - \eta_t g_t,

where the oracle satisfies, conditional on the past Ft=σ(x0,…,xt)\mathcal{F}_t = \sigma(x_0,\dots,x_t):

(A1) unbiasedness:E[gt∣Ft]=∇f(xt);(A2) bounded variance:E[∥gt−∇f(xt)∥22∣Ft]≤σ2;(A3) bounded second moment:E[∥gt∥22∣Ft]≤G2(used only for the non-smooth results).\begin{aligned} &\textbf{(A1) unbiasedness:} && \E[g_t \mid \mathcal{F}_t] = \nabla f(x_t);\\ &\textbf{(A2) bounded variance:} && \E\big[\norm{g_t - \nabla f(x_t)}_2^2 \mid \mathcal{F}_t\big] \le \sigma^2;\\ &\textbf{(A3) bounded second moment:} && \E\big[\norm{g_t}_2^2\mid\mathcal{F}_t\big] \le G^2 \quad\text{(used only for the non-smooth results)}. \end{aligned}

Assumptions

(A1) is what makes the method a stochastic approximation of gradient descent rather than a different algorithm. It holds exactly for uniform sampling from a finite training set, and it fails for importance sampling without reweighting, for asynchronous updates with stale gradients, and for gradient clipping — which is worth knowing, since clipping is standard practice in LLM training and the standard theorems do not cover it.

Run it: Gradient descent, momentum and SGDTrajectories and suboptimality curves for GD, Nesterov acceleration, heavy ball and SGD on a quadratic.

Convex case

TheoremSGD on convex Lipschitz functions

Let ff be convex with minimiser x⋆x^\star, ∥x0−x⋆∥2≤R\norm{x_0-x^\star}_2\le R, and assume (A1) and (A3). Run SGD for TT steps with constant η=RGT\eta = \frac{R}{G\sqrt T} and output xˉT=1T∑t<Txt\bar x_T = \frac1T\sum_{t<T}x_t. Then

E[f(xˉT)]−f⋆≤GRT.\E\big[f(\bar x_T)\big] - f^\star \le \frac{GR}{\sqrt T}.

Strongly convex case: the noise floor

TheoremConstant-step SGD on strongly convex smooth functions

Let ff be μ\mu-strongly convex and LL-smooth, and assume (A1)–(A2). Run SGD with constant η≤12L\eta \le \frac{1}{2L}. Then

E∥xT−x⋆∥22≤(1−ημ)T∥x0−x⋆∥22+ησ2μ.\E\norm{x_T-x^\star}_2^2 \le (1-\eta\mu)^T\norm{x_0-x^\star}_2^2 + \frac{\eta\sigma^2}{\mu}.

Key idea

Two terms, two behaviours. The first decays geometrically — this is the deterministic linear rate, unchanged. The second, ησ2/μ\eta\sigma^2/\mu, does not decay at all. Constant-step SGD does not converge to x⋆x^\star; it converges to a ball of radius ησ2/μ\sqrt{\eta\sigma^2/\mu} around it, and the radius shrinks only if you shrink η\eta. The trade is explicit: a larger step reaches the ball faster and the ball is bigger. This is the whole story behind learning-rate schedules, and it is visible directly in the SGD experiment as the flattening of the error curve.

TheoremSGD with decaying step size

Under the same assumptions, run SGD with ηt=2μ(t+γ)\eta_t = \frac{2}{\mu(t+\gamma)} for γ=4L2/μ2\gamma = 4L^2/\mu^2. Then for all T≥1T\ge1,

E∥xT−x⋆∥22≤Cσ2μ2T+C′∥x0−x⋆∥22T2\E\norm{x_T-x^\star}_2^2 \le \frac{C\sigma^2}{\mu^2 T} + \frac{C'\norm{x_0-x^\star}_2^2}{T^2}

for absolute constants C,C′C,C' depending only on the ratio L/μL/\mu.

TheoremRobbins–Monro conditions

In the stochastic approximation setting, if the step sizes satisfy

∑t=1∞ηt=∞and∑t=1∞ηt2<∞,\sum_{t=1}^\infty \eta_t = \infty \qquad\text{and}\qquad \sum_{t=1}^\infty\eta_t^2 < \infty,

then (under regularity conditions on ff and the noise) xt→x⋆x_t \to x^\star almost surely.

Quoted from Robbins and Monro; modern proofs go through supermartingale convergence. The two conditions have clean interpretations visible in the proofs above: ∑ηt=∞\sum\eta_t = \infty ensures the geometric-decay factor ∏t(1−ηtμ)\prod_t(1-\eta_t\mu) goes to zero, so the initial condition is forgotten; ∑ηt2<∞\sum\eta_t^2<\infty ensures the accumulated noise ∑tηt2σ2\sum_t\eta_t^2\sigma^2 is finite, so the noise floor vanishes. ηt=1/t\eta_t = 1/t satisfies both; ηt=1/t\eta_t = 1/\sqrt t satisfies the first only; any constant η\eta satisfies the second only — and correspondingly has the floor computed above.

Non-convex case

TheoremSGD on smooth non-convex functions

Let ff be LL-smooth and bounded below by f⋆f^\star, and assume (A1)–(A2). Run SGD for TT steps with constant η=min⁡(1L,2(f(x0)−f⋆)Lσ2T)\eta = \min\left(\frac1L, \sqrt{\frac{2(f(x_0)-f^\star)}{L\sigma^2T}}\right). Then

1T∑t=0T−1E∥∇f(xt)∥22≤2(f(x0)−f⋆)ηT+ηLσ2  ≲  Lσ2(f(x0)−f⋆)T.\frac1T\sum_{t=0}^{T-1}\E\norm{\nabla f(x_t)}_2^2 \le \frac{2\big(f(x_0)-f^\star\big)}{\eta T} + \eta L\sigma^2 \;\lesssim\; \sqrt{\frac{L\sigma^2\big(f(x_0)-f^\star\big)}{T}} .

What this does not say

Compare with the deterministic non-convex rate O(1/T)O(1/T) for min⁡s∥∇f(xs)∥22\min_s\norm{\nabla f(x_s)}_2^2: noise costs a full square root. And the conclusion is still only about average squared gradient norm — it does not say the last iterate has small gradient, does not say any iterate is near a local minimum, and says nothing at all about f(xT)−inf⁡ff(x_T)-\inf f. Every caveat from the deterministic non-convex theorem still applies, plus the new one that the guarantee is in expectation.

Mini-batching and the expectation/probability distinction

PropositionMini-batching reduces variance linearly

If gt(B)=1B∑b=1Bgt(b)g_t^{(B)} = \frac1B\sum_{b=1}^B g_t^{(b)} with the gt(b)g_t^{(b)} conditionally i.i.d. unbiased with variance σ2\sigma^2, then gt(B)g_t^{(B)} is unbiased with conditional variance σ2/B\sigma^2/B. Consequently the noise floor of constant-step SGD becomes ησ2/(μB)\eta\sigma^2/(\mu B) and the non-convex rate becomes Lσ2Δ0/(BT)\sqrt{L\sigma^2\Delta_0/(BT)}.

PropositionExpected error does not bound failure probability

A bound E[f(xT)−f⋆]≤ϵ\E[f(x_T)-f^\star]\le\epsilon implies only

P(f(xT)−f⋆>s)≤ϵs,\P\big(f(x_T)-f^\star > s\big)\le \frac{\epsilon}{s},

by Markov's inequality, and this is the best possible without further assumptions.

Key idea

For a 99%99\% confidence statement one needs ϵ≤s/100\epsilon \le s/100, i.e. a hundred-fold improvement in the expected error — a 10410^4-fold increase in TT under the 1/T1/\sqrt T rate. This is why high-probability bounds for SGD are a separate research programme rather than a corollary: getting P(gap>s)≤δ\P(\text{gap}>s)\le\delta with a log⁡(1/δ)\log(1/\delta) dependence requires martingale concentration (Azuma or Freedman's inequality) applied to the noise sequence, and additional assumptions such as sub-Gaussian gradient noise. Reporting an in-expectation bound as though it were a high-confidence guarantee is a common and consequential error.

HeuristicThe SDE / diffusion approximation

Heuristic — a reasoning shortcut that predicts the right answer in the regimes discussed here. It is not a proof and can fail outside them.

As η→0\eta\to0 with t=ηkt = \eta k held fixed, the SGD recursion resembles the Itô SDE

dXt=−∇f(Xt) dt+η Σ(Xt)  dWt,dX_t = -\nabla f(X_t)\,dt + \sqrt{\eta\,\Sigma(X_t)}\;dW_t,

where Σ(x)\Sigma(x) is the gradient-noise covariance. Li, Tai and E make this precise as a weak approximation of order one in η\eta.

What this does not say

The approximation is genuinely useful for intuition — it explains why the stationary distribution depends on the ratio η/B\eta/B rather than on either separately, and it motivates linear learning-rate scaling rules. But its hypotheses are not satisfied in the regimes people invoke it for:

  • it requires η\eta small, and deep learning uses the largest stable η\eta;
  • it assumes the noise is approximately Gaussian, whereas mini-batch gradient noise is often heavy-tailed;
  • it assumes Σ\Sigma varies slowly, whereas gradient noise covariance changes sharply across the loss landscape.

Statements of the form "SGD prefers flat minima because the SDE's stationary measure concentrates there" are heuristic arguments resting on these hypotheses, not theorems about SGD. They belong in the same category as the other plausible-but-unproven claims catalogued on the deep learning theory page.

Problems

Derive the constant-step SGD noise floorProof · Graduate · 1 hour SGD on convex Lipschitz objectivesProof · Intermediate · 30 min The non-convex SGD rateProof · Advanced · 1 hour Mini-batching and the compute budgetNumerical · Intermediate · 30 min Reading the Robbins–Monro conditions off the proofProof · Intermediate · 30 min Implement SGD and locate the noise floorCoding · Advanced · 3 hours Expected error does not give a high-probability guaranteeProof · Advanced · 30 min

References

These works are cited as sources to read, not reproduced. All exposition, examples and problems on this site are written independently; where an argument is standard, the citation points to a canonical treatment.

Results stated on this page

Experiments

Problems (7)

All problems

Papers that use this mathematics