Stochastic Gradient Descent › SGD with Nesterov Momentum
Language AI HandbookAll chapters Stochastic Gradient Descent › SGD with Nesterov MomentumOne section · Sections in this chapter8 / 16 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
The chapter on Momentum will cover momentum in depth, but Nesterov momentum is closely enough tied to SGD that we introduce it here. Standard SGD with momentum maintains a velocity vector that accumulates past gradients:
where:
- : the velocity vector at step (initialized to zero)
- : the momentum coefficient, controlling how much past gradients influence the current step (typically 0.9)
- : the learning rate
- : the gradient evaluated at the current position
Momentum accumulates gradient directions over time, which helps SGD move faster in directions with consistent gradients and slows updates in directions where the gradient oscillates.
Nesterov momentum makes one key improvement: instead of computing the gradient at the current position , it computes the gradient at a "lookahead" position :
where:
- : the "lookahead" position, approximately where we will be after applying the accumulated momentum
- : the gradient evaluated at the lookahead position, not at
Intuitively, Nesterov momentum first takes a step in the direction of the accumulated velocity, then computes the gradient at the resulting position, and corrects the step based on the resulting position. This "correct then move" approach is more responsive to changes in the gradient landscape than standard momentum's "move then correct" approach.
In practice, Nesterov momentum tends to converge faster and with better stability than standard momentum on convex problems. For non-convex neural networks, the empirical differences are smaller but Nesterov is still generally preferred. PyTorch's SGD implementation supports Nesterov momentum via the nesterov=True parameter.