Noise Balance and Stationary Distribution of Stochastic Gradient Descent

Liu Ziyin, Hongchao Li, Masahito Ueda · Submission to ICLR 2025 · Withdrawn

TL;DR

By analyzing the structure of gradient noise under rescaling symmetries (common in ReLU and multi-layer networks), this paper proves a "law of balance" that forces stochastic gradient descent (SGD) onto a low-dimensional subspace where layer-wise noise is balanced. Leveraging this property, the authors derive the first exact stationary distribution of SGD for deep, multi-layer diagonal linear models, uncovering nonlinear behaviors unique to depth—such as phase transitions, broken ergodicity, sign coherence, and "fluctuation inversion."

What Problem Does This Paper Address?

Understanding the stationary distribution of SGD—the probability distribution over weights after training settles—is fundamental to explaining why deep learning generalizes and how noise navigates complex loss landscapes. However, the Fokker-Planck equation governing high-dimensional SGD dynamics is notoriously intractable.

Existing analytical solutions either assume:

  1. State-independent (constant) Gaussian noise (which behaves like physical Langevin dynamics),
  2. Simple quadratic landscapes (yielding Gaussian posteriors), or
  3. Single-layer / scalar toy models that lack notions of depth and width.

Because of these simplifications, prior theory often treats SGD as an approximate sampler for the standard Bayesian posterior. This paper tackles how structural symmetries interact with parameter-dependent minibatch noise in architectures with genuine depth and width.

Methods

  • Continuous-Time SDE Formulation: The authors model SGD via the standard diffusion approximation: $$d\theta = -\nabla L(\theta) dt + \sqrt{T C(\theta)} dW_t$$ where $T = \eta / S$ denotes the noise ratio (learning rate $\eta$ divided by minibatch size $S$), and $C(\theta)$ is the state-dependent gradient covariance.

  • The "Law of Balance": When a network exhibits rescaling symmetry between layers—e.g., $f(u, w) = f(\lambda u, w/\lambda)$—the authors show using Itô’s lemma that the stochastic diffusion terms along the difference metric $\|u\|^2 - \|w\|^2$ cancel out exactly because the minibatch gradient covariance is low-rank. The norm difference follows an ordinary differential equation (ODE) rather than an SDE, driving the system toward an exact balance of gradient noise: $$\mathrm{Tr}_w[C(w)] = \mathrm{Tr}_u[C(u)]$$

  • Solvable Deep Model: The authors study a deep diagonal linear network: $$\ell = \left[ \sum_{i=1}^{d_0} \left( \prod_{k=0}^D u_i^{(k)} \right) x - y \right]^2$$ Applying the law of balance eliminates redundant degrees of freedom, reducing the high-dimensional Fokker-Planck equation to a solvable one-dimensional system for the effective end-to-end predictor $v = \sum_i v_i$.

Datasets

  • Synthetic 1D Linear Regressions: Used to validate one-dimensional analytical predictions and compare depth-0 against deeper setups.
  • Synthetic Multi-Dimensional Data: Full-rank Gaussian input vectors $x \in \mathbb{R}^{20}$ and noisy targets $y = x + \epsilon$ used to train a two-layer ReLU net ($20 \to 200 \to 20$).
  • MNIST: Fully connected $\tanh$ networks of varying depths $D$ trained with Adam to evaluate architectural scaling laws ($d/D$).

Key Insights and Ideas

  • SGD vs. Langevin Dynamics: Under standard gradient descent (GD), $\|u\|^2 - \|w\|^2$ is strictly conserved. If isotropic Gaussian noise (Langevin) is added, the parameters diffuse uncontrollably along degenerate directions. In contrast, SGD's state-dependent noise actively contracts the dynamics onto a balanced manifold.
  • Sign Coherence in Deep Models: For depth $D \ge 1$, all subnetworks $v_i$ must share the same sign at stationarity. If $x$ and $y$ are positively correlated, the model probability density is strictly zero for $v < 0$ ($p(v) = \delta(v)$). Unlike single-layer models ($D=0$), deep models cannot learn the wrong overall sign.
  • Nonequilibrium Phase Transition ($T_c$): For depth $D \ge 1$, a sharp phase transition occurs at a critical noise level: $$T_c = \frac{\beta_2 - \gamma}{\alpha_3}$$ If $T \ge T_c$, parameter trajectories collapse with probability 1 to a sparse trivial state at zero ($v=0$). Non-trivial learning only occurs when $T < T_c$.

  • Fluctuation Inversion & Edge of Stability: Rather than parameter variance blowing up as noise increases, deep models exhibit fluctuation inversion—variance shrinks near instability. Coupled with heavy tails ($v^{-5 + 3/(D+1)}$), this prevents the expected loss $\mathbb{E}[v^2]$ from diverging, explaining why neural networks remain stable and achieve low training error near the edge of stability.

  • SGD is Not a Valid Variational Posterior: The true Bayesian posterior occupies the full parameter space. Because SGD dynamics collapse to a low-dimensional manifold governed by symmetry, the stationary measure is singular with respect to the Bayesian posterior, rendering the Kullback-Leibler (KL) divergence between them infinite: $$\mathrm{KL}(p_{\text{Bayes}} \parallel p_{\text{SGD}}) = \infty$$

Key Results

  • Exact Stationary Distribution: Derived the closed-form stationary density $p(v)$ across depths $D$ and effective widths $d$. For $D=1$, the tail decays as $v^{-7/2}$; as $D \to \infty$, the tail approaches $v^{-5}$.
  • Infinite-Depth Scaling Law: In the $D \to \infty$ limit, the distribution depends directly on the combination $\frac{d}{D} \frac{S}{\eta}$. To avoid model collapse when scaling depth, the width must scale linearly with depth ($d = \Omega(D)$), matching optimal depth-to-width heuristics.
  • Norm Balance Bounds: At convergence, the ratio of layer norms is strictly bounded by the extreme eigenvalues of the noise covariance: $$\frac{\lambda_{2,\min}}{\lambda_{1,\max}} \le \frac{\|u\|^2}{\|w\|^2} \le \frac{\lambda_{2,\max}}{\lambda_{1,\min}}$$

Limitations and Future Work

  • Model Simplification: The exact stationary distribution is derived for diagonal linear networks; while qualitative phenomena (noise balance, sign coherence, fluctuation inversion) were reproduced numerically on non-linear ReLU/$\tanh$ nets, formal proofs for deep non-linear networks remain open.
  • Continuous SDE Assumptions: The analysis assumes continuous-time diffusion approximations. While standard, very large discrete learning rates can introduce step-size truncation effects not captured by Brownian motion.
  • Implications for MCMC/VI: Since symmetries collapse SGD distributions into measure-zero subspaces, future work must determine how to eliminate or account for symmetry manifolds when using SGD-based approximations for Bayesian inference.

Summary updated

BibTeX
@misc{ziyin2023noise,
  author = {Liu Ziyin and Hongchao Li and Masahito Ueda},
  title = {{Noise Balance and Stationary Distribution of Stochastic Gradient Descent}},
  year = {2023},
  eprint = {2308.06671},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.06671},
}
Figure