4.10.20Advanced Topics (Elite Level)

Gradient descent and variants — convergence analysis

1,811 words8 min readdifficulty · medium6 backlinks

WHAT is gradient descent?

WHY this direction? Among all unit directions uu, the directional derivative is f(x)u\nabla f(x)^\top u, which by Cauchy–Schwarz is minimized when u=f(x)/f(x)u = -\nabla f(x)/\|\nabla f(x)\|. So f-\nabla f is the direction of steepest descent.


The two key assumptions (WHY we need them)

To prove anything, we need to control how "wild" ff can be.

The ratio κ=L/μ1\kappa = L/\mu \ge 1 is the condition number — it controls everything.


The Descent Lemma (the engine of ALL proofs)

WHAT it means: ff is sandwiched above by a parabola. We minimize that parabola each step.


Convergence for smooth (convex) functions

So with η=1/L\eta=1/L the loss always decreases (never diverges) — that's why 1/L1/L is the magic step size.


Convergence for strongly convex + smooth: linear rate

Figure — Gradient descent and variants — convergence analysis

Variants and their rates (the 80/20 table)

Method Step / idea Rate (strongly convex)
GD full gradient, η=2/(μ+L)\eta=2/(\mu+L) (κ1κ+1)k\left(\frac{\kappa-1}{\kappa+1}\right)^k
Heavy-ball / Momentum add β(xkxk1)\beta(x_k-x_{k-1}) (κ1κ+1)k\left(\frac{\sqrt\kappa-1}{\sqrt\kappa+1}\right)^k
Nesterov accelerated GD lookahead gradient O ⁣((11κ)k)O\!\left(\big(1-\tfrac1{\sqrt\kappa}\big)^k\right); O(1/k2)O(1/k^2) convex
SGD stochastic gradient (one sample) O(1/k)O(1/k), needs ηk0\eta_k\to0

SGD — why noise forces a shrinking step


Worked examples


Common mistakes


Recall Feynman: explain to a 12-year-old

Imagine rolling a ball down a hill in thick fog. You can only feel the slope under your feet, so you step the steepest way down and repeat. If your steps are too big you'll fly across the valley and bounce up the other side (diverge). If they're "just right" you slide smoothly to the bottom. A long thin valley is annoying — you zig-zag — unless you keep a bit of momentum like a real rolling ball, which smooths the path. Bumpy fog (noisy slope readings = SGD) means you must take smaller and smaller steps near the bottom or you'll keep jittering around it.


Flashcards

What is the gradient descent update rule?
xk+1=xkηf(xk)x_{k+1}=x_k-\eta\nabla f(x_k)
Why is f-\nabla f the steepest descent direction?
By Cauchy–Schwarz, fu\nabla f^\top u is minimized over unit uu at u=f/fu=-\nabla f/\|\nabla f\|.
Define LL-smoothness.
f(x)f(y)Lxy\|\nabla f(x)-\nabla f(y)\|\le L\|x-y\|, i.e. 2fLI\nabla^2 f\preceq LI.
Define μ\mu-strong convexity.
2fμI\nabla^2 f\succeq \mu I with μ>0\mu>0.
State the descent lemma.
f(y)f(x)+f(x)(yx)+L2yx2f(y)\le f(x)+\nabla f(x)^\top(y-x)+\tfrac{L}{2}\|y-x\|^2.
With η=1/L\eta=1/L, what guaranteed per-step decrease holds?
f(xk+1)f(xk)12Lf(xk)2f(x_{k+1})\le f(x_k)-\tfrac1{2L}\|\nabla f(x_k)\|^2.
GD convergence rate for smooth convex ff?
f(xk)fLx0x22k=O(1/k)f(x_k)-f^\star\le \tfrac{L\|x_0-x^\star\|^2}{2k}=O(1/k).
Optimal step size for strongly convex quadratics?
η=2/(μ+L)\eta^\star=2/(\mu+L).
Best contraction factor of GD (strongly convex)?
ρ=κ1κ+1=LμL+μ\rho^\star=\frac{\kappa-1}{\kappa+1}=\frac{L-\mu}{L+\mu}.
Range of η\eta for GD to converge on quadratics?
0<η<2/L0<\eta<2/L.
How does momentum improve the rate?
Replaces κ\kappa by κ\sqrt\kappa: factor κ1κ+1\frac{\sqrt\kappa-1}{\sqrt\kappa+1}.
Nesterov's rate for smooth convex (non-strong) ff?
O(1/k2)O(1/k^2).
Why must SGD use a decaying step size?
Constant η\eta leaves residual noise ησ2\propto\eta\sigma^2; need ηk=, ηk2<\sum\eta_k=\infty,\ \sum\eta_k^2<\infty.
What is the condition number κ\kappa?
κ=L/μ1\kappa=L/\mu\ge1; large κ\kappa ⇒ slow GD.

Connections

Concept Map

uses

justified by

has

proves

derived via

plug in GD step

choose eta = 1/L

sum plus convexity

combined with LS

controls

set to 1/L ensures

Gradient descent step

Steepest descent -grad f

Cauchy-Schwarz

Step size eta

L-smoothness

Descent Lemma

FTC plus Lipschitz

One-step decrease

Guaranteed drop

O of 1/k rate

mu-strong convexity

Condition number kappa = L/mu

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Socho ek foggy pahaadi par tum khade ho aur sabse neeche jaana hai. Door tak dikh nahi raha, par paer ke neeche slope feel kar sakte ho — wahi f-\nabla f direction hai, sabse steep downhill. Gradient descent bas yahi karta hai: har step me steepest downhill jao, dobara slope naapo, repeat. Pura convergence theory sirf ek sawaal ka jawaab hai — step kitna bada lein aur neeche pahunchne me kitna time lagega?

Do cheezein crucial hain. LL-smoothness matlab gradient zyada tezi se nahi badalta (curvature upar se bounded), isi se "descent lemma" milta hai jo function ko ek parabola ke neeche sandwich kar deta hai. Agar η=1/L\eta=1/L lo to har step me loss guaranteed kam hoga — kabhi diverge nahi karega. Doosra, μ\mu-strong convexity matlab function neeche se bhi parabola jaisa curve karta hai; tabhi linear (geometric) speed milti hai, factor κ1κ+1\frac{\kappa-1}{\kappa+1} ke saath, jahaan κ=L/μ\kappa=L/\mu condition number hai.

Sabse bada practical point: agar κ\kappa bada hai (lambi patli valley), GD zig-zag karta hai aur bahut slow chalta hai — diagram me red path dekho. Yahin momentum kaam aata hai: woh back-and-forth ko average kar deta hai aur κ\kappa ko κ\sqrt\kappa bana deta hai — yaani kaafi tez. Aur agar learning rate 2/L2/L se bada le liya, to GD bahar ki taraf bounce karke diverge ho jaata hai — isliye "bigger = faster" galat hai.

SGD me gradient noisy hota hai (ek sample se estimate). Constant step lo to bottom ke paas jitter karta rahega kyunki noise kabhi khatam nahi hota. Isliye step size ko dheere-dheere ghatana padta hai (ηk0\eta_k\to0, jaise 1/k1/k), tabhi exact minimum tak pahunchta hai. Yeh sab ML training me directly use hota hai — isiliye yeh chapter elite-level zaroori hai.

Go deeper — visual, from zero

Test yourself — Advanced Topics (Elite Level)

Connections