Simple Algorithm
Machine Learning · Convergence · 30 min

Convergence Rates of Gradient Descent

Smoothness, strong convexity, condition numbers and linear rates.

How fast gradient descent converges depends entirely on what you assume about the function. This lesson proves the three classical rates (a 1/T1/T rate to stationarity for smooth nonconvex functions, 1/T1/T in value for convex ones, linear under strong convexity), shows that a 1963 condition of Polyak gives linear rates with no convexity at all, and asks how tight the bounds are and where deep learning escapes their assumptions.

What you’ll learn

  • State the smoothness, convexity, strong convexity and Polyak–Łojasiewicz conditions, and derive the inequalities each one provides.
  • Prove min⁡t<T∥∇f(xt)∥2≤2L(f(x0)−f⋆)/T\min_{t<T}\norm{\nabla f(\mathbf x_t)}^2\le2L(f(\mathbf x_0)-f^\star)/T, f(xT)−f⋆≤L∥x0−x⋆∥2/(2T)f(\mathbf x_T)-f^\star\le L\norm{\mathbf x_0-\mathbf x^\star}^2/(2T) and f(xT)−f⋆≤(1−μ/L)T(f(x0)−f⋆)f(\mathbf x_T)-f^\star\le(1-\mu/L)^T(f(\mathbf x_0)-f^\star).
  • Prove linear convergence under the Polyak–Łojasiewicz inequality, and place it among related conditions.
  • Judge how tight these rates are, using the exact worst case of gradient descent and first-order lower bounds, and recognize where neural-network training breaks the assumptions.

Function classes and what they buy

DerivationThree inequalities used in every proof below
  1. f⋆≤f(x)−12L∥∇f(x)∥2⟹∥∇f(x)∥2≤2L(f(x)−f⋆)f^\star\le f(\mathbf x)-\frac1{2L}\norm{\nabla f(\mathbf x)}^2\quad\Longrightarrow\quad\norm{\nabla f(\mathbf x)}^2\le2L\big(f(\mathbf x)-f^\star\big)

    Smoothness bounds the gradient by the gap. Apply the quadratic upper bound at y=x−∇f(x)/L\mathbf y=\mathbf x-\nabla f(\mathbf x)/L and use f⋆≤f(y)f^\star\le f(\mathbf y):

  2. f⋆ ≥ min⁡y[f(x)+∇f(x)⊤(y−x)+μ2∥y−x∥2]=f(x)−12μ∥∇f(x)∥2f^\star\ \ge\ \min_{\mathbf y}\Big[f(\mathbf x)+\nabla f(\mathbf x)^\top(\mathbf y-\mathbf x)+\frac\mu2\norm{\mathbf y-\mathbf x}^2\Big]=f(\mathbf x)-\frac1{2\mu}\norm{\nabla f(\mathbf x)}^2

    Strong convexity implies PL. Minimize the right side of the strong-convexity inequality over y\mathbf y (the minimum is at y=x−∇f(x)/μ\mathbf y=\mathbf x-\nabla f(\mathbf x)/\mu); the left side is at least f⋆f^\star for every y\mathbf y:

  3. f(x)−f⋆≥μ2∥x−x⋆∥2,∥∇f(x)∥≥μ∥x−x⋆∥f(\mathbf x)-f^\star\ge\frac\mu2\norm{\mathbf x-\mathbf x^\star}^2,\qquad\norm{\nabla f(\mathbf x)}\ge\mu\norm{\mathbf x-\mathbf x^\star}

    Strong convexity pins down the minimizer. At x⋆\mathbf x^\star the gradient vanishes, so the same inequality with x\mathbf x and y\mathbf y swapped gives quadratic growth; adding the two versions gives a lower bound on the gradient:

