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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Srećković, Teodora, Geiping, Jonas, Orvieto, Antonio
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915343674376192
author Srećković, Teodora
Geiping, Jonas
Orvieto, Antonio
author_facet Srećković, Teodora
Geiping, Jonas
Orvieto, Antonio
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2506_12543
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Is your batch size the problem? Revisiting the Adam-SGD gap in language modeling
Srećković, Teodora
Geiping, Jonas
Orvieto, Antonio
Machine Learning
Optimization and Control
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.
title Is your batch size the problem? Revisiting the Adam-SGD gap in language modeling
topic Machine Learning
Optimization and Control
url https://arxiv.org/abs/2506.12543