Back to AI Math Mind Map
中文·English
📐 AI MathID: gradient-descent

Gradient Descent

梯度下降
🎯Core Definition
Gradient descent minimizes a loss by iterating down the negative gradient: wt+1=wtηL(wt)w_{t+1} = w_t - \eta\nabla L(w_t). For an LL-smooth (L(w)L(w)Lww\Vert\nabla L(w) - \nabla L(w')\Vert \le L\Vert w - w'\Vert) and μ\mu-strongly convex loss with η2/L\eta \le 2/L it converges, and with a fixed step size the error decays linearly as wtw(11/κ)tw0w\Vert w_t - w^*\Vert \le (1 - 1/\kappa)^t\Vert w_0 - w^*\Vert, where κ=λmax/λmin\kappa = \lambda_{\max}/\lambda_{\min} is the Hessian condition number. Larger κ\kappa means flatter elliptical contours and slower zig-zag progress (roughly κ\kappa iterations to make one step of progress along the long axis).
💡Use Cases
the workhorse for training nearly all ML/DL models; interviews compare batch GD, stochastic GD (SGD) and mini-batch. SGD estimates the gradient from one random sample, gt=Lit(wt)g_t = \nabla L_{i_t}(w_t), which is an unbiased estimator of the full gradient since E[gt]=1ni=1nLi(wt)=L(wt)\mathbb{E}[g_t] = \frac{1}{n}\sum_{i=1}^{n}\nabla L_i(w_t) = \nabla L(w_t); a mini-batch of size BB reduces the variance to 1/B1/B of the single-sample variance (i.i.d. samples, Var[g^]=Var[g]/B\mathrm{Var}[\hat g] = \mathrm{Var}[g]/B) but leaves a noise ball: under strong convexity SGD settles in ww2ησ22μ\Vert w - w^*\Vert^2 \le \frac{\eta\sigma^2}{2\mu} and never hits the optimum exactly.
Key Problems Solved
unlike closed-form solutions (e.g. the normal equation's O(d3)O(d^3) matrix inversion), GD needs only first-order information and O(d)O(d) memory, scaling to millions of parameters; going from κ=10\kappa=10 to κ=1000\kappa=1000 costs roughly two orders of magnitude more iterations — the fundamental motivation for momentum, adaptive (Adam) and second-order (Newton) methods.
🎯5 High-Frequency Exam Points
1
Write the GD update wt+1=wtηL(wt)w_{t+1} = w_t - \eta\nabla L(w_t) and derive the step-size bound η2/L\eta \le 2/L for an LL-smooth convex loss?
2
How does the condition number κ=λmax/λmin\kappa = \lambda_{\max}/\lambda_{\min} set the convergence rate (11/κ)t(1 - 1/\kappa)^t? Why do ill-conditioned quadratics zig-zag?
3
Prove SGD's gradient is an unbiased estimate of the full gradient, E[gt]=L(wt)\mathbb{E}[g_t] = \nabla L(w_t); by what factor does mini-batching cut the variance?
4
Why does SGD hover around a noise ball — where does ησ22μ\frac{\eta\sigma^2}{2\mu} come from, and how does it depend on the learning rate and batch size?
5
What happens with too-large or too-small learning rates? Why does momentum vt=βvt1+(1β)Lv_t = \beta v_{t-1} + (1-\beta)\nabla L damp zig-zag oscillation?
Updated 2026-08-12
🎯
Test Your Knowledge: Practice Questions for "Gradient Descent"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardBootstrapNext CardMatrix Calculus & Softmax Gradient

🔗 More AI Math Knowledge Cards

Adam/AdamW MathBayesian InferenceBias-Variance DecompositionCausal Inference (Rubin)