Together: on an LL-smooth, μ\mu-strongly convex function, μ2∥x−x⋆∥2≤f(x)−f⋆≤12μ∥∇f(x)∥2\frac{\mu}{2}\norm{\mathbf x-\mathbf x^\star}^2\le f(\mathbf x)-f^\star\le\frac1{2\mu}\norm{\nabla f(\mathbf x)}^2 and ∥∇f(x)∥2≤2L(f(x)−f⋆)\norm{\nabla f(\mathbf x)}^2\le2L(f(\mathbf x)-f^\star). Distance, suboptimality and gradient norm are all equivalent up to factors of κ\kappa, which is why the convergence rate can be stated in any of them.

Nonconvex: a 1/T rate to stationarity

DerivationProof
  1. 12L∥∇f(xt)∥2≤f(xt)−f(xt+1)\frac1{2L}\norm{\nabla f(\mathbf x_t)}^2\le f(\mathbf x_t)-f(\mathbf x_{t+1})

    The descent lemma with η=1/L\eta=1/L, for each tt:

  2. 12L∑t=0T−1∥∇f(xt)∥2≤f(x0)−f(xT)≤f(x0)−f⋆\frac1{2L}\sum_{t=0}^{T-1}\norm{\nabla f(\mathbf x_t)}^2\le f(\mathbf x_0)-f(\mathbf x_T)\le f(\mathbf x_0)-f^\star

    Sum over t=0,…,T−1t=0,\dots,T-1; the right side telescopes and f(xT)≥f⋆f(\mathbf x_T)\ge f^\star:

  3. min⁡t<T∥∇f(xt)∥2≤1T∑t<T∥∇f(xt)∥2≤2L(f(x0)−f⋆)T\min_{t<T}\norm{\nabla f(\mathbf x_t)}^2\le\frac1T\sum_{t<T}\norm{\nabla f(\mathbf x_t)}^2\le\frac{2L(f(\mathbf x_0)-f^\star)}T

    The minimum is at most the average. ■\blacksquare

Three remarks. The guarantee is about the best iterate (or a random one), not the last. A small gradient certifies a stationary point, which may be a saddle; the Convergence lesson Nonconvex Optimization & Saddle Points handles that. And the ε−2\varepsilon^{-2} cannot be improved by any first-order method without further assumptions: Carmon, Duchi, Hinder & Sidford (2020) construct LL-smooth functions in high dimension on which every algorithm, even a randomized one, needs order ε−2\varepsilon^{-2} queries to find an ε\varepsilon-stationary point (Lower Bounds & Oracle Complexity).

Predict before you look

L=1L=1 and f(x0)−f⋆=50f(\mathbf x_0)-f^\star=50. How many gradient steps with η=1/L\eta=1/L does the theorem need to guarantee some iterate with ∥∇f(xt)∥≤0.1\norm{\nabla f(\mathbf x_t)}\le0.1?

Show the answer

10000 steps

T≥2L(f(x0)−f⋆)/ε2=2⋅1⋅50/0.01=10,000T\ge2L(f(\mathbf x_0)-f^\star)/\varepsilon^2=2\cdot1\cdot50/0.01=10{,}000. Halving ε\varepsilon quadruples the count: the ε−2\varepsilon^{-2} scaling of stationarity.

Convex: the 1/T rate in function value

