NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Augment Your Batch: Improving Generalization Through Instance Repetition

Elad Hoffer, Tal Ben-Nun, Itay Hubara, Niv Giladi, Torsten Hoefler, Daniel Soudry

Abstract

Batch Augmentation (BA) is a simple yet effective training strategy that replicates samples within a batch and applies different random augmentations to each copy. This approach effectively increases the batch size without increasing I/O overhead, reduces gradient variance more gradually than standard large-batch training, and acts as a potent regularizer. We demonstrate that BA accelerates convergence and improves final generalization across various domains, including computer vision and natural language processing, allowing models to reach state-of-the-art accuracy in fewer iterations.

Introduction

Training deep neural networks at scale typically requires large-batch Stochastic Gradient Descent (SGD) to distribute workloads across multiple GPUs. However, this often leads to a "generalization gap," where large batches converge to "sharp minima" that perform poorly on unseen data. Additionally, as compute power increases, the time spent reading and decoding data from disk (I/O) often becomes a primary bottleneck, leaving GPUs idle.

Batch Augmentation (BA) addresses these challenges by filling batches with multiple augmented versions of the same samples. This strategy increases the compute-to-I/O ratio and provides a controlled form of gradient noise that aids generalization.

The Batch Augmentation Method

In standard training, a batch of size $B$ consists of $B$ unique samples. In BA, these $B$ samples are replicated $M$ times, resulting in a total batch size of $M \cdot B$. Crucially, each of the $M$ copies of a single sample undergoes a different random transformation (e.g., a different crop, flip, or color jitter).

Validation error across epochs for varying replication factors M. Higher values of M lead to faster convergence and lower final error.

Why BA Works

  • Gradient Correlation: Gradients from different augmentations of the same image are more correlated than those from entirely different images. Consequently, BA reduces gradient variance more gradually than a standard batch of $M \cdot B$ unique samples. This helps the optimizer maintain enough "noise" to escape sharp minima and find flatter, more robust regions of the loss landscape.
  • I/O Efficiency: Since only $B$ samples are read from disk to perform $M \cdot B$ computations, BA effectively multiplies the compute-to-I/O ratio by $M$. This bypasses the I/O bottleneck common in high-performance clusters.
  • Implicit Regularization: BA forces the model to learn features that are invariant across multiple views of the same object within a single update, acting as a form of training-time Test-Time Augmentation (TTA).

The authors also utilize Ghost Batch Normalization (GBN) to ensure that normalization statistics remain stable when distributing these large augmented batches across many processing elements.

Optimization Dynamics

The impact of BA on optimization is visible in the behavior of gradient norms. As the replication factor $M$ increases, the gradient norm decreases, reflecting the reduction in variance. However, the specific correlation between instances ensures that this reduction does not prematurely collapse the stochasticity needed for good generalization.

Gradient norm behavior during training with different values of M. Higher M values result in lower, more stable gradient norms.

Key Results

The results across various tasks and architectures demonstrate that BA improves both final accuracy and training speed:

  • ImageNet: A ResNet-50 reached 75.7% accuracy in just 35 epochs with BA, whereas the baseline took 90 epochs. Final accuracy improved from 76.3% to 76.86%.
  • CIFAR-10: Accuracy for ResNet-44 increased from 93.7% to 95.43% ($M=40$).
  • Natural Language Processing: On the WMT En-De translation task, BA (using Dropout as a form of augmentation) provided a +0.36 BLEU score improvement.
  • Extreme Scaling: The authors successfully scaled training to a supercomputer using 5,704 GPUs, showing that BA helps maintain generalization even at massive scales where standard SGD often fails.

Limitations and Future Work

While BA offers significant benefits, it increases the total computational work (FLOPs) per epoch. If a system is compute-bound rather than I/O-bound, BA may increase total wall-clock time despite faster convergence in terms of epochs. Additionally, for extremely large $M$, some tuning of weight decay or learning rates may be necessary to prevent underfitting. Future research could explore how BA interacts with learned augmentation policies like AutoAugment.

Summary updated

BibTeX
@inproceedings{hoffer2020augment,
  author = {Elad Hoffer and Tal Ben-Nun and Itay Hubara and Niv Giladi and Torsten Hoefler and Daniel Soudry},
  title = {{Augment Your Batch: Improving Generalization Through Instance Repetition}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.00815},
}
Figure