What is the Long-Run Distribution of Stochastic Gradient Descent? A Large Deviations Analysis

Waïss Azizian, Franck Iutzeler, Jerome Malick, Panayotis Mertikopoulos

Abstract

Stochastic Gradient Descent (SGD) is the undisputed workhorse of modern machine learning, yet a complete global picture of its long-term behavior in non-convex landscapes has remained elusive. This paper provides a rigorous theoretical framework using Large Deviations Theory (LDT) to characterize where SGD "lives" in the long run. We prove that SGD’s stationary distribution follows a Boltzmann–Gibbs distribution where the step-size acts as "temperature" and the "energy" is determined by both the objective function and the statistics of the gradient noise. Our results quantify the exponential preference SGD has for certain local minima and provide an "avoidance principle" for saddle points.

Introduction

While it is well-known that SGD is effective at escaping saddle points and finding local minima, quantifying the relative time spent in different regions of the state space is a significant challenge. Previous attempts using diffusion approximations often fail to capture the discrete-time reality of SGD as the step-size approaches zero. This work utilizes Freidlin–Wentzell theory to establish a global, quantitative hierarchy of the regions SGD visits over an infinite horizon.

Methodology

The authors define a mathematical "cost" (action functional) for SGD to deviate from deterministic gradient flow. By calculating the "quasi-potential"—the minimum cost to travel between connected components of critical points—they treat these components as nodes in a weighted directed graph. The "energy" of each component is then derived from the minimum weight spanning tree pointing to that node. This approach bridges the gap between discrete-time systems and continuous-time Large Deviations Theory.

Experimental Validation

To provide a "sanity check" for the theoretical predictions, the authors apply their framework to the Himmelblau Function, a standard multi-modal test function.

Visualization of SGD dynamics and critical points on the Himmelblau function.

The visualization demonstrates how SGD iterates interact with various critical points ($K_1$ through $K_9$) and how the stationary distribution (bottom right) concentrates around the lowest energy states. The authors also show how their assumptions map onto Regularized Empirical Risk Minimization (ERM) problems common in machine learning.

Key Insights

  • Thermodynamics of SGD: The paper rigorously proves that SGD behaves like a physical system in equilibrium. The step-size $\eta$ is analogous to temperature: higher $\eta$ allows exploration of higher-energy states, while lower $\eta$ forces the system into the "ground state."
  • Noise-Dependent Energy: The "energy" of a state incorporates the statistics of the gradient noise, not just the loss value. This explains SGD's preference for "flatter" minima, as noise structure can make them lower-energy states in the transition graph.
  • Exponential Dominance: The preference for minimizers over saddles is exponential. As the step-size $\eta \to 0$, the probability of finding SGD iterates anywhere except the "ground state" (the set of components with absolute minimum energy) vanishes.

Results

The study yields several key theoretical results:

  1. Boltzmann-Gibbs Distribution: The probability of observing SGD near a critical component $K_i$ is approximately proportional to $\exp(-E_i / \eta)$.
  2. Saddle Point Avoidance: A new "avoidance principle" shows that saddle points and maximizers are exponentially dominated by local minimizers.
  3. Gaussian Noise Simplification: In the case of Gaussian noise with variance $\sigma^2$, the energy simplifies to $E_i = 2f_i / \sigma^2$, where $f_i$ is the objective value.

Limitations and Future Work

While the theory is robust, calculating energy levels for high-dimensional neural networks is currently computationally intractable. Additionally, the analysis focuses on a constant step-size and unconstrained domains. Future work could extend these results to vanishing step-size schedules or constrained optimization problems, such as those involving batch normalization.

Summary updated

BibTeX
@inproceedings{azizian2024what,
  author = {Waïss Azizian and Franck Iutzeler and Jerome Malick and Panayotis Mertikopoulos},
  title = {{What is the Long-Run Distribution of Stochastic Gradient Descent? A Large Deviations Analysis}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=vsOF7qDNhl},
}
Figure