All notes / Mathematics of machine learning

Gradient Descent: What Converges, and How Fast?

Stationarity, convex rates, and stochastic gradients

Will Gao · March 2025

Contents
  1. 1 Gradient descent for smooth functions
  2. 2 The convex case
  3. 3 The strongly convex case
  4. 4 Stochastic gradient descent
  5. 4.1 Step-size consequences

These notes are adapted from Prof. Alexis Drouot's MATH 480 course at the University of Washington, Seattle (Winter 2025). They are my own notes, not official course materials. I have done my best to ensure correctness, but errors may remain.

The goal is to collect a few basic convergence guarantees for gradient descent under progressively stronger assumptions, and then to see what changes when exact gradients are replaced by stochastic ones. We begin with smooth, possibly nonconvex objectives, then add convexity and strong convexity, and finish with a standard stationarity bound for stochastic gradient descent.

1Gradient descent for smooth functions

We seek to solve

minxRdf(x),fC2(Rd;R),

starting from x0Rd and applying the fixed-step iteration

xk+1=xkαf(xk),
(1)

where α>0 is small. Under suitable assumptions, the gradient norms converge to zero.

Definition 1.1 (Smoothness). A differentiable function f:RdR is L-smooth if
f(x)f(y)Lxyfor all x,yRd.
Equivalently, its gradient is L-Lipschitz. If fC2(Rd), the bound 2f(x)opL for all x implies that f is L-smooth.

Assume throughout this section that f is L-smooth. In the C2 setting above, a sufficient condition is

LI2f(x)LIfor every xRd,
(2)

where, for symmetric matrices, AB means hAhhBh for every hRd.

Lemma 1.2 (Descent lemma). If f is differentiable and L-smooth, then, for every x,yRd,
|f(y)f(x)f(x)(yx)|L2yx2.
(3)
In particular,
f(y)f(x)+f(x)(yx)+L2yx2.
Proof. Let d=yx. By the fundamental theorem of calculus,
f(y)f(x)f(x)d=01(f(x+td)f(x))ddt.
Using Cauchy–Schwarz and L-smoothness,
|f(y)f(x)f(x)d|01Ltd2dt=L2d2,
which is (3).
Theorem 1.3 (Stationarity rate). Let f=infxf(x)>, and suppose f is L-smooth. For a fixed step size 0<α1/L, the iterates in (1) satisfy, for every integer K1,
min0kK1f(xk)22(f(x0)f)αK.
(4)
Moreover, f(xk)0 as k.
Proof. Apply Lemma 1.2 with y=xk+1=xkαf(xk):
f(xk+1)f(xk)αf(xk)2+Lα22f(xk)2=f(xk)α(1Lα2)f(xk)2f(xk)α2f(xk)2.
Hence
α2k=0K1f(xk)2f(x0)f(xK)f(x0)f.
Since the minimum is at most the average, (4) follows. Letting K shows that the nonnegative series kf(xk)2 is finite, so its terms tend to zero.

The conclusion above guarantees convergence to first-order stationarity, but a critical point need not be a global minimizer. Convexity supplies that missing implication.

2The convex case

Definition 2.1. A function f:RdR is convex if, for all x,yRd and θ[0,1],
f(θx+(1θ)y)θf(x)+(1θ)f(y).
Lemma 2.2 (First-order characterization). If f is differentiable and convex, then, for every x,yRd,
f(y)f(x)+f(x)(yx).
(5)
Thus a differentiable convex function lies above each of its tangent hyperplanes.
Proof. For θ(0,1), convexity gives
f(x+θ(yx))(1θ)f(x)+θf(y).
Rearranging,
f(x+θ(yx))f(x)θf(y)f(x).
Letting θ0 yields f(x)(yx)f(y)f(x).

In particular, if f(x)=0, then (5) implies f(y)f(x) for every y, so x is a global minimizer.

Theorem 2.3 (Function-value rate for convex objectives). Suppose f is convex, differentiable, and L-smooth, and assume a minimizer xargminf exists. With 0<α1/L, gradient descent satisfies
f(xK)fx0x22αK,K1,
(6)
where f=f(x).
Proof. The previous descent estimate gives
f(xk+1)f(xk)α2f(xk)2.
(7)
Let dk=xxk. Since dk+1=dk+αf(xk),
f(xk)dk=dk+12dk22αα2f(xk)2.
By Lemma 2.2, f(xk)ff(xk)dk. Combining this with (7) gives
f(xk+1)fdk2dk+122α.
Summing from k=0 to K1 yields
k=0K1(f(xk+1)f)d02dK22αd022α.
The values f(xk) are nonincreasing by (7); hence the left side is at least K(f(xK)f), proving (6).

Thus K=O(ε1) iterations suffice to ensure f(xK)fε.