DerivationProof
  1. f(xt+1)−f⋆≤gt⊤(xt−x⋆)−12L∥gt∥2f(\mathbf x_{t+1})-f^\star\le\mathbf g_t^\top(\mathbf x_t-\mathbf x^\star)-\frac1{2L}\norm{\mathbf g_t}^2

    Combine the descent lemma with convexity at xt\mathbf x_t, f(xt)≤f⋆+gt⊤(xt−x⋆)f(\mathbf x_t)\le f^\star+\mathbf g_t^\top(\mathbf x_t-\mathbf x^\star), where gt=∇f(xt)\mathbf g_t=\nabla f(\mathbf x_t):

  2. gt⊤(xt−x⋆)−∥gt∥22L=L2(∥xt−x⋆∥2−∥xt+1−x⋆∥2)\mathbf g_t^\top(\mathbf x_t-\mathbf x^\star)-\frac{\norm{\mathbf g_t}^2}{2L}=\frac L2\Big(\norm{\mathbf x_t-\mathbf x^\star}^2-\norm{\mathbf x_{t+1}-\mathbf x^\star}^2\Big)

    Complete the square, using xt+1=xt−gt/L\mathbf x_{t+1}=\mathbf x_t-\mathbf g_t/L. The left side is nonnegative, so the distance to x⋆\mathbf x^\star cannot grow:

  3. ∑s=1T(f(xs)−f⋆)≤L2(∥x0−x⋆∥2−∥xT−x⋆∥2)≤L2∥x0−x⋆∥2\sum_{s=1}^{T}\big(f(\mathbf x_s)-f^\star\big)\le\frac L2\Big(\norm{\mathbf x_0-\mathbf x^\star}^2-\norm{\mathbf x_T-\mathbf x^\star}^2\Big)\le\frac L2\norm{\mathbf x_0-\mathbf x^\star}^2

    Sum over t=0,…,T−1t=0,\dots,T-1; the distances telescope:

  4. T(f(xT)−f⋆)≤∑s=1T(f(xs)−f⋆)≤L2∥x0−x⋆∥2T\big(f(\mathbf x_T)-f^\star\big)\le\sum_{s=1}^{T}\big(f(\mathbf x_s)-f^\star\big)\le\frac L2\norm{\mathbf x_0-\mathbf x^\star}^2

    The descent lemma makes f(xs)f(\mathbf x_s) nonincreasing, so the last term is the smallest, and TT copies of it are bounded by the sum. ■\blacksquare

How tight is it? For gradient descent itself, Drori & Teboulle (2014) computed the worst case exactly by posing it as an optimization problem over functions (a performance estimation problem). With step h/Lh/L, 0<h≤10<h\le1, they proved f(xN)−f⋆≤L∥x0−x⋆∥24Nh+2f(\mathbf x_N)-f^\star\le\frac{L\norm{\mathbf x_0-\mathbf x^\star}^2}{4Nh+2} and exhibited convex LL-smooth functions attaining it. So the 1/T1/T rate is real, and the textbook constant is about twice too pessimistic.

Can another method do better? Yes. Nesterov's lower bound says no first-order method can beat 3L∥x0−x⋆∥232(T+1)2\frac{3L\norm{\mathbf x_0-\mathbf x^\star}^2}{32(T+1)^2} on all smooth convex functions (for T≤(d−1)/2T\le(d-1)/2), and accelerated methods attain order 1/T21/T^2: see Momentum & Nesterov Acceleration. Gradient descent with cleverly varied steps also beats 1/T1/T: Altschuler & Parrilo (2024) showed that a recursively defined "silver" schedule of occasional long steps reaches an ε\varepsilon-minimizer in O(ε−0.7864)\order{\varepsilon^{-0.7864}} iterations, between the textbook ε−1\varepsilon^{-1} and the accelerated ε−1/2\varepsilon^{-1/2}.

Predict before you look

A convex ff has L=10L=10 and ∥x0−x⋆∥=1\norm{\mathbf x_0-\mathbf x^\star}=1. How many steps of size 1/L1/L does the textbook bound L∥x0−x⋆∥2/(2T)L\norm{\mathbf x_0-\mathbf x^\star}^2/(2T) need to guarantee f(xT)−f⋆≤0.01f(\mathbf x_T)-f^\star\le0.01?

Show the answer

500 steps

10/(2T)≤0.0110/(2T)\le0.01 gives T≥500T\ge500. Drori and Teboulle's exact worst case, 10/(4T+2)≤0.0110/(4T+2)\le0.01, needs only T≥250T\ge250 (rounding up 249.5). Either way the count grows like 1/ε1/\varepsilon: a tenfold smaller target costs ten times more steps.

Strong convexity, and PL without convexity

