AI Knowledge Tree

Smoothness, strong convexity, and convergence rates

Use L-smoothness and strong convexity to prove sublinear and linear convergence rates.

The descent lemma says gradient descent makes progress; it does not say how fast. The speed depends on two curvature bounds: an upper bound (smoothness) that caps how large a step is safe, and a lower bound (strong convexity) that guarantees the function is not too flat. Their ratio, the condition number, sets the rate.

The two curvature bounds

ff is LL-smooth if ∇2f⪯LI\nabla^2 f \preceq L I (curvature at most LL), giving the quadratic upper bound from the previous lesson. ff is μ\mu-strongly convex if ∇2f⪰μI\nabla^2 f \succeq \mu I for some μ>0\mu > 0, equivalently

f(y)≥f(x)+∇f(x)⊤(y−x)+μ2∥y−x∥2.f(y) \ge f(x) + \nabla f(x)^\top (y - x) + \frac{\mu}{2}\lVert y - x\rVert^2.

The function is sandwiched between two quadratics: μI⪯∇2f⪯LI\mu I \preceq \nabla^2 f \preceq L I. Strong convexity forces a unique minimizer and a paraboloid-like bowl no flatter than curvature μ\mu.

The Polyak-Lojasiewicz inequality

Strong convexity implies a bound relating the suboptimality to the gradient norm. Minimizing both sides of the strong-convexity inequality over yy (the right side is a quadratic in yy, minimized at y=x−1μ∇f(x)y = x - \frac{1}{\mu}\nabla f(x)) gives

f(x⋆)≥f(x)−12μ∥∇f(x)∥2,i.e.∥∇f(x)∥2≥2μ (f(x)−f(x⋆)).f(x^\star) \ge f(x) - \frac{1}{2\mu}\lVert \nabla f(x)\rVert^2, \quad\text{i.e.}\quad \lVert \nabla f(x)\rVert^2 \ge 2\mu\,(f(x) - f(x^\star)).

A small objective gap forces a small gradient and vice versa: there are no flat near-optimal plateaus to stall on.

Linear convergence for strongly convex, smooth ff

Combine the descent lemma (with η=1/L\eta = 1/L) and the PL inequality. Let Δt=f(xt)−f(x⋆)\Delta_t = f(x_t) - f(x^\star). The descent lemma gives Δt+1≤Δt−12L∥∇f(xt)∥2\Delta_{t+1} \le \Delta_t - \frac{1}{2L}\lVert\nabla f(x_t)\rVert^2, and PL bounds the gradient term below by 2μΔt2\mu\Delta_t:

Δt+1≤Δt−2μ2LΔt=(1−μL)Δt.\Delta_{t+1} \le \Delta_t - \frac{2\mu}{2L}\Delta_t = \left(1 - \frac{\mu}{L}\right)\Delta_t.

Iterating,

f(xt)−f(x⋆)≤(1−μL)t(f(x0)−f(x⋆)).f(x_t) - f(x^\star) \le \left(1 - \frac{\mu}{L}\right)^t \big(f(x_0) - f(x^\star)\big). [1]

This is linear convergence: the gap shrinks by a constant factor each step, so reaching accuracy ε\varepsilon takes O ⁣(Lμlog⁡1ε)O\!\big(\frac{L}{\mu}\log\frac{1}{\varepsilon}\big) iterations.

The condition number

The ratio

κ=Lμ≥1\kappa = \frac{L}{\mu} \ge 1

is the condition number of the problem. It controls everything: the rate factor is 1−1/κ1 - 1/\kappa, so a well-conditioned problem (κ\kappa near 1) converges in few steps, while an ill-conditioned one (κ\kappa large) crawls because the safe step size 1/L1/L is tiny relative to the gentle curvature μ\mu along the flat directions. For a quadratic, κ\kappa is the ratio of largest to smallest Hessian eigenvalue, the same condition number from the SVD.

