← 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′)∥≤L∥w−w′∥\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 ∥wt−w∗∥≤(1−1/κ)t∥w0−w∗∥\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]=1n∑i=1n∇Li(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 ∥w−w∗∥2≤ησ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.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Gradient Descent.
Use Cases
In production engineering, what are the primary use cases for Gradient Descent and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
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 (1−1/κ)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=βvt−1+(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 Card →Matrix Calculus & Softmax Gradient

🔗 More AI Math Knowledge Cards

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