Knowing that gradient descent works gets you an import statement. Knowing why it works — curvature, conditioning, step sizes — is what makes you stand out in AI/ML. Roll a ball down three real loss surfaces and watch the math misbehave.
| Converge | η < 2/λmax (largest curvature): steps shrink, L → minimum smoothly. |
| Oscillate | η near the stability limit: the ball ping-pongs across steep walls while creeping along shallow ones — the classic ill-conditioning picture. |
| Diverge | η > 2/λmax: each step overshoots by more than it corrects; L blows up. On a quadratic this bound is exact — provable, not folklore. |
For L(θ) = ½θᵀAθ (A symmetric positive-definite), one GD step gives θ⁺ = (I − ηA)θ. Errors shrink iff every eigenvalue of (I − ηA) has magnitude < 1, i.e. |1 − ηλᵢ| < 1 for all i, which rearranges to 0 < η < 2/λmax. The slowest mode contracts by factor (1 − ηλmin) — so the iteration count scales with the condition number κ = λmax/λmin. Try the Bowl surface (κ = 4): the shallow x-axis is always the last to settle. This one derivation explains learning-rate warmup, why normalization layers help (they improve conditioning), and why Adam rescales per-coordinate.
Batch GD (shown here) uses the exact gradient — deterministic, but each step costs a full pass over the data. SGD estimates ∇L from one sample: unbiased (E[ĝ] = ∇L) but noisy; the noise acts like temperature, helping escape saddles and sharp minima. Mini-batch (the practical default, 32–512 samples) trades variance ∝ 1/batch for hardware parallelism. Classic Robbins–Monro conditions for SGD convergence: Σηt = ∞ and Σηt² < ∞ — the reason learning-rate schedules decay over time rather than staying constant.