DerivationProof (two lines)
  1. f(xt+1)−f⋆≤f(xt)−f⋆−12L∥∇f(xt)∥2≤(1−μL)(f(xt)−f⋆)f(\mathbf x_{t+1})-f^\star\le f(\mathbf x_t)-f^\star-\frac1{2L}\norm{\nabla f(\mathbf x_t)}^2\le\Big(1-\frac\mu L\Big)\big(f(\mathbf x_t)-f^\star\big)

    Descent lemma, then PL in the form ∥∇f(xt)∥2≥2μ(f(xt)−f⋆)\norm{\nabla f(\mathbf x_t)}^2\ge2\mu(f(\mathbf x_t)-f^\star):

  2. f(xT)−f⋆≤(1−1κ)T(f(x0)−f⋆)≤e−T/κ(f(x0)−f⋆)f(\mathbf x_T)-f^\star\le\Big(1-\frac1\kappa\Big)^T\big(f(\mathbf x_0)-f^\star\big)\le e^{-T/\kappa}\big(f(\mathbf x_0)-f^\star\big)

    Iterate. Since 1−μ/L≤e−μ/L1-\mu/L\le e^{-\mu/L}, accuracy ε\varepsilon needs at most κln⁡((f(x0)−f⋆)/ε)\kappa\ln\big((f(\mathbf x_0)-f^\star)/\varepsilon\big) steps. ■\blacksquare

The proof never used convexity, only PL. PL says that the gradient is large wherever the function value is far from optimal. It forces every stationary point to be a global minimizer, yet allows nonconvex functions and non-unique minimizers:

  • f(x)=x2+3sin⁡2xf(x)=x^2+3\sin^2x is not convex (f′′=2+6cos⁡2xf''=2+6\cos2x dips to −4-4), but Karimi et al. show it satisfies PL with μ=1/32\mu=1/32, so gradient descent converges linearly from anywhere.
  • Least squares 12∥Ax−b∥2\tfrac12\norm{A\mathbf x-\mathbf b}^2 with a rank-deficient AA has a whole affine set of minimizers, so it is not strongly convex. Writing r=Ax−Pb\mathbf r=A\mathbf x-P\mathbf b, with PP the projection onto the range of AA, gives ∇f=A⊤r\nabla f=A^\top\mathbf r and f−f⋆=12∥r∥2f-f^\star=\tfrac12\norm{\mathbf r}^2; since r\mathbf r lies in the range of AA, ∥A⊤r∥≥σmin⁡+∥r∥\norm{A^\top\mathbf r}\ge\sigma_{\min}^+\norm{\mathbf r}, where σmin⁡+\sigma_{\min}^+ is the smallest nonzero singular value. So PL holds with μ=(σmin⁡+)2\mu=(\sigma_{\min}^+)^2.
  • More generally, f(x)=g(Ax)f(\mathbf x)=g(A\mathbf x) with gg smooth and μg\mu_g-strongly convex satisfies PL with μ=μg(σmin⁡+)2\mu=\mu_g(\sigma_{\min}^+)^2, whatever the rank of AA: the same projection argument applies to ∇g\nabla g.
Check your understanding

Which function satisfies the PL inequality for some μ>0\mu>0, but is not strongly convex?

  1. f(x)=x4f(x)=x^4
  2. f(x)=12∥Ax−b∥2f(\mathbf x)=\tfrac12\norm{A\mathbf x-\mathbf b}^2 with A≠0A\ne0 rank-deficient
  3. f(x)=exf(x)=e^x
  4. f(x)=∣x∣f(x)=\abs x
Show the answer

B. f(x)=12∥Ax−b∥2f(\mathbf x)=\tfrac12\norm{A\mathbf x-\mathbf b}^2 with A≠0A\ne0 rank-deficient

Its minimizers form an affine set, so it cannot be strongly convex, yet 12∥∇f∥2≥(σmin⁡+)2(f−f⋆)\tfrac12\norm{\nabla f}^2\ge(\sigma_{\min}^+)^2(f-f^\star). Gradient descent converges linearly in function value and, from x0\mathbf x_0, to the minimizer closest to x0\mathbf x_0.

Beyond the classical picture

