Dive into Deep Learning · §9.4
Momentum and Nesterov Accelerated Gradient
velocity recursion · effective step size · memory timescale · critical damping & √κ acceleration · Nesterov look-ahead
Motivation
Update Equations
Valley Trajectory
step 20, x1: 0.007188, x2: 0.002553
The Effective Step Size
Stability & Maximum Speedup
Because a sign-flipping mode x_t \propto (-1)^t experiences the damped step size \frac{\eta}{1+\beta}, the stability threshold \frac{\eta}{1+\beta}\lambda < 2 rises by a factor of 1 + \beta:
| Optimizer | Sign-Flipping Step Size | Stability Ceiling for Curvature \lambda | Ceiling on Valley (\lambda_{\max} = 4) | Maximum Stable Floor Step \eta_{\text{eff}} |
|---|---|---|---|---|
| Plain Gradient Descent (\beta = 0) | \eta | \eta\lambda < 2 | \eta < 0.50 | 0.50 |
| Heavy-Ball Momentum (\beta) | \frac{\eta}{1 + \beta} | \eta\lambda < 2(1 + \beta) | \eta < 0.75 (at \beta = 0.5) | \frac{2(1+\beta)}{(1-\beta)\lambda_{\max}} = 1.50 (at \beta = 0.5) |
Exponential Horizon
beta window half-life weight inside the window
0.5 2 1.0 0.75
0.9 10 6.6 0.65
0.99 100 69.0 0.63
Interaction with Stochastic Noise
Polyak’s Acceleration Law
Why Contraction Equals √β
Why do all intermediate eigenmodes contract at the exact same rate \sqrt{\beta^\star} independent of their curvature \lambda?
Critical Damping Geometry
40 Steps vs. 139 Steps
eta beta factor steps to 1% steps to 1e-6
0.476 0.000 0.905 47 139
0.600 0.500 0.707 16 42
0.668 0.403 0.635 18 40
0.300 0.800 0.894 42 126
Overshoot Hazard
step 20, x1: 0.195696, x2: -0.249649
Empirical Test on Fashion-MNIST
Our theory predicts two contrasting outcomes when comparing \beta = 0 and \beta = 0.9 on Fashion-MNIST:
FashionCNN, small batch b = 32): Optimal \eta drops by \sim 10\times (0.2 \to 0.02) to preserve \eta_{\text{eff}} = \frac{\eta}{1-\beta}, finishing at comparable step counts and losses.softmax regression beta=0.0 best lr 0.125 steps to 0.5: 625 final loss 0.472
softmax regression beta=0.9 best lr 0.4 steps to 0.5: 100 final loss 0.365
FashionCNN beta=0.0 best lr 0.2 steps to 0.3: 1550 final loss 0.293
FashionCNN beta=0.9 best lr 0.02 steps to 0.3: 1425 final loss 0.280
Anticipatory Damping
Heavy-Ball vs. Nesterov
step 20, x1: 0.217791, x2: -0.000070
Check Your Understanding
Work out the quantitative answer for each momentum scenario:
FashionCNN at b = 32?Check Your Understanding
Answers:
Key Takeaways
| Concept / Rule | Mathematical Expression | Key Property | Practical Guideline |
|---|---|---|---|
| Heavy-Ball Velocity | \mathbf{v}_t = \beta\mathbf{v}_{t-1} + \mathbf{g}_t,\; \mathbf{x}_{t+1} = \mathbf{x}_t - \eta\mathbf{v}_t | Unrolls to \sum_{k=0}^{t-1} \beta^k \mathbf{g}_{t-k} | Default \beta = 0.9; adds 1 state buffer per parameter |
| Effective Step & Window | \eta_{\text{eff}} = \frac{\eta}{1-\beta},\quad \tau = \frac{1}{1-\beta} | Damps alternating steps to \frac{\eta}{1+\beta}; ceiling \eta\lambda < 2(1+\beta) | Scale \eta \propto (1-\beta) when changing \beta under noise |
| Critical Damping & \sqrt{\kappa} | \beta_{\text{c}}(\lambda) = (1 - \sqrt{\eta\lambda})^2,\; \rho^\star = \frac{\sqrt{\kappa}-1}{\sqrt{\kappa}+1} | Complex roots for \beta \ge \beta_{\text{c}} have modulus |z| = \sqrt{\beta} | Cuts curvature-limited step complexity from O(\kappa) to O(\sqrt{\kappa}) |
| Nesterov Look-Ahead | \mathbf{v}_t = \beta\mathbf{v}_{t-1} + \nabla f(\mathbf{x}_t - \eta\beta\mathbf{v}_{t-1}) | Evaluates curvature at predicted position \tilde{\mathbf{x}}_t | Suppresses underdamped ringing; forms the base of Muon (§9.6) |