3The strongly convex case

Definition 3.1. A differentiable function f:RdR is μ-strongly convex, for μ>0, if
f(y)f(x)+f(x)(yx)+μ2yx2for all x,yRd.
(8)

The factor 1/2 is the standard normalization. Under this convention, f is μ-strongly convex exactly when xf(x)(μ/2)x2 is convex. If fC2, this is equivalent to 2f(x)μI for all x. If f is also L-smooth, then necessarily 0<μL.

Lemma 3.2 (Existence and uniqueness of the minimizer). A continuously differentiable, strongly convex function on Rd has a unique minimizer x.
Proof. Set x=0 in (8):
f(y)f(0)+f(0)y+μ2y2.
The quadratic term dominates the linear term as y, so f(y); that is, f is coercive. A continuous coercive function on Rd attains its minimum. Strong convexity implies strict convexity, so two distinct minimizers cannot exist.
Lemma 3.3 (Gradient domination). If f is μ-strongly convex and x is its minimizer, then
12f(x)2μ(f(x)f)for every xRd.
(9)
Proof. Taking the infimum in y on the right side of (8),
finfy{f(x)+f(x)(yx)+μ2yx2}=f(x)12μf(x)2,
where the quadratic is minimized at y=xμ1f(x). Rearrangement gives (9).
Theorem 3.4 (Linear convergence). Suppose f is μ-strongly convex and L-smooth. If 0<α1/L, then gradient descent satisfies
f(xK)f(1αμ)K(f(x0)f).
(10)
If 0<αμ<1 and 0<ε<f(x0)f, it therefore suffices to take
Klog((f(x0)f)/ε)log(1αμ)
(11)
to guarantee f(xK)fε. Thus the iteration complexity is O(log(1/ε)) for fixed α and μ. In the endpoint case αμ=1, (10) already gives f(x1)=f.
Proof. By (7) and Lemma 3.3,
f(xk+1)ff(xk)fα2f(xk)2(1αμ)(f(xk)f).
Iterating proves (10); solving the resulting geometric bound for K proves (11).

4Stochastic gradient descent

Large-data objectives often have the finite-sum form

f(a)=1Nj=1Nfj(a),
(12)

where fj is the loss associated with the jth data point. Computing the full gradient may be expensive. Stochastic gradient descent (SGD) instead uses

ak+1=akαkfJk(ak),
(13)

where, conditional on the past, Jk is sampled uniformly from {1,,N}. If Fk denotes the information available before drawing Jk, then

E[fJk(ak)Fk]=f(ak).
(14)
Lemma 4.1 (First and second moments). For uniform sampling and any fixed a,
EJ[f(a)fJ(a)]=f(a)2,
(15)
EJ[fJ(a)2]=f(a)2+EJ[fJ(a)f(a)2].
(16)
Proof. By (12), EJ[fJ(a)]=N1j=1Nfj(a)=f(a), which gives (15). Equation (16) is the vector-valued bias–variance identity EG2=EG2+EGEG2.

The variance term generally depends on the current iterate. For a uniform theorem, assume that there exists σ0 such that, almost surely,

E[fJk(ak)f(ak)2|Fk]σ2for every k.
(17)
Theorem 4.2 (Expected stationarity bound for SGD). Assume f is L-smooth and bounded below by f, the stochastic gradients are conditionally unbiased as in (14), and (17) holds. If 0<αk1/L, then, for every K1,
min0kK1Ef(ak)22(f(a0)Ef(aK))+Lσ2k=0K1αk2k=0K1αk2(f(a0)f)+Lσ2k=0K1αk2k=0K1αk.
(18)
Proof. The descent lemma and (13) give
f(ak+1)f(ak)αkf(ak)fJk(ak)+Lαk22fJk(ak)2.
Take conditional expectation and apply Lemma 4.1 together with (17):
E[f(ak+1)Fk]f(ak)αkf(ak)2+Lαk22(f(ak)2+σ2)f(ak)αk2f(ak)2+Lαk2σ22.
After taking full expectation and summing from k=0 to K1,
k=0K1αkEf(ak)22(f(a0)Ef(aK))+Lσ2k=0K1αk2.
Dividing by k=0K1αk and using that a minimum is no larger than the corresponding weighted average proves (18).

4.1Step-size consequences

For a constant step αk=α1/L, Theorem 4.2 becomes

min0kK1Ef(ak)22(f(a0)f)αK+Lασ2.

The second term is the noise floor. Choosing α on the order of K1/2 balances the two terms and yields an O(K1/2) stationarity bound. More generally, if

k=0αk=,k=0αk2<,

then the bound in (18) forces the weighted average of the expected squared gradient norms to vanish asymptotically. In particular,

lim infkEf(ak)2=0.