Class (gradient descent, η=1/L\eta=1/L)RateIterations for ε\varepsilonBest first-order method
LL-smooth, bounded belowmin⁡t∥∇f∥2≤2LΔ/T\min_t\norm{\nabla f}^2\le2L\Delta/T2LΔ/ε22L\Delta/\varepsilon^2same order: Θ(ε−2)\Theta(\varepsilon^{-2}) is optimal
LL-smooth, convexL∥x0−x⋆∥2/(2T)L\norm{\mathbf x_0-\mathbf x^\star}^2/(2T)L∥x0−x⋆∥2/(2ε)L\norm{\mathbf x_0-\mathbf x^\star}^2/(2\varepsilon)O(L/ε)∥x0−x⋆∥\order{\sqrt{L/\varepsilon}}\norm{\mathbf x_0-\mathbf x^\star}, accelerated
LL-smooth, μ\mu-strongly convex or PL(1−1/κ)T(1-1/\kappa)^Tκln⁡(Δ/ε)\kappa\ln(\Delta/\varepsilon)O(κln⁡(1/ε))\order{\sqrt\kappa\ln(1/\varepsilon)}, accelerated (strongly convex)
Δ=f(x0)−f⋆\Delta=f(\mathbf x_0)-f^\star. The last column is proved in Momentum & Nesterov Acceleration and Lower Bounds & Oracle Complexity. Acceleration needs convexity: under PL alone, the classical accelerated methods have no such guarantee.

Overparameterized models. For losses with minimum 00, Liu, Zhu & Belkin (2022) introduced the PL⋆^\star condition, 12∥∇L(w)∥2≥μ L(w)\tfrac12\norm{\nabla\mathcal L(\mathbf w)}^2\ge\mu\,\mathcal L(\mathbf w), argued that overparameterized systems satisfy it on most (but not all) of their parameter space, and showed that sufficiently wide neural networks satisfy it, with high probability, in a ball of constant radius around their random initialization. That ball contains a global minimizer, which explains why (stochastic) gradient descent started at the center drives the training loss to zero. Such guarantees hold near initialization in the wide limit; whether they describe networks that learn features far from initialization is less clear.

The edge of stability. The classical theory runs gradient descent with η<2/L\eta<2/L, so that it decreases the loss monotonically. Cohen, Kaur, Li, Kolter & Talwalkar (2021) observed that full-batch gradient descent on neural networks typically does something else: the sharpness, the top eigenvalue of the Hessian, rises until it hovers just above 2/η2/\eta, and the loss decreases non-monotonically over short timescales but consistently over long ones. This edge of stability lies outside every theorem in this lesson.

Key takeaways

  • For LL-smooth ff, gradient descent with η=1/L\eta=1/L gives min⁡t<T∥∇f(xt)∥2≤2L(f(x0)−f⋆)/T\min_{t<T}\norm{\nabla f(\mathbf x_t)}^2\le2L(f(\mathbf x_0)-f^\star)/T, with no convexity; order ε−2\varepsilon^{-2} is optimal for first-order methods on this class.
  • For convex LL-smooth ff, f(xT)−f⋆≤L∥x0−x⋆∥2/(2T)f(\mathbf x_T)-f^\star\le L\norm{\mathbf x_0-\mathbf x^\star}^2/(2T), proved by combining the descent lemma, convexity and a telescoping distance argument. The exact worst case is L∥x0−x⋆∥2/(4T+2)L\norm{\mathbf x_0-\mathbf x^\star}^2/(4T+2) (Drori–Teboulle).
  • Strong convexity implies PL, and PL plus smoothness gives f(xT)−f⋆≤(1−1/κ)T(f(x0)−f⋆)f(\mathbf x_T)-f^\star\le(1-1/\kappa)^T(f(\mathbf x_0)-f^\star): about κln⁡(1/ε)\kappa\ln(1/\varepsilon) iterations.
  • PL needs no convexity: it covers x2+3sin⁡2xx^2+3\sin^2x, rank-deficient least squares and, in the PL⋆^\star form, wide neural networks near initialization.
  • Accelerated methods improve κ\kappa to κ\sqrt\kappa and 1/T1/T to 1/T21/T^2; neural-network training at the edge of stability violates the step-size assumptions behind all of these rates.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

