Understanding the Role of Momentum in Stochastic Gradient Methods

Igor Gitman, Hunter Lang, Pengchuan Zhang, Lin Xiao

Abstract

This paper provides a unified theoretical analysis of momentum in stochastic gradient methods using the Quasi-Hyperbolic Momentum (QHM) framework. By analyzing asymptotic convergence, local convergence rates, and stationary distributions, the authors uncover counter-intuitive practical guidelines—most notably, why setting the learning rate as small as possible (rather than as large as possible) can sometimes improve final loss without slowing down training.

Introduction

Adding momentum to Stochastic Gradient Descent (SGD) is standard practice to accelerate training, with popular variants including Polyak’s Heavy Ball (SHB) and Nesterov’s Accelerated Gradient (NAG). Despite their widespread use, there is a lack of rigorous understanding of how momentum parameters and learning rates interact to affect convergence speed and final loss. Practitioners often rely on heuristics, such as setting momentum to 0.9 and finding the largest stable learning rate. This paper aims to provide mathematically grounded guidelines by analyzing a generalized momentum framework.

Methodology: The QHM Framework

The authors utilize Quasi-Hyperbolic Momentum (QHM) as an analytical lens. QHM introduces a parameter $\nu \in [0, 1]$ to interpolate between standard SGD ($\nu=0$) and Stochastic Heavy Ball ($\nu=1$). By adjusting $\nu$ and the standard momentum parameter $\beta$, QHM can recover NAG and other popular variants. The analysis covers three domains:

  1. Asymptotic Convergence: Proving stationary point discovery for smooth, non-convex functions.
  2. Local Convergence Rate & Stability: Modeling deterministic dynamics on convex quadratic functions to determine stability regions and convergence speed.
  3. Stationary Distribution Analysis: Modeling the algorithm as a linear dynamical system to calculate the variance of iterates, measuring the "achievable loss" due to stochastic noise.

Key Insights and Results

The Complexity of Momentum

Intuition suggests the total momentum is simply $\nu \times \beta$. However, the authors identified three distinct phases of behavior. As shown in Figure 1, if $\beta$ becomes sufficiently large, one must actually increase $\nu$ and the learning rate $\alpha$ to maintain optimal convergence, breaking simple linear intuition.

Convergence rates and optimal parameter settings across different condition numbers (\kappa).

The "No Trade-off" Regime

Typically, a larger learning rate yields faster convergence but higher final loss. However, the authors identified a regime for Heavy Ball ($\nu=1$) where the convergence rate becomes independent of the learning rate $\alpha$. In this regime, $\alpha$ can be reduced to shrink the final loss without penalizing convergence speed.

Stationary Distribution and Final Loss

By expanding stationary distribution equations to the second order, the authors demonstrated that pushing $\beta \to 1$ can decrease achievable loss for Heavy Ball and NAG. Figure 2 illustrates the stationary distribution of iterates, representing the noise floor at the end of training.

Stationary distribution of iterates under specific QHM parameters, illustrating the noise floor near the minimum.

Empirical Validation

Theoretical claims were validated on synthetic 2D quadratic functions, MNIST (logistic regression), and CIFAR-10 (ResNet-18). A key finding debunked the common heuristic of maximizing $\alpha$ with $\beta \approx 1$. Instead, the results suggest setting $\alpha$ as small as possible until convergence slows, yielding superior final loss.

Conclusion and Future Work

While the analysis provides a powerful new perspective, it relies on Taylor expansions that may lose accuracy as $\beta$ and $\nu$ approach 1. Furthermore, the focus remains on training loss rather than generalization. Future work will explore higher-order expansions to better capture the high-momentum regime and investigate the relationship between these optimization dynamics and generalization performance.

Summary updated

BibTeX
@inproceedings{gitman2019understanding,
  author = {Igor Gitman and Hunter Lang and Pengchuan Zhang and Lin Xiao},
  title = {{Understanding the Role of Momentum in Stochastic Gradient Methods}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=HnMZwm88ag5},
}
Figure