Table of Contents
Fetching ...

The Anisotropic Noise in Stochastic Gradient Descent: Its Behavior of Escaping from Sharp Minima and Regularization Effects

Zhanxing Zhu, Jingfeng Wu, Bing Yu, Lei Wu, Jinwen Ma

TL;DR

This work analyzes stochastic gradient dynamics with unbiased noise, unifying SGD and Langevin dynamics, and introduces an information-rich metric $\text{Tr}(H\Sigma)$ to quantify escape efficiency from minima. It shows that anisotropic noise aligned with loss curvature enables faster escape from sharp minima and bias toward flatter minima, offering a plausible explanation for SGD's superior generalization relative to isotropic diffusion. The authors derive conditions under which anisotropic noise outperforms isotropic noise and substantiate these with theoretical results and extensive experiments across toy setups and real datasets. The findings highlight the importance of noise structure, not just magnitude, in optimization dynamics and generalization, suggesting directions for designing better optimizers that exploit Hessian-aligned diffusion.

Abstract

Understanding the behavior of stochastic gradient descent (SGD) in the context of deep neural networks has raised lots of concerns recently. Along this line, we study a general form of gradient based optimization dynamics with unbiased noise, which unifies SGD and standard Langevin dynamics. Through investigating this general optimization dynamics, we analyze the behavior of SGD on escaping from minima and its regularization effects. A novel indicator is derived to characterize the efficiency of escaping from minima through measuring the alignment of noise covariance and the curvature of loss function. Based on this indicator, two conditions are established to show which type of noise structure is superior to isotropic noise in term of escaping efficiency. We further show that the anisotropic noise in SGD satisfies the two conditions, and thus helps to escape from sharp and poor minima effectively, towards more stable and flat minima that typically generalize well. We systematically design various experiments to verify the benefits of the anisotropic noise, compared with full gradient descent plus isotropic diffusion (i.e. Langevin dynamics).

The Anisotropic Noise in Stochastic Gradient Descent: Its Behavior of Escaping from Sharp Minima and Regularization Effects

TL;DR

This work analyzes stochastic gradient dynamics with unbiased noise, unifying SGD and Langevin dynamics, and introduces an information-rich metric to quantify escape efficiency from minima. It shows that anisotropic noise aligned with loss curvature enables faster escape from sharp minima and bias toward flatter minima, offering a plausible explanation for SGD's superior generalization relative to isotropic diffusion. The authors derive conditions under which anisotropic noise outperforms isotropic noise and substantiate these with theoretical results and extensive experiments across toy setups and real datasets. The findings highlight the importance of noise structure, not just magnitude, in optimization dynamics and generalization, suggesting directions for designing better optimizers that exploit Hessian-aligned diffusion.

Abstract

Understanding the behavior of stochastic gradient descent (SGD) in the context of deep neural networks has raised lots of concerns recently. Along this line, we study a general form of gradient based optimization dynamics with unbiased noise, which unifies SGD and standard Langevin dynamics. Through investigating this general optimization dynamics, we analyze the behavior of SGD on escaping from minima and its regularization effects. A novel indicator is derived to characterize the efficiency of escaping from minima through measuring the alignment of noise covariance and the curvature of loss function. Based on this indicator, two conditions are established to show which type of noise structure is superior to isotropic noise in term of escaping efficiency. We further show that the anisotropic noise in SGD satisfies the two conditions, and thus helps to escape from sharp and poor minima effectively, towards more stable and flat minima that typically generalize well. We systematically design various experiments to verify the benefits of the anisotropic noise, compared with full gradient descent plus isotropic diffusion (i.e. Langevin dynamics).

Paper Structure

This paper contains 43 sections, 3 theorems, 68 equations, 9 figures, 1 table.

Key Result

Proposition 1

Assume $H_{D\times D}$ and $\Sigma_{D\times D}$ are semi-positive definite. If (1) $H$ is ill-conditioned. Let $\lambda_1 \ge \lambda_2 \ge \dots, \ge \lambda_D \ge 0$ be the eigenvalues of $H$ in descent order, and for some constant $k\ll D$ and $d>\frac{1}{2}$, (2) $\Sigma$ is "aligned" with $H$. Let $u_i$ be the corresponding unit eigenvector of eigenvalue $\lambda_i$, for some projection coef

Figures (9)

  • Figure 1: The generalization performance of dynamics in Table \ref{['tb:dynamics']}. The noise magnitude of SGD, GLD dynamic and GLD diag is tuned to be the same for fair comparison. The noise of GLD constant is tunded to the best. Left: SVHN. We only use $2,5000$ examples for training to compromise with the computational burden; Right: CIFAR-10. The model is VGG-11 since it achieves decent performance without using batch normalization, which causes uncontrollable affects for analyzing SGD.
  • Figure 2: 2-D toy example. Compared dynamics are defined in Table \ref{['tb:dynamics']}, $k=2$, $\sigma_t^2$ is tuned to keep noise of all dynamics sharing same expected squared norm, $0.01$. All dynamics are run by $500$ iterations with learning rate $0.005$. Left: The trajectory of each compared dynamics for escaping from the sharp minimum in one run. Middle: Success rate of arriving the flat solution in $100$ repeated runs. Right: $\text{Tr}(H_t \Sigma_t)$ of compared dynamics in one run.
  • Figure 3: FashionMNIST experiments. Compared dynamics are initialized at $\theta^*_{GD}$ found by GD, marked by the vertical dashed line in iteration $3000$. The learning rate is same for all the compared methods, $\eta_t = 0.07$, and batch size $m=20$. Left: Training accuracy versus iteration. Middle: Test accuracy versus iteration. The final accuracy is noted within the parentheses. Right: Expected sharpness versus iteration. Expected sharpness is measured as $\mathbb{E}_{\nu \sim \mathcal{N}(0, \delta^2 I)} \left[ L(\theta + \nu)\right] - L(\theta)$, and $\delta=0.01$, the expectation is computed by average on $1000$ times sampling.
  • Figure 4: One hidden layer neural networks. The solid and the dotted lines represent the value of $\text{Tr}(H\Sigma)$ and $\text{Tr}(H\bar{\Sigma})$, respectively. The number of hidden nodes varies in $\{32, 128, 512\}$.
  • Figure 5: FashionMNIST experiments. Left: The first $400$ eigenvalues of Hessian at $\theta^*_{GD}$, the sharp minima found by GD after $3000$ iterations. Middle: The projection coefficient estimation $\hat{a} = \frac{u_1^T \Sigma u_1 \text{Tr} H}{\lambda_1 \text{Tr}\Sigma}$, as shown in Proposition \ref{['thm:aniso_benefit']}. Right: $\text{Tr}(H_t\Sigma_t)$ versus $\text{Tr}(H_t\bar{\Sigma}_t)$ during SGD optimization initialized from $\theta^*_{GD}$, $\bar{\Sigma}_t = \frac{\text{Tr}\Sigma_t}{D}I$ denotes the isotropic noise with same expected squared norm as SGD noise.
  • ...and 4 more figures

Theorems & Definitions (9)

  • Definition 1: Escaping efficiency
  • Proposition 1: The benefits of anisotropic noise
  • Proposition 2: The connection between Fisher and Hessian in one hidden layer network
  • Proposition 3: The connection between gradient covariance and Hessian in one hidden layer network
  • proof
  • proof
  • proof
  • proof
  • proof