mlsanityData to 14 Oct 2026

Adaptive Batch Size Schedules for Distributed Training of Language Models with Data and Model Parallelism

arXiv 2412.21124 ↗First posted 30 Dec 2024cs.LG math.OC stat.MLcited by 4

Not on the map. Why?

Abstract (arXiv)

An appropriate choice of batch sizes in large-scale model training is crucial, yet it involves an intrinsic yet inevitable dilemma: large-batch training improves training efficiency in terms of memory utilization, while generalization performance often deteriorates due to small amounts of gradient noise. Despite this dilemma, the common practice of choosing batch sizes in language model training often prioritizes training efficiency -- employing either constant large sizes with data parallelism or implementing batch size warmup schedules. However, such batch size schedule designs remain heuristic and often fail to adapt to training dynamics, presenting the challenge of designing adaptive batch size schedules. Given the abundance of available datasets and the data-hungry nature of language models, data parallelism has become an indispensable distributed training paradigm, enabling the use of larger batch sizes for gradient computation. However, vanilla data parallelism requires replicas of model parameters, gradients, and optimizer states at each worker, which prohibits training larger models with billions of parameters. To optimize memory usage, more advanced parallelism strategies must be employed. In this work, we propose general-purpose and theoretically principled adaptive batch size schedules compatible with data parallelism and model parallelism. We develop a practical implementation with PyTorch Fully Sharded Data Parallel, facilitating the pretraining of language models of different sizes. We empirically demonstrate that our proposed approaches outperform constant batch sizes and heuristic batch size warmup schedules in the pretraining of models in the Llama 2 family, with particular focus on smaller models with up to 3 billion parameters. We also establish theoretical convergence guarantees for such adaptive batch size schedules with Adam for general smooth nonconvex objectives.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 62 of its 81 references that are in the map. First posted on arXiv 30 Dec 2024.

Builds on

62 of 81 references.

References · 62

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
  4. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,305
  5. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  6. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
  7. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  8. 2020Scaling Laws for Neural Language Modelscited by 6,586
  9. 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,512
  10. 2023Qwen Technical Reportcited by 3,344
  11. 2024Qwen2 Technical Reportcited by 2,120
  12. 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,998
38 more
  1. 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,868
  2. 2020GShard: Scaling Giant Models with Conditional Computation and Automatic Shardingcited by 1,631
  3. 2017Accurate, Large Minibatch SGD: Training ImageNet in 1 Hourcited by 1,492
  4. 2016On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minimacited by 1,352
  5. 2019ZeRO: Memory Optimizations Toward Training Trillion Parameter Modelscited by 1,301
  6. 2016Optimization Methods for Large-Scale Machine Learningcited by 1,150
  7. 2024Gemma: Open Models Based on Gemini Research and Technologycited by 916
  8. 2019Large Batch Optimization for Deep Learning: Training BERT in 76 minutescited by 674
  9. 2023Baichuan 2: Open Large-scale Language Modelscited by 670
  10. 2023PyTorch FSDP: Experiences on Scaling Fully Sharded Data Parallelcited by 660
  11. 2021Efficient Large-Scale Language Model Training on GPU Clusters Using Megatron-LMcited by 632
  12. 2024TinyLlama: An Open-Source Small Language Modelcited by 618
  13. 2024OLMo: Accelerating the Science of Language Modelscited by 613
  14. 2022Using DeepSpeed and Megatron to Train Megatron-Turing NLG 530B, A Large-Scale Generative Language Modelcited by 559
  15. 2021ZeRO-Offload: Democratizing Billion-Scale Model Trainingcited by 341
  16. 2017Don't Decay the Learning Rate, Increase the Batch Sizecited by 320
  17. 2022Reducing Activation Recomputation in Large Transformer Modelscited by 302
  18. 2018An Empirical Model of Large-Batch Trainingcited by 281
  19. 2017Train longer, generalize better: closing the generalization gap in large batch training of neural networkscited by 279
  20. 2018Measuring the Effects of Data Parallelism on Neural Network Trainingcited by 193
  21. 2023Small-scale proxies for large-scale Transformer training instabilitiescited by 183
  22. 2023Stabilizing Transformer Training by Preventing Attention Entropy Collapsecited by 161
  23. 2020Better Theory for SGD in the Nonconvex Worldcited by 158
  24. 2017A Bayesian Perspective on Generalization and Stochastic Gradient Descentcited by 135
  25. 2024Why Transformers Need Adam: A Hessian Perspectivecited by 124
  26. 2024Scalable Pre-training of Large Autoregressive Image Modelscited by 115
  27. 2023Noise Is Not the Main Factor Behind the Gap Between SGD and Adam on Transformers, but Sign Descent Might Becited by 114
  28. 2024Stable LM 2 1.6B Technical Reportcited by 90
  29. 2024TorchTitan: One-stop PyTorch native solution for production ready LLM pre-trainingcited by 85
  30. 2024Heavy-Tailed Class Imbalance and Why Adam Outperforms Gradient Descent on Language Modelscited by 80
  31. 2024How Does Critical Batch Size Scale in Pre-training?cited by 73
  32. 2023Toward Understanding Why Adam Converges Faster Than SGD for Transformerscited by 53
  33. 2023Scaling laws for single-agent reinforcement learningcited by 41
  34. 2023Closing the Gap Between the Upper Bound and the Lower Bound of Adam's Iteration Complexitycited by 38
  35. 2021The Stability-Efficiency Dilemma: Investigating Sequence Length Warmup for Training GPT Modelscited by 36
  36. 2024Nemotron-4 15B Technical Reportcited by 36
  37. 2016Coupling Adaptive Batch Sizes with Learning Ratescited by 30
  38. 2017Adaptive Sampling Strategies for Stochastic Optimizationcited by 30

50 most cited of 62 All 62 (JSON)

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 4.

4 papers.