Is your batch size the problem? Revisiting the Adam-SGD gap in language modeling

Teodora Srećković, Jonas Geiping, Antonio Orvieto
6/14/2025
cs.LGmath.OC

No confident code implementation found for this paper.

Abstract

Adam is known to perform significantly better than Stochastic Gradient Descent (SGD) in language models, a phenomenon for which a number of explanations have been proposed. In this work, we revisit this "optimizer gap" through a series of comprehensively tuned baseline training runs for language modeling with Transformers. We exhaustively study how momentum, gradient clipping, and batch size affect the gap between SGD and Adam. Our empirical findings show that SGD with momentum can actually perform similarly to Adam in small-batch settings, if tuned correctly. We revisit existing explanations for Adam's advantage, including heavy-tailed class imbalance, directional sharpness, and Hessian heterogeneity, which struggle to directly explain this phenomenon. Towards bridging this gap in our understanding, by analyzing our Transformer training runs and simple quadratic settings inspired by the literature, we provide new insights, driven by stochastic differential equation models, into the role of batch size on the training dynamics.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{srekovi2025your,
  title  = {Is your batch size the problem? Revisiting the Adam-SGD gap in language modeling},
  author = {Teodora Srećković and Jonas Geiping and Antonio Orvieto},
  year   = {2025},
  eprint = {2506.12543},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.12543v1}
}

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

Discussion