The Limiting Dynamics of SGD: Modified Loss, Phase Space Oscillations, and Anomalous Diffusion

Daniel Kunin, Javier Sagastuy-Brena, Lauren Gillespie, Eshed Margalit, Hidenori Tanaka +2 more
7/19/2021
cs.LGcond-mat.stat-mechq-bio.NC

Official code: danielkunin/rethinking-SGD (7 stars, Jupyter Notebook, last commit 2021-07-10).

Abstract

In this work we explore the limiting dynamics of deep neural networks trained with stochastic gradient descent (SGD). As observed previously, long after performance has converged, networks continue to move through parameter space by a process of anomalous diffusion in which distance travelled grows as a power law in the number of gradient updates with a nontrivial exponent.

Show full abstract

We reveal an intricate interaction between the hyperparameters of optimization, the structure in the gradient noise, and the Hessian matrix at the end of training that explains this anomalous diffusion. To build this understanding, we first derive a continuous-time model for SGD with finite learning rates and batch sizes as an underdamped Langevin equation. We study this equation in the setting of linear regression, where we can derive exact, analytic expressions for the phase space dynamics of the parameters and their instantaneous velocities from initialization to stationarity. Using the Fokker-Planck equation, we show that the key ingredient driving these dynamics is not the original training loss, but rather the combination of a modified loss, which implicitly regularizes the velocity, and probability currents, which cause oscillations in phase space. We identify qualitative and quantitative predictions of this theory in the dynamics of a ResNet-18 model trained on ImageNet. Through the lens of statistical physics, we uncover a mechanistic origin for the anomalous limiting dynamics of deep neural networks trained with SGD.

View on arXivView PDF

Code Implementations(1)

70Jupyter Notebook, PythonApr 13, 20215 years ago

Similar Papers

Cite this paper

@article{kunin2021limiting,
  title  = {The Limiting Dynamics of SGD: Modified Loss, Phase Space Oscillations, and Anomalous Diffusion},
  author = {Daniel Kunin and Javier Sagastuy-Brena and Lauren Gillespie and Eshed Margalit and Hidenori Tanaka and Surya Ganguli and Daniel L. K. Yamins},
  year   = {2021},
  eprint = {2107.09133},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2107.09133}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2107.09133.svg)](https://codeofpaper.com/paper/2107.09133)

Discussion