DIVEBATCH: Accelerating Model Training Through Gradient-Diversity Aware Batch Size Adaptation

Yuen Chen, Yian Wang, Hari SundaramarXiv 2025 · DOI

Abstract

DIVEBATCH is a novel adaptive batch size algorithm for Stochastic Gradient Descent (SGD) that dynamically adjusts batch sizes based on "gradient diversity." By leveraging theoretical insights into how individual data points contribute to the overall gradient, it achieves up to a 5x speedup in training time compared to standard methods while maintaining competitive model performance.

Introduction

In deep learning, choosing the right batch size is a balancing act. Large batch sizes are computationally efficient because they maximize the parallel processing power of modern GPUs, leading to faster iterations. However, they often require more epochs to converge and can lead to "sharp minima," which hurts the model's ability to generalize to new data. Conversely, small batch sizes often converge in fewer epochs and generalize better, but they are slow in terms of wall-clock time because they don't fully utilize hardware resources.

While previous research has attempted to adapt batch sizes during training, most methods rely on simple heuristics—like doubling the batch size every few epochs—rather than a rigorous theoretical foundation. DIVEBATCH fills this gap by using a data-driven metric called gradient diversity to guide batch size adjustments.

Methodology: Gradient-Diversity Aware Batching

The core of DIVEBATCH is grounded in the theory of gradient diversity, which measures how much the gradients of individual data points differ from the average gradient of the entire dataset. If individual gradients are very different (high diversity), a larger batch size can be used to "average out" the noise without losing much optimization progress per update.

The DIVEBATCH Algorithm

The main challenge in using gradient diversity is a circular dependency: to calculate the ideal batch size for the current step, one needs the gradients of all data points at the current model state—but these haven't been computed yet. DIVEBATCH solves this through a four-step process:

  1. Estimation: During an epoch, it accumulates the $L_2$-norms of individual gradients and the norm of the sum of gradients.
  2. Delayed Update: At the end of each epoch, it uses these accumulated values to estimate the gradient diversity.
  3. Proportional Scaling: It sets the batch size for the next epoch to be proportional to this estimated diversity (clamped by a maximum batch size $m_{max}$).
  4. Learning Rate Scaling: To maintain stable training, it scales the learning rate in proportion to the batch size increase, following the "Linear Scaling Rule."
Comparison of DIVEBATCH estimation versus an Oracle batch size selection.

A key insight of the paper is that even though the gradient diversity is estimated using "stale" gradients from the previous epoch, it remains a sufficiently accurate proxy to guide batch size selection effectively, as shown in the comparison with an "Oracle" selector.

Experimental Results

The authors validated DIVEBATCH on synthetic data and standard computer vision benchmarks including CIFAR-10, CIFAR-100, and Tiny-ImageNet. DIVEBATCH consistently outperforms fixed-batch SGD and heuristic-based methods like AdaBatch in terms of time-to-convergence.

Validation loss and accuracy across different batch size configurations and datasets.

On CIFAR-10, DIVEBATCH reached a target accuracy within $\pm 1\%$ of the final result in 638 seconds, compared to 3188 seconds for small-batch SGD (a ~5x speedup) and 1361 seconds for AdaBatch. Across all real-world datasets, DIVEBATCH was 1.06x to 5x faster than the baselines. While the accelerated convergence comes with a minor cost—final validation accuracy was typically within 1-5% of the best small-batch SGD results—it is ideal for the exploratory phase of research where rapid iteration is paramount.

Discussion and Limitations

Despite its performance gains, DIVEBATCH introduces certain trade-offs. To estimate diversity, it must compute individual gradient norms, which increases peak memory usage (e.g., ~13GB for DIVEBATCH vs ~0.7GB for small-batch SGD on CIFAR-10). Additionally, while the method is motivated by theory, the impact of using stale diversity estimates on formal convergence guarantees requires further study. Future work could involve combining DIVEBATCH with other optimization techniques like quantization or popular adaptive optimizers like AdamW to see if the speedups are additive.

Summary updated

BibTeX
@misc{chen2025divebatch,
  author = {Yuen Chen and Yian Wang and Hari Sundaram},
  title = {{DIVEBATCH: Accelerating Model Training Through Gradient-Diversity Aware Batch Size Adaptation}},
  year = {2025},
  eprint = {2509.16173},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.16173},
}
Figure