Let f:Rd→R be convex with minimiser x∗, and suppose stochastic gradients gt satisfy E[gt∣xt]=∇f(xt) and E[∥gt∥22∣xt]≤G2. How do you prove that SGD with fixed step size η satisfies E[f(xˉT)−f(x∗)]≤∥x0−x∗∥222ηT+ηG22 for xˉT=1T∑t=0T−1xt, and what step size gives the optimal O(1/T) rate?

Linear algebra and optimisation, Convergence analysis
Level L5 Expert. Length Long. Nature Mat Mathematical.

What's being asked

Whether you can prove the standard O(1/T) convex SGD bound by expanding ∥xt+1−x∗∥22, taking conditional expectations, telescoping, and applying Jensen's inequality.

Key idea

Unlike deterministic GD, f(xt) need not decrease monotonically, so we track expected squared distance to x∗ instead. Expanding ∥xt+1−x∗∥22 cleanly splits the bias-reduction term (via convexity) from the variance term η2G2, and averaging the iterates lets us apply Jensen's inequality at the end.

Steps

  1. Expand one SGD step xt+1=xt−ηgt: ∥xt+1−x∗∥22=∥xt−x∗∥22−2η gt⊤(xt−x∗)+η2∥gt∥22.
  2. Take conditional expectation given xt, using E[gt∣xt]=∇f(xt) and E[∥gt∥22∣xt]≤G2: E[∥xt+1−x∗∥22∣xt]≤∥xt−x∗∥22−2η ∇f(xt)⊤(xt−x∗)+η2G2.
  3. Use convexity: f(x∗)≥f(xt)+∇f(xt)⊤(x∗−xt), so −∇f(xt)⊤(xt−x∗)≤f(x∗)−f(xt). Taking total expectation and rearranging gives 2η E[f(xt)−f(x∗)]≤E[∥xt−x∗∥22]−E[∥xt+1−x∗∥22]+η2G2.
  4. Sum over t=0,…,T−1 so the distance terms telescope, drop −E[∥xT−x∗∥22]≤0, and divide by 2ηT: 1T∑t=0T−1E[f(xt)−f(x∗)]≤∥x0−x∗∥222ηT+ηG22.
  5. Apply Jensen's inequality to the convex function f: f(xˉT)=f(1T∑t=0T−1xt)≤1T∑t=0T−1f(xt), giving the stated bound on E[f(xˉT)−f(x∗)].
  6. Choose η to balance both terms: setting ∥x0−x∗∥222ηT=ηG22 gives η=∥x0−x∗∥2GT and the optimal bound E[f(xˉT)−f(x∗)]≤G∥x0−x∗∥2T=O(1/T).

Common mistakes

How long your answer should be

One page; 8–10 minutes.

Last checked on 4 December 2026.

Read this

Previous in Linear algebra and optimisation: Let f:Rd→R be μ-strongly convex and L-smooth with unique minimiser x∗. How do you prove that gradient descent with step size η=1/L achieves linear convergence ∥xt−x∗∥22≤(1−μL)t∥x0−x∗∥22?
Next in Linear algebra and optimisation: For a differentiable convex optimisation problem min⁡xf0(x) subject to fi(x)≤0 (fi convex) and hj(x)=aj⊤x−bj=0 (affine), how do you prove that any point (x∗,λ∗,ν∗) satisfying the KKT conditions is globally primal-dual optimal and achieves zero duality gap?