To feel what κ\kappa buys, count the steps to shrink the gap to ε=10−6\varepsilon = 10^{-6}, which is log⁡ε/log⁡(1−1/κ)\log\varepsilon / \log(1 - 1/\kappa) steps:

  • κ=2\kappa = 2 (nearly round bowl): factor 1−1/2=0.51 - 1/2 = 0.5, about 20 steps. The gap halves every iteration.
  • κ=10\kappa = 10: factor 0.90.9, about 131 steps.
  • κ=100\kappa = 100: factor 0.990.99, about 1375 steps.
  • κ=1000\kappa = 1000 (a ravine 1000 times steeper across than along): factor 0.9990.999, about 13800 steps.

The cost grows roughly in proportion to κ\kappa: each tenfold worsening of the conditioning multiplies the step count by about ten. The three runs in the code below (κ=2,10,100\kappa = 2, 10, 100) trace the first three rows.

Sublinear rate without strong convexity

If ff is convex and LL-smooth but not strongly convex (μ=0\mu = 0), the rate drops to

f(xt)−f(x⋆)≤L∥x0−x⋆∥22t,f(x_t) - f(x^\star) \le \frac{L\lVert x_0 - x^\star\rVert^2}{2t}, [2]

an O(1/t)O(1/t) sublinear rate. Reaching ε\varepsilon now takes O(1/ε)O(1/\varepsilon) steps, far more than the log⁡(1/ε)\log(1/\varepsilon) of the strongly convex case. The lower curvature bound is what buys the exponential speedup.

Gap to the optimum vs iteration: strongly convex, smooth problems converge linearly (a straight line on the log axis, its slope set by the condition number κ), while convexity alone gives only the much slower sublinear O(1/t) rate.
Gap to the optimum vs iteration: strongly convex, smooth problems converge linearly (a straight line on the log axis, its slope set by the condition number κ), while convexity alone gives only the much slower sublinear O(1/t) rate.

Check it on arrays

python · numpy
import numpy as np

# Quadratic with controllable conditioning: f(x) = 0.5 x^T A x, A = diag(mu, L)
def run(mu, L, steps=200):
    A = np.diag([mu, L])
    grad = lambda x: A @ x
    eta = 1.0 / L
    x = np.array([1.0, 1.0])
    gaps = []
    for _ in range(steps):
        gaps.append(0.5 * x @ A @ x)             # f(x*) = 0
        x = x - eta * grad(x)
    return np.array(gaps)

for mu, L in [(1.0, 2.0), (1.0, 10.0), (1.0, 100.0)]:
    gaps = run(mu, L)
    kappa = L / mu
    # empirical contraction factor vs predicted (1 - 1/kappa)
    ratio = (gaps[100] / gaps[50]) ** (1 / 50)
    print(f"kappa={kappa:>5.0f}: empirical factor {ratio:.4f}, "
          f"predicted <= {1 - 1/kappa:.4f}")

The per-step contraction factor stays at or below the predicted 1−1/κ1 - 1/\kappa, and worsens as the condition number grows.

Exercises

Exercise 1. A problem is LL-smooth with L=20L = 20 and μ\mu-strongly convex with μ=2\mu = 2. Compute the condition number κ\kappa, the linear-rate contraction factor 1−μ/L1 - \mu/L, and the number of steps the bound predicts to shrink the gap to ε=10−6\varepsilon = 10^{-6} of its starting value.

Solution

Step 1. The condition number is κ=L/μ=20/2=10\kappa = L/\mu = 20/2 = 10.

Step 2. Each step multiplies the gap by at most 1−μ/L=1−1/κ=1−0.1=0.91 - \mu/L = 1 - 1/\kappa = 1 - 0.1 = 0.9.

Step 3. The gap after tt steps is at most 0.9t0.9^t of the start. Set 0.9t=10−60.9^t = 10^{-6} and solve:

t=log⁡10−6log⁡0.9=−6log⁡10log⁡0.9≈−13.8155−0.10536≈131.1,t = \frac{\log 10^{-6}}{\log 0.9} = \frac{-6\log 10}{\log 0.9} \approx \frac{-13.8155}{-0.10536} \approx 131.1,

so about 131131 steps, matching the κ=10\kappa = 10 row of the lesson.

Exercise 2. Derive the PL inequality ∥∇f(x)∥2≥2μ (f(x)−f(x⋆))\lVert \nabla f(x)\rVert^2 \ge 2\mu\,(f(x) - f(x^\star)) from the strong-convexity inequality. Show each step.

Solution

