The Noise Geometry of Stochastic Gradient Descent: A Quantitative and Analytical Characterization

Mingze Wang, Lei Wu · Submission to ICLR 2024 · Withdrawn

TL;DR

Why does stochastic gradient descent (SGD) consistently find flatter, better-generalizing minima than full-batch gradient descent (GD)? This paper proves that mini-batch noise naturally mirrors the local curvature (Hessian/Fisher information) across both average and directional metrics in finite-sample regimes. Crucially, this noise geometry forces SGD to escape sharp minima along flat valleys of the loss landscape, unlike GD, which escapes exclusively along the sharpest directions.

What Problem Does This Paper Address?

It is well known empirically that mini-batch gradient noise is highly anisotropic and roughly aligns with the loss landscape's Hessian matrix: $\Sigma(\theta) \approx 2L(\theta)H(\theta)$. However, theoretical explanations for why and when this alignment occurs have remained scarce.

Prior theoretical characterizations (e.g., Wu et al., 2022) were mostly confined to infinite-data regimes ($n = \infty$) and simple linear models, leaving critical questions unanswered:

  1. Does noise alignment survive in finite-sample and degenerate data regimes?
  2. Does alignment hold directionally (i.e., is noise energy along a specific vector $v$ proportional to the directional curvature $v^\top H v$)?
  3. How does this anisotropic noise geometry physically govern how SGD escapes sharp minima?

Methods

The authors analyze empirical risk minimization with square loss over two classes of models: Over-parameterized Linear Models (OLMs) ($f(x; \theta) = F(\theta)^\top x$) and two-layer neural networks ($f(x; \theta) = \sum_k a_k \phi(b_k^\top x)$ with fixed $a_k \in \{\pm 1\}$ and strictly bounded activation derivatives $\alpha \le \phi' \le \beta$).

Key methodological components include:

  • Average Alignment ($\mu(\theta)$): Measuring the normalized cosine similarity between the gradient covariance $\Sigma_1(\theta)$ and the empirical Fisher matrix $G(\theta)$.
  • Directional Alignment ($g(\theta; v)$): Formally quantifying the ratio of directional noise variance to directional curvature: $$g(\theta; v) := \frac{v^\top \Sigma(\theta) v}{2L(\theta)(v^\top G(\theta) v)}$$
  • High-Dimensional Probability Tools: Hanson-Wright inequalities, sub-Weibull random variable concentration, and $\epsilon$-net covering arguments over the sphere $\mathbb{S}^{d-1}$ to establish uniform bounds across parameters and directions.
  • Linearized Eigenspace Dynamics: Decomposing SGD updates near a minimum $\theta^*$ into sharp vs. flat eigenspaces to track loss energy ratios $D_k(t) = Y_t / X_t$ over time.

Datasets

  • Synthetic Data: Gaussian inputs $x \sim \mathcal{N}(0, S)$ under both isotropic ($S = I_d$) and anisotropic ($S$ with decaying spectrum) configurations.
  • CIFAR-10: Evaluated on both binary subsets (labels 0 vs. 1) and the full 10-class benchmark using 4-layer CNNs, 4-layer FNNs, ResNet-38, ResNet-110, VGG-13, and VGG-19.
  • No new benchmarks were introduced.

Key Insights and Ideas

  • Alignment is Dimension- and Width-Independent: Uniform bounds on average alignment hold independent of parameter count $p$ or hidden layer width $m$. It requires only that the effective input dimension satisfy $d_{\text{eff}} \gtrsim \log n$.
  • Directional Proportionality: For OLMs, if $n \gtrsim d$, directional alignment is uniformly lower-bounded across all directions in $\mathbb{R}^p$. When a direction is orthogonal to the full gradient ($v \perp \nabla L(\theta)$), the ratio $g(\theta; v)$ approaches $1$ under sufficient sample sizes.
  • SGD Escapes Along Flat Directions:
  • In GD, the escape from an unstable minimum is dictated by the top eigenvector: the energy along all other directions decays exponentially to zero ($D_1(t) \to 0$).
  • In SGD, noise pumps energy into orthogonal modes. The energy along flat directions is lower bounded by the stable rank of the curvature: $D_1(t) \gtrsim \text{srk}(G^2) - 1$. In high dimensions ($\text{srk}(G^2) \gg 1$), SGD’s escape is dominated by flat directions.
  • Mechanism Behind Cyclical Learning Rates (CLR): Escaping along flat directions allows parameters to move laterally along minimum valleys, enabling SGD to drop into globally flatter basins when the learning rate is cyclically reduced.

Key Results

  • Average Alignment Guarantees:
  • For OLMs and two-layer networks, $\inf_\theta \mu(\theta)$ is strictly bounded away from zero whenever $d_{\text{eff}} \gtrsim \log(n/\delta)/\epsilon^2$ or $n \gtrsim d$.
  • Two-Sided Directional Bounds: For OLMs, when $n \gtrsim d^2 / \epsilon$, directional alignment satisfies: $$\frac{1-\epsilon}{(1+\epsilon)^2} \le g(\theta; v) \le \frac{2+\epsilon}{(1-\epsilon)^2}$$
  • Escape Energy Ratios: Synthetic experiments with linear regression show that as $\text{srk}(G^2)$ increases from 5 to 500, SGD maintains orders of magnitude more energy along flat directions ($D_1(t) \approx 10^0$ to $10^2$), while GD plummets below $10^{-4}$.
  • Deep Net Verification: On ResNet-110 and VGG-19 on CIFAR-10, escaping trajectories visualized along sharp ($p_k$) vs. flat ($r_k$) coordinates demonstrate that SGD trajectories disperse heavily along flat dimensions ($r_k(t) > 0$), whereas GD trajectories remain tightly confined to the sharpest subspace ($r_k(t) \approx 0$).

Limitations and Future Work

  • Sample Complexity Gap: While the uniform directional alignment theorem requires $n \gtrsim d$ across the entire parameter space, empirical runs show directional alignment along SGD trajectories even when $n \ll d$. Characterizing alignment strictly restricted to the "SGD-reachable manifold" remains an open challenge.
  • Architectural Restrictions: Theoretical proofs for two-layer nets require non-trainable second layers and non-zero lower bounds on the activation derivative ($\alpha > 0$), which excludes standard ReLU (though empirical tests on ReLU networks still show strong alignment).
  • Edge of Stability (EoS): The authors connect their findings qualitatively to EoS and explain why SGD avoids massive loss spikes seen in full-batch GD, but formalizing this into a complete dynamical theory of SGD in the EoS regime is left for future work.

Summary updated

BibTeX
@inproceedings{wang2023noise,
  author = {Mingze Wang and Lei Wu},
  title = {{The Noise Geometry of Stochastic Gradient Descent: A Quantitative and Analytical Characterization}},
  booktitle = {M3L @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=qxy72wUf90},
}

Loading related content...

Figure