Small Batch Size Training for Language Models: When Vanilla SGD Works, and Why Gradient Accumulation is Wasteful

Martin Marek, Sanae Lotfi, Aditya Somasundaram, Andrew Gordon Wilson, Micah Goldblum

Abstract

Conventional wisdom suggests that large batch sizes are essential for stable Large Language Model (LLM) training. This paper challenges that notion, demonstrating that small batch sizes—down to batch size one—are not only stable but more robust to hyperparameter choices when optimizers are scaled correctly. By maintaining a constant "token half-life" for optimizer moving averages, even vanilla SGD can match the performance of Adam. Furthermore, small-batch training offers memory efficiencies comparable to LoRA while enabling full-parameter fine-tuning, suggesting that gradient accumulation is often an unnecessary overhead.

Introduction

The prevailing paradigm in LLM training emphasizes massive batch sizes, often necessitating "gradient accumulation" to simulate large batches when hardware memory is limited. This approach is rooted in the belief that small batches produce noisy gradients that lead to training instability and catastrophic loss spikes. However, new research from NYU and Columbia suggests that this instability is not inherent to small batch sizes but is instead a consequence of using hyperparameters tuned for large-batch regimes.

Methodology: Scaling the Optimizer

The researchers investigated batch sizes ranging from 1 to 4096. Their primary contribution is a scaling rule for the Adam optimizer that focuses on the token half-life of its moving averages.

The Token Half-Life Heuristic

In standard practice, the decay rates $\beta_1$ and $\beta_2$ are fixed regardless of batch size. The authors argue that as batch size $B$ decreases and the number of steps increases, these rates must be adjusted to keep the optimizer's "memory" consistent relative to the amount of data processed (tokens). They propose the scaling heuristic: $\beta^* = \beta^{(B^*/B)}$, where $B^*$ is the target batch size. This ensures that the exponential moving average spans the same number of tokens across different batch sizes.

The concept of optimizer decay and half-life relative to steps.

Implementation Details

To enable training at batch size 1 with 16-bit precision (bfloat16), the authors employed stochastic rounding. This prevents small gradient updates from being lost to deterministic rounding bias, a critical factor for stability at the smallest scales.

Key Insights: Robustness and Simplicity

The study reveals several counter-intuitive properties of small-batch training:

  1. Hyperparameter Robustness: Small batches are significantly more "forgiving." While large-batch training requires precise learning rate tuning to avoid divergence, small batches maintain near-optimal performance across a wide range of learning rates and decay factors.
  2. The Efficacy of SGD: At batch size 1, the performance gap between simple and complex optimizers vanishes. Vanilla SGD (without momentum or weight decay) performs on par with Adam. This suggests that the small, frequent updates of SGD at low batch sizes naturally avoid the "overshooting" problems that momentum is designed to solve.
  3. Memory Efficiency: By using small batch sizes with memory-efficient optimizers like Adafactor, the researchers achieved full-parameter fine-tuning performance within the memory constraints typically associated with Parameter-Efficient Fine-Tuning (PEFT) methods like LoRA.
Comparison of optimizer performance across batch sizes and hyperparameter robustness.

Results and Performance

The findings were validated on benchmarks including FineWeb-Edu (for pretraining 30M to 1.3B parameter models), C4, and MATH.

  • Scale Invariance: A 1.3B parameter GPT-3 model trained with vanilla SGD at batch size 1 matched the performance of a standard AdamW baseline at batch size 512.
  • Eliminating Instability: By fixing the token half-life, the authors successfully removed the "U-shaped" loss curve previously reported in literature, where extreme batch sizes (very small or very large) were thought to be suboptimal.

Discussion: The Hardware Bottleneck

While small-batch training is mathematically robust, it faces practical challenges on modern hardware. GPUs and TPUs are optimized for high arithmetic intensity, which is achieved through large data chunks. Training at batch size 1 often leads to low Model FLOPs Utilization (MFU) due to data movement overhead.

The authors conclude that while batch size 1 is a powerful theoretical limit, the practical recommendation is to use the smallest batch size that saturates hardware throughput (typically a few thousand tokens per device). Artificially inflating batch size further via gradient accumulation provides no algorithmic benefit and may even reduce robustness.

Conclusion

This work redefines our understanding of LLM training dynamics. By correctly scaling optimizer hyperparameters, small-batch training emerges as a stable, robust, and memory-efficient alternative to the "big batch" status quo. It challenges the necessity of complex adaptive optimizers in certain regimes and suggests that the future of efficient LLM training may lie in more frequent, smaller updates.

Summary updated

BibTeX
@inproceedings{marek2025small,
  author = {Martin Marek and Sanae Lotfi and Aditya Somasundaram and Andrew Gordon Wilson and Micah Goldblum},
  title = {{Small Batch Size Training for Language Models: When Vanilla SGD Works, and Why Gradient Accumulation is Wasteful}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=52Ehpe0Lu5},
}
Figure