Step 1. Strong convexity gives, for all yy,

f(y)≥f(x)+∇f(x)⊤(y−x)+μ2∥y−x∥2.f(y) \ge f(x) + \nabla f(x)^\top (y - x) + \frac{\mu}{2}\lVert y - x\rVert^2.

The right side is a quadratic in yy; minimizing it lower-bounds the left side's minimum, which is f(x⋆)f(x^\star).

Step 2. Minimize the right side over yy. Setting its gradient in yy to zero, ∇f(x)+μ(y−x)=0\nabla f(x) + \mu(y - x) = 0, gives the minimizer y=x−1μ∇f(x)y = x - \frac{1}{\mu}\nabla f(x).

Step 3. Substitute that yy back. The linear and quadratic terms become

∇f(x)⊤ ⁣(−1μ∇f(x))+μ2∥1μ∇f(x)∥2=−1μ∥∇f(x)∥2+12μ∥∇f(x)∥2=−12μ∥∇f(x)∥2.\nabla f(x)^\top\!\left(-\tfrac{1}{\mu}\nabla f(x)\right) + \frac{\mu}{2}\left\lVert \tfrac{1}{\mu}\nabla f(x)\right\rVert^2 = -\frac{1}{\mu}\lVert\nabla f(x)\rVert^2 + \frac{1}{2\mu}\lVert\nabla f(x)\rVert^2 = -\frac{1}{2\mu}\lVert\nabla f(x)\rVert^2.

So the minimized right side is f(x)−12μ∥∇f(x)∥2f(x) - \frac{1}{2\mu}\lVert\nabla f(x)\rVert^2.

Step 4. Since the left side's minimum is f(x⋆)f(x^\star),

f(x⋆)≥f(x)−12μ∥∇f(x)∥2,f(x^\star) \ge f(x) - \frac{1}{2\mu}\lVert\nabla f(x)\rVert^2,

and rearranging gives ∥∇f(x)∥2≥2μ (f(x)−f(x⋆))\lVert\nabla f(x)\rVert^2 \ge 2\mu\,(f(x) - f(x^\star)).

Exercise 3 (code). For the diagonal quadratic f(x)=12x⊤Axf(x) = \tfrac12 x^\top A x with A=diag(μ,L)A = \mathrm{diag}(\mu, L), μ=1\mu = 1, L=50L = 50, run gradient descent with step η=1/L\eta = 1/L from x0=(1,1)x_0 = (1, 1). Confirm the gap shrinks by no more than the predicted factor 1−1/κ1 - 1/\kappa per step, and that the bound Δt≤(1−1/κ)tΔ0\Delta_t \le (1 - 1/\kappa)^t \Delta_0 holds at t=100t = 100.

Solution
python · numpy
import numpy as np

mu, L = 1.0, 50.0
kappa = L / mu
A = np.diag([mu, L])
eta = 1.0 / L

x = np.array([1.0, 1.0])
f = lambda z: 0.5 * z @ A @ z          # f(x*) = 0, so gap = f(x)
gaps = [f(x)]
for _ in range(100):
    x = x - eta * (A @ x)
    gaps.append(f(x))
gaps = np.array(gaps)

factors = gaps[1:] / gaps[:-1]
assert np.all(factors <= (1 - 1/kappa) + 1e-9)          # per-step contraction
assert gaps[100] <= (1 - 1/kappa)**100 * gaps[0] + 1e-12  # iterated bound
print("worst per-step factor:", round(factors.max(), 4),
      " predicted bound:", round(1 - 1/kappa, 4))

Every step contracts by at most 1−1/κ=0.981 - 1/\kappa = 0.98, and the iterated bound at t=100t = 100 holds, confirming the linear rate.

The next lesson replaces the full gradient with a noisy estimate, the stochastic setting of real training.


References

  1. [1]Nesterov, Y. (2018). Lectures on Convex Optimization (2nd ed.), §2.1. Springer. Smoothness, strong convexity, and the linear rate for gradient descent.↩
  2. [2]Nocedal, J., & Wright, S. J. (2006). Numerical Optimization (2nd ed.), §3.3. Springer. Convergence rates and the role of the condition number (doi:10.1007/978-0-387-40065-5).↩