Stochastic gradient descent performs variational inference, converges to limit cycles for deep networks
Pratik Chaudhari, Stefano Soatto
TL;DR
This paper establishes that stochastic gradient descent implicitly performs variational inference by minimizing a steady-state free-energy F(ρ) composed of an average potential Φ(x) and an entropic term, where Φ generally differs from the original loss f unless the gradient noise is isotropic. It shows that deep networks exhibit highly non-isotropic, low-rank diffusion, leading to out-of-equilibrium dynamics where SGD traces deterministic loops or limit cycles rather than converging to traditional critical points. Empirical results across MNIST and CIFAR demonstrate the pronounced anisotropy of the diffusion matrix D(x) and the consequent misalignment between Φ and f, with implications for generalization and architecture search. The work connects continuous-time SGD analysis to Wasserstein gradient flows and Bayesian inference, clarifying when SGD behaves like variational optimization and highlighting how non-equilibrium behavior can enhance generalization in high-dimensional models.
Abstract
Stochastic gradient descent (SGD) is widely believed to perform implicit regularization when used to train deep neural networks, but the precise manner in which this occurs has thus far been elusive. We prove that SGD minimizes an average potential over the posterior distribution of weights along with an entropic regularization term. This potential is however not the original loss function in general. So SGD does perform variational inference, but for a different loss than the one used to compute the gradients. Even more surprisingly, SGD does not even converge in the classical sense: we show that the most likely trajectories of SGD for deep networks do not behave like Brownian motion around critical points. Instead, they resemble closed loops with deterministic components. We prove that such "out-of-equilibrium" behavior is a consequence of highly non-isotropic gradient noise in SGD; the covariance matrix of mini-batch gradients for deep networks has a rank as small as 1% of its dimension. We provide extensive empirical validation of these claims, proven in the appendix.
