Beyond a Single Explanation of the Adam--SGD Gap

Chenxiang Zhang, Rustem Islamov, Enea Monzio Compagnoni, Jun Pang, Aurelien Lucchi, Antonio Orvieto

TL;DR

The performance gap between Adam and SGD is not driven by a single isolated factor like text data properties or Transformer design. Instead, it is governed by a "crossover batch size" where the optimization advantage shifts from SGD to Adam, determined by complex, non-trivial interactions between data geometry and architectural choices.

What Problem Does This Paper Address?

Why does the Adam optimizer dominate Transformer-based language modeling, while SGD remains highly successful in computer vision? For years, the deep learning community has proposed isolated explanations for this "Adam–SGD gap." Some point to data properties (like the heavy-tailed Zipfian distribution of text), others blame architectural components (like softmax-attention), and some credit optimization traits (like gradient noise robustness).

However, because these hypotheses were mostly studied in isolation and within specific domains, their relative importance and interactions remained unclear. This paper systematically revisits these assumptions under a unified, controlled empirical and theoretical framework to find out what genuinely drives the gap.

Methods

The authors conduct a rigorous, controlled empirical study alongside a theoretical analysis:

  • Empirical Control: To avoid confounding results, the authors jointly and extensively swept the learning rate ($\eta$) and momentum ($\beta$) for both optimizers across all configurations.
  • Ablation & Interpolation: They systematically stripped away specific components (e.g., replacing softmax-attention with gated convolutions, changing vocabulary distributions) and progressively interpolated architectures (e.g., transforming a ResNet50 into a ConvNeXt) to isolate individual effects.
  • Theoretical Modeling: They utilized non-convex convergence bounds to compare Normalized SGD (NSGD) with momentum against SignSGD with momentum (serving as a proxy for Adam). This allowed them to model how the gap changes as a function of batch size and Hessian smoothness ratios ($r = L_\infty / L_2$).

Datasets

The study spans four distinct data modalities:

  • Language: FineWeb (1B tokens) and TinyStories (10M tokens).
  • Vision: ImageNet21K (I21K) and a heavy-tailed subset of ImageNet1K (HT-I1K).
  • Genomics: Human genome reference assembly (HG38), processed with different tokenizers to control vocabulary size and distribution.
  • Graphs: ZINC250K, a real-world molecular regression dataset.

Key Insights and Ideas

  • No Single Culprit: Popular single-factor explanations fail when isolated. Softmax-attention is not necessary to create the gap, nor is a heavy-tailed vocabulary distribution.
  • The Crossover Batch Size: Across all settings, scaling up the batch size consistently shifts the performance advantage from SGD to Adam. Rather than a static choice, the optimal optimizer depends on where your training batch size sits relative to a dynamic "crossover point."
  • Gradual Architectural Influence: Architecture doesn't cause a binary shift. Subtle design choices—such as swapping a ReLU activation function for GeLU, or BatchNorm for LayerNorm—gradually tilt the advantage toward Adam.
  • Vision's High Threshold: The transition from SGD to Adam occurs at substantially larger batch sizes for image data than for text, explaining SGD's historical stronghold in computer vision.

Key Results

  • Attention is Not Required: Replacing the softmax-attention layers in GPT with gated convolutions (GCNN) on FineWeb data did not eliminate the gap; Adam still significantly outperformed SGD ($\Delta^* = -0.454$), as shown in Figure 2.
GPT vs GCNN final train loss
  • Vocabulary Imbalance is Not Required: On genomics data (HG38) configured with a near-uniform character-level vocabulary distribution ($v=5$), the gap favoring Adam persisted ($\Delta^* = -0.127$), contradicting the idea that Adam only wins on highly imbalanced text data (Figure 3).
Figure 3: GPT trained on human genomics HG38 data processed with different tokenizers at batch size B = 256. The Adam–SGD gap is present regardless of the vocabulary distribution and size. In particular, under the char tokenizer with 2.7B tokens and a near-uniformly distributed small vocabulary (v = 5), the gap is nontrivial. When the kmer tokenizer is applied, the number of tokens decreases, the vocabulary size grows, and its distribution becomes Zipfian with the Adam–SGD gap persisting. For every configuration, the learning rate and momentum are tuned, see §A.6.
  • SGD Wins on Vision Transformers: When training a Vision Transformer (ViT) on ImageNet21K at a batch size of 256, SGD achieved a $12\%$ lower final loss than Adam ($\Delta^* = +0.851$), demonstrating that component heterogeneity alone does not guarantee an Adam advantage.
  • Unified Crossover Trend: Figure 1 illustrates the overarching trend across language, vision, genomics, and graphs: as batch size scales, the relative final train loss gap moves from positive (SGD faster) to negative (Adam faster).
Figure 1: Optimizer advantage shifts from SGD to Adam as the batch size scales, with the trend depending on interactions between data and architecture. The y-axis reports the relative gap (LAdam −LSGD)/LAdam, where positive values indicate SGD outperforms Adam. (left) Our experimental setup spans four data modalities with different vocabulary distributions and sizes, trained on both Transformer and non-Transformer architectures. (middle) Transformer and (right) non-Transformer models trained across language, vision, genomics, and graph learning. Across all settings, increasing batch size consistently shifts the advantage from SGD to Adam; however, the crossover point and transition slope vary by configuration. Rather than attributing the Adam–SGD gap to a single factor, these results point to a crossover batch size whose value is jointly determined by data and architecture properties. In all the experiments, the learning rate and momentum are jointly and extensively tuned, see §3.

Limitations and Future Work

While this paper clarifies the relationship between Adam and SGD, it primarily focuses on this classic pairing. The authors acknowledge that the deep learning optimization landscape is rapidly evolving with newer methods like Muon, SOAP, and Scion. While they note that early evidence suggests trends from this paper (like Muon's effectiveness in large-batch regimes) may generalize, these newer optimizers were not deeply integrated into their benchmark.

Future work remains to pinpoint exactly which data properties beyond vocabulary distribution influence the optimization landscape, and how practitioners can leverage the crossover batch size model to design more hardware- and data-efficient optimizers.

Summary updated

BibTeX
@inproceedings{zhang2026beyond,
  author = {Chenxiang Zhang and Rustem Islamov and Enea Monzio Compagnoni and Jun Pang and Aurelien Lucchi and Antonio Orvieto},
  title = {{Beyond a Single Explanation of the Adam--SGD Gap}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=gs38iA3FeE},
}
Figure