Stochastic Gradient and Langevin Processes

Xiang Cheng, Dong Yin, Peter L. Bartlett, Michael I. Jordan · DOI

Abstract

We prove quantitative convergence rates at which discrete Langevin-like processes converge to the invariant distribution of a related stochastic differential equation. We study the setup where the additive noise can be non-Gaussian and state-dependent and the potential function can be non-convex. We show that the key properties of these processes depend on the potential function and the second moment of the additive noise. We apply our theoretical findings to studying the convergence of Stochastic Gradient Descent (SGD) for non-convex problems and corroborate them with experiments using SGD to train deep neural networks on the CIFAR-10 dataset.

Introduction

Stochastic Gradient Descent (SGD) is the cornerstone of modern deep learning optimization. Despite its ubiquity, a rigorous explanation for why SGD generalizes better than standard Gradient Descent (GD) remains a central challenge. While GD often converges to sharp local minima, SGD tends to find flatter regions that generalize more effectively to unseen data.

Researchers frequently model SGD as a discrete approximation of a continuous-time Stochastic Differential Equation (SDE), specifically Langevin diffusion. However, standard Langevin theory typically assumes isotropic Gaussian noise. In practice, SGD noise is both non-Gaussian—particularly with small minibatches—and state-dependent, where the variance of the gradient estimate fluctuates based on the current model weights. This paper addresses these complexities by proving quantitative convergence rates for these "messy" processes to their stationary distributions in non-convex settings.

Theoretical Framework

The authors analyze a discrete Langevin-like process designed to mimic the behavior of SGD: $$w_{(k+1)\delta} = w_{k\delta} - \delta \nabla U(w_{k\delta}) + \sqrt{\delta} \xi(w_{k\delta}, \eta_k)$$ where $U$ is a potentially non-convex potential function, $\delta$ is the step size, and $\xi$ represents the noise function.

To handle the inherent non-convexity and state-dependency, the study employs several advanced mathematical tools:

  • Wasserstein-1 Distance ($W_1$): Used to bound the distance between the distribution of discrete iterates and the invariant distribution of the target SDE.
  • Reflection Coupling: A technique used to demonstrate how discrete and continuous stochastic processes synchronize in distribution over time.
  • Lyapunov Functions: Energy functions constructed to ensure iterates remain within a stationary distribution rather than diverging.
The relationship between the potential function $U(x)$, state-dependent noise $M(x)$, the resulting invariant distribution $V(x)$, and empirical samples.

A key theoretical insight is that state-dependent noise can effectively "smooth" the optimization landscape. If a deep local minimum is located in a region of high noise, the diffusion process will bias the model toward regions where the noise is lower or the landscape is flatter, effectively erasing problematic sharp minima.

Empirical Results

The theoretical findings were validated using the CIFAR-10 dataset across two different architectures: a custom Convolutional Neural Network (CNN) and VGG19.

The experiments revealed a striking linear relationship between the logarithm of the noise covariance and the final test accuracy. This suggests that the stationary distribution of weights—and by extension, the model's generalization performance—is primarily determined by the second moment (covariance) of the noise.

Test accuracy versus log(noise covariance) for CNN and VGG19 architectures across various batch sizes.

Furthermore, the authors introduced "Large-Noise SGD," a variant that injects additional non-Gaussian noise while maintaining the same total covariance as standard SGD. Models trained with these disparate noise distributions achieved nearly identical test accuracy, confirming that the "shape" of the noise is secondary to its magnitude (covariance).

Discussion and Conclusion

This work establishes that the noise covariance matrix is the "secret sauce" of SGD. It dictates which regions of the weight space the model frequents, reinforcing the importance of the learning rate to batch size ratio ($\delta/b$), which directly scales this covariance.

While the theory assumes bounded noise and dissipative potential functions—assumptions that may not hold for all deep learning scenarios (e.g., heavy-tailed noise)—it provides a robust foundation for understanding SGD's success. Future work may explore tighter convergence bounds, as the theoretical $O(\delta^{1/8})$ rate for non-Gaussian noise might be conservative compared to real-world performance.

Summary updated

BibTeX
@inproceedings{cheng2020stochastic,
  author = {Xiang Cheng and Dong Yin and Peter L. Bartlett and Michael I. Jordan},
  title = {{Stochastic Gradient and Langevin Processes}},
  booktitle = {International Conference on Machine Learning},
  year = {2020},
  url = {https://openreview.net/forum?id=RYVk2YIcGnb},
}
Figure