In the convex proof, why may we bound the last iterate f(xT)f(\mathbf x_T), while the nonconvex theorem only bounds the best gradient norm?

  1. Because convex functions have no stationary points other than minimizers
  2. Because f(xt)f(\mathbf x_t) is nonincreasing under the descent lemma, while ∥∇f(xt)∥\norm{\nabla f(\mathbf x_t)} need not be monotone
  3. Because the convex rate is faster
  4. Because the last iterate of gradient descent is always the best one in every sense
Show the answer

B. Because f(xt)f(\mathbf x_t) is nonincreasing under the descent lemma, while ∥∇f(xt)∥\norm{\nabla f(\mathbf x_t)} need not be monotone

The convex proof bounds the sum of the gaps f(xs)−f⋆f(\mathbf x_s)-f^\star; since these only decrease, the last one is at most the average. In the nonconvex proof the summed quantity is ∥∇f(xt)∥2\norm{\nabla f(\mathbf x_t)}^2, which can go up and down along the path, so only the minimum (or a random iterate) inherits the bound.

Question 2

A μ\mu-strongly convex, LL-smooth ff has μ=0.01\mu=0.01 and L=1L=1. Roughly how many steps with η=1/L\eta=1/L does the guarantee (1−μ/L)T(1-\mu/L)^T need to shrink f−f⋆f-f^\star by a factor e10≈22,000e^{10}\approx22{,}000?

  1. About 10
  2. About 100
  3. About 1,000
  4. About 10,000
Show the answer

C. About 1,000

(1−0.01)T≤e−10(1-0.01)^T\le e^{-10} needs T≥10/ln⁡(1/0.99)≈995T\ge10/\ln(1/0.99)\approx995: about κln⁡(1/ε)=100×10\kappa\ln(1/\varepsilon)=100\times10. Accelerated methods would need on the order of κ×10=100\sqrt\kappa\times10=100.

Question 3

Gradient descent with a small fixed step is run on f(x)=x4f(x)=x^4 from x0=0.5x_0=0.5. How does xtx_t approach the minimizer 00?

  1. Linearly: ∣xt∣≤ρt∣x0∣\abs{x_t}\le\rho^t\abs{x_0} for some ρ<1\rho<1
  2. In finitely many steps
  3. Sublinearly, roughly like 1/t1/\sqrt t, because the curvature vanishes at the minimum
  4. It does not converge for any step size
Show the answer

C. Sublinearly, roughly like 1/t1/\sqrt t, because the curvature vanishes at the minimum

xt+1=xt(1−4ηxt2)x_{t+1}=x_t(1-4\eta x_t^2): the contraction factor tends to 1 as xt→0x_t\to0. Solving the recursion gives xt≈1/8ηtx_t\approx1/\sqrt{8\eta t}. x4x^4 is convex but neither strongly convex nor PL, so only the 1/T1/T convex bound applies.

Further reading

  • B. T. Polyak, "Gradient methods for the minimisation of functionals," USSR Computational Mathematics and Mathematical Physics 3(4), 864–878 (1963).
  • H. Karimi, J. Nutini & M. Schmidt, "Linear convergence of gradient and proximal-gradient methods under the Polyak–Łojasiewicz condition," ECML PKDD 2016, Lecture Notes in Computer Science 9851, 795–811 (2016).
  • Y. Drori & M. Teboulle, "Performance of first-order methods for smooth convex minimization: a novel approach," Mathematical Programming 145, 451–482 (2014).
  • Y. Nesterov, Lectures on Convex Optimization, 2nd ed. (Springer, 2018), chapters 1–2.
  • S. Bubeck, Convex Optimization: Algorithms and Complexity (Foundations and Trends in Machine Learning, 2015), chapter 3.