Saved in:
Bibliographic Details
Main Authors: Marek, Martin, Lotfi, Sanae, Somasundaram, Aditya, Wilson, Andrew Gordon, Goldblum, Micah
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2507.07101
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912766372085760
author Marek, Martin
Lotfi, Sanae
Somasundaram, Aditya
Wilson, Andrew Gordon
Goldblum, Micah
author_facet Marek, Martin
Lotfi, Sanae
Somasundaram, Aditya
Wilson, Andrew Gordon
Goldblum, Micah
contents Conventional wisdom dictates that small batch sizes make language model pretraining and fine-tuning unstable, motivating gradient accumulation, which trades off the number of optimizer steps for a proportional increase in batch size. While it is common to decrease the learning rate for smaller batch sizes, other hyperparameters are often held fixed. In this work, we revisit small batch sizes all the way down to batch size one, and we propose a rule for scaling Adam hyperparameters to small batch sizes. In particular, rather than holding the decay rate of the second moment fixed across batch sizes, we propose to hold its half-life fixed in terms of tokens. We find that small batch sizes (1) train stably, (2) are consistently more robust to hyperparameter choices, (3) achieve equal or better per-FLOP performance than larger batch sizes, and (4) notably enable stable language model training with vanilla SGD, even without momentum, despite storing no optimizer state. Building on these results, we provide practical recommendations for selecting a batch size and setting optimizer hyperparameters. We further recommend against gradient accumulation unless training on multiple devices with multiple model replicas. Finally, we show that a small batch size combined with an optimizer with a small state size can provide the performance benefits of full fine-tuning while maintaining a similar memory footprint to LoRA.
format Preprint
id arxiv_https___arxiv_org_abs_2507_07101
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Small Batch Size Training for Language Models: When Vanilla SGD Works, and Why Gradient Accumulation Is Wasteful
Marek, Martin
Lotfi, Sanae
Somasundaram, Aditya
Wilson, Andrew Gordon
Goldblum, Micah
Machine Learning
Conventional wisdom dictates that small batch sizes make language model pretraining and fine-tuning unstable, motivating gradient accumulation, which trades off the number of optimizer steps for a proportional increase in batch size. While it is common to decrease the learning rate for smaller batch sizes, other hyperparameters are often held fixed. In this work, we revisit small batch sizes all the way down to batch size one, and we propose a rule for scaling Adam hyperparameters to small batch sizes. In particular, rather than holding the decay rate of the second moment fixed across batch sizes, we propose to hold its half-life fixed in terms of tokens. We find that small batch sizes (1) train stably, (2) are consistently more robust to hyperparameter choices, (3) achieve equal or better per-FLOP performance than larger batch sizes, and (4) notably enable stable language model training with vanilla SGD, even without momentum, despite storing no optimizer state. Building on these results, we provide practical recommendations for selecting a batch size and setting optimizer hyperparameters. We further recommend against gradient accumulation unless training on multiple devices with multiple model replicas. Finally, we show that a small batch size combined with an optimizer with a small state size can provide the performance benefits of full fine-tuning while maintaining a similar memory footprint to LoRA.
title Small Batch Size Training for Language Models: When Vanilla SGD Works, and Why Gradient Accumulation Is Wasteful
topic Machine Learning
url https://arxiv.org/abs/2507.07101