SGD as Equilibrium Thermodynamics: A Large Deviations Analysis of the Long-Run Distribution

What is the long-run distribution of stochastic gradient descent? A large deviations analysis

2024-01-01
Waïss Azizian, Franck Iutzeler, Jérôme Malick, Panayotis Mertikopoulos
Summary
Problem
Method
Results
Takeaways
Abstract

This paper presents a rigorous characterization of the long-run distribution of Stochastic Gradient Descent (SGD) in non-convex landscapes using the theory of Large Deviations and Freidlin-Wentzell perturbed dynamical systems. It proves that the stationary distribution of SGD iterates concentrates exponentially around critical points, resembling a Boltzmann-Gibbs distribution where the step-size acts as the system's temperature and "energy levels" are determined by both the objective function and noise statistics.

TL;DR

Why does Stochastic Gradient Descent (SGD) find "good" minima in the messy, high-dimensional landscapes of deep learning? This paper provides a definitive answer by treating SGD iterates through the lens of Large Deviation Theory. It proves that SGD behaves like a physical system reaching a Boltzmann-Gibbs equilibrium, where the step-size is the temperature and the final destination depends heavily on the "flatness" of the landscape and the statistics of the noise.

The Problem: The Mystery of the "Long Run"

Standard optimization theory tells us SGD converges to a region with small gradients. However, non-convex landscapes are littered with local minima, maxima, and an exponential number of saddle points. We know SGD "prefers" flat minima, but the mathematical "why" has always been slippery.

Most researchers use Diffusion Approximations (SDEs), but these have a fatal flaw: the time it takes for an SDE to reach its steady state grows exponentially as the step-size decreases. By the time the SDE is relevant, the discretization error between the actual SGD and the SDE has usually exploded.

Methodology: Action Functionals and Quasi-Potentials

Instead of relying on SDEs, the authors implement the Freidlin-Wentzell Theory for discrete-time Markov processes.

1. The Least Action Principle

The authors define an "Action Functional" . Think of this as the "cost" of SGD following a specific trajectory .

  • Paths that follow the gradient flow have zero cost.
  • Paths that fight the flow (to escape a local minimum) have high costs.

2. The Quasi-Potential

The probability of jumping from one local minimum to another is determined by the Quasi-Potential , which is the minimum "action" needed to traverse between them.

Himmelblau Test Function Analysis Figure 1: On the left, the loss landscape. In the middle, the "most likely" transitions between components. On the right, the empirical long-run distribution of SGD matches the theoretical wireframe prediction.

Core Insights: The Hierarchy of Convergence

The paper establishes four fundamental theorems:

  1. Exponential Concentration: Critical regions are visited exponentially more often than anywhere else.
  2. Boltzmann-Gibbs Analogy: The probability of being at a component is .
  3. The Dominance of Minima: Saddle points and maxima are "exponentially neglected" compared to local minima.
  4. Ground State Selection: SGD settles at the global minimum of the energy functional, which might not be the global minimum of the loss function.

Impact of Noise and Flatness

A profound takeaway (Section 4.2) is the role of Flatness. Under certain noise models, the energy levels are determined more by the reciprocal of the Hessian eigenvalues (flatness) than by the objective value (depth).

As a minimum becomes "flatter" (smaller eigenvalues ), its energy level effectively decreases, making it exponentially more likely for SGD to settle there even if it’s a "shallow" minimum relative to other sharp peaks.

Critical Analysis & Conclusion

Takeaways

  • Noise is a Feature: The noise in SGD isn't just something to be "tamed"; it's the engine that drives the system toward stable, flat, and likely more generalizable "ground states."
  • Temperature Control: The step-size is a literal temperature. Decaying is analogous to Simulated Annealing, locking the model into its current energy state.

Limitations

The analysis assumes a constant step-size, whereas modern training utilizes complex schedules and vanishing step-sizes. Furthermore, while the theory is general, calculating the exact "Energy Levels" for a billion-parameter LLM remains computationally intractable.

Final Outlook

This work bridges the gap between optimization and statistical physics. It moves us away from asking "What is the gradient?" toward "What is the action cost of escaping this basin?"—a paradigm shift that may eventually explain why deep learning works at all.

Find Similar Papers

Try Our Examples

  • Find recent papers applying Freidlin-Wentzell theory or large deviations to analyze the generalization or "flatness" preference of Adam or other adaptive optimizers.
  • Which paper first established the Stochastic Modified Equation (SME) approach for SGD, and how does this paper's LDP approach specifically bypass the SME convergence rate issues?
  • Search for empirical studies that compare the "ground state" predicted by this paper's energy functional with actual training outcomes in large-scale ResNet or Transformer models.
Contents
SGD as Equilibrium Thermodynamics: A Large Deviations Analysis of the Long-Run Distribution
1. TL;DR
2. The Problem: The Mystery of the "Long Run"
3. Methodology: Action Functionals and Quasi-Potentials
3.1. 1. The Least Action Principle
3.2. 2. The Quasi-Potential
4. Core Insights: The Hierarchy of Convergence
5. Impact of Noise and Flatness
6. Critical Analysis & Conclusion
6.1. Takeaways
6.2. Limitations
6.3. Final Outlook