Noise Is Not the Main Factor Behind the Gap Between SGD and Adam on Transformers, but Sign Descent Might Be

Frederik Kunstner, Jacques Chen, Jonathan Wilder Lavington, Mark Schmidt
4/27/2023
cs.LGmath.OC

No official code found. Best implementation: fKunstner/noise-sgd-adam-sign (16 stars, last commit 2023-04-26).

Abstract

The success of the Adam optimizer on a wide array of architectures has made it the default in settings where stochastic gradient descent (SGD) performs poorly. However, our theoretical understanding of this discrepancy is lagging, preventing the development of significant improvements on either algorithm. Recent work advances the hypothesis that Adam and other heuristics like gradient clipping outperform SGD on language tasks because the distribution of the error induced by sampling has heavy tails. This suggests that Adam outperform SGD because it uses a more robust gradient estimate. We evaluate this hypothesis by varying the batch size, up to the entire dataset, to control for stochasticity. We present evidence that stochasticity and heavy-tailed noise are not major factors in the performance gap between SGD and Adam. Rather, Adam performs better as the batch size increases, while SGD is less effective at taking advantage of the reduction in noise. This raises the question as to why Adam outperforms SGD in the full-batch setting. Through further investigation of simpler variants of SGD, we find that the behavior of Adam with large batches is similar to sign descent with momentum.

View on arXivView PDF

Code Implementations(1)

160Shell, PythonFeb 28, 20233 years ago

Similar Papers

Cite this paper

@article{kunstner2023noise,
  title  = {Noise Is Not the Main Factor Behind the Gap Between SGD and Adam on Transformers, but Sign Descent Might Be},
  author = {Frederik Kunstner and Jacques Chen and Jonathan Wilder Lavington and Mark Schmidt},
  year   = {2023},
  eprint = {2304.13960},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2304.13960v1},
  journal = {ICLR 2023 2023}
}

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/2304.13960.svg)](https://codeofpaper.com/paper/2304.13960)

Discussion