Noise Balance and Stationary Distribution of Stochastic Gradient Descent

Liu Ziyin, Hongchao Li, Masahito Ueda · DOI

TL;DR

This paper introduces the "law of balance," proving that Stochastic Gradient Descent (SGD) implicitly regularizes deep neural networks by driving their parameters toward a low-dimensional subspace where gradient noise across layers is perfectly balanced. By deriving the exact analytical stationary distribution for deep diagonal linear networks, the authors reveal that deep models uniquely exhibit complex physics-like phenomena, including nonequilibrium phase transitions, sign coherence, and fluctuation inversion.

What Problem Does This Paper Address?

While SGD is the fundamental workhorse used to train modern deep neural networks, our theoretical understanding of how it navigates highly complex, nonlinear, and degenerate loss landscapes remains limited.

Standard optimization theory often treats SGD simply as Gradient Descent (GD) injected with isotropic, parameter-independent noise (similar to standard Langevin diffusion). However, the noise in SGD actually stems from minibatch sampling, making it highly structured and dependent on the current parameter values.

The authors address this gap by exploring how this structured minibatch noise interacts with the inherent symmetries of neural networks. Their goal is to find exact analytical solutions for SGD's steady-state behavior (its stationary distribution) to uncover the fundamental differences between deep and shallow architectures.

SGD noise drives the system to a balanced solution, unlike standard Gaussian noise which diffuses along degenerate directions.

Methods

The authors model the discrete updates of SGD using its continuous-time Stochastic Differential Equation (SDE) approximation. To find the steady-state probability density of the network weights, they analyze the corresponding Fokker-Planck equation.

The key mathematical breakthrough relies on exploiting rescaling symmetries (e.g., scaling up one layer's weights while scaling down the next layer's weights, which leaves the network's output unchanged). By analyzing the dynamics along these symmetric directions, the authors show that the stochastic Brownian motion terms completely cancel out. This simplifies the complex stochastic system into a deterministic Ordinary Differential Equation (ODE) that dictates how layer norms balance out over time.

Datasets

Because this is a foundational theoretical paper, the authors validate their claims using synthetic datasets:

  • Linear & ReLU Regression: Inputs $x$ are sampled from a standard normal distribution, and labels are generated via $y = x + \epsilon$ or $y = kx + \epsilon$, where $\epsilon$ represents independent Gaussian noise.
  • Nonlinear Tanh Networks: Used to demonstrate that the derived principles generalize to non-linear networks where rescaling symmetries hold approximately near initialization or specific subspaces.

Key Insights and Ideas

  • The Law of Balance: Isotropic noise causes parameters to drift aimlessly along flat valleys in the loss landscape. In contrast, SGD’s structured minibatch noise forces the network toward a specific subspace where the gradient covariance traces of different layers are equal ($\text{Tr}_w[C(w)] = \text{Tr}_u[C(u)]$).
  • Sign Coherence: Deep networks ($D \ge 1$) possess a strict property where all subnetworks are forced to learn the correct sign of the target function at stationarity. Shallow networks ($D=0$) lack this protection and can easily converge to solutions with incorrect signs.
  • Fluctuation Inversion: Intuitively, more noise should mean more parameter variance. However, in deep models, increasing SGD noise (via larger learning rates or smaller batch sizes) can counterintuitively decrease parameter variance, eventually collapsing the weights into a sparse, zero-variance solution.
  • Broken Ergodicity & Memory Effects: The stationary distribution of SGD is non-unique and depends heavily on initialization. This means SGD retains a permanent memory of its starting conditions, contradicting the traditional view that it completely forgets its initialization.
FIG. 4. Stationary distributions of SGD for simple linear regression (D = 0), and a two-layer network (D = 1) across different T = η/S: T = 0.05 (left) and T = 0.5 (Mid). We see that for D = 1, the stationary distribution is strongly affected by the choice of the learning rate. In contrast, for D = 0, the stationary distribution is also centered at the global minimizer of the loss function, and the choice of the learning rate only affects the thickness of the tail. Right: the stationary distribution of a one-layer tanh-model, f(x) = tanh(vx) (D = 0) and a two-layer tanh-model f(x) = w tanh(ux) (D = 1). For D = 1, we define v := wu. The vertical line shows the ground truth. The deeper model never learns the wrong sign of wu (“sign coherence”), whereas the shallow model can learn the wrong one.

Key Results

  • Full-Rank Noise: The authors prove that for a generic two-layer ReLU network, the layer-specific noise matrices are full-rank for all active neurons, ensuring the law of balance is robustly well-defined in practice.
  • Exact Stationary Distribution: The paper provides the first exact analytical formula for the stationary distribution $p(v)$ of a diagonal linear network with arbitrary depth $D$ and width $d$.
  • Thinner Tails with Depth: The tail of the stationary distribution scales as $v^{-5 + 3/(D+1)}$ as $v \to \infty$. For an infinite-depth network, this exponent converges to $5$. This mathematical bound ensures that the expected loss $\mathbb{E}[v^2]$ never diverges, providing a direct explanation for the "edge of stability" phenomenon observed in deep learning practice.
  • Critical Phase Transition: The authors identify a critical noise threshold $T_c = \beta_2 / \alpha_3$. If the training noise $T$ exceeds $T_c$, the network undergoes a phase transition where learning becomes impossible, and the weights collapse to zero with probability 1.

Limitations and Future Work

The primary limitation is that the exact analytical solutions are derived for a simplified model (diagonal linear networks). While these models successfully capture the qualitative phenomena of deep networks (like depth-dependent tails and phase transitions), extending these exact derivations to complex, practical architectures like deep CNNs, ResNets, or Transformers remains an open challenge.

Additionally, the continuous-time SDE approximation assumes a relatively small learning rate, meaning ultra-large learning rate dynamics might deviate from the predicted distributions.

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