How to Set the Batch Size for Large-Scale Pre-training?

Yunhua Zhou, Junhao Huang, Shuhao Xing, Yechen Zhang, Runyu Peng, Qiping Guo, Xipeng QiuarXiv 2026

TL;DR

Modern Large Language Models (LLMs) have largely transitioned to Warmup-Stable-Decay (WSD) learning rate schedules, yet practitioners still rely on OpenAI's classic "Critical Batch Size" theory—which was built for cosine schedules—to configure training. This paper demonstrates that the classic theory completely breaks down under WSD because training loss curves intersect. By deriving a new theoretical framework tailored for WSD, the authors introduce a dynamic batch size scheduler that significantly optimizes data efficiency and boosts downstream model performance.

What Problem Does This Paper Address?

When training massive foundation models, setting the batch size is a high-stakes balancing act. Set it too small, and you waste compute through under-utilized hardware; set it too large, and you waste tokens due to diminishing returns in optimization efficiency.

In 2018, OpenAI formalized this trade-off using the concept of Critical Batch Size, deriving a famous formula ($E(S)$) that predicts how much data ($E$) you need to hit a target loss given a specific number of optimization steps ($S$). However, this framework assumes a monotonic relationship where smaller batch sizes always consume fewer total tokens to reach a given loss.

The authors of this paper noticed a glaring problem: modern pre-training regimes heavily favor Warmup-Stable-Decay (WSD) learning rate schedulers over traditional cosine schedules. Under WSD, the training curves of different batch sizes actually intersect at lower target losses. This means classical batch size theory fails in modern settings, leaving engineers without a reliable mathematical compass for large-scale pre-training.

Figure 1: Loss curves for models trained with different batch sizes (Stable phase under WSD schedule). The red region denotes the regime where the 𝐸(𝑆) formula and Critical Batch Size theory remain valid. In the green region, the 𝐸(𝑆) relationship no longer holds, leading to a failure of the Critical Batch Size framework. Post-intersection, the partial ordering of data consumption among the various batch sizes is inverted.

Methods

To bridge this gap, the authors re-analyzed stochastic gradient descent (SGD) dynamics under a constant learning rate (the "Stable" phase of WSD). They derived a new, tripartite piecewise $E(S)$ formula consisting of:

  1. An initial stage: Where data consumption fluctuates inversely with steps.
  2. A transition stage: Modeled as a quadratic function.
  3. An asymptotic stage: Where data consumption increases linearly with steps.

Using Huber loss minimization and scaling laws to efficiently fit the formula's parameters, they uncovered two critical metrics:

  • Threshold Constraint ($B_{min}$): The absolute physical minimum batch size required to ever achieve a specific target loss. Below this, training stagnates.
  • Efficiency Optimality ($B_{opt}$): The optimal batch size that minimizes the total number of tokens required to reach the target loss.

Because both $B_{min}$ and $B_{opt}$ scale up monotonically as the training loss decreases, the authors designed a Dynamic Batch Size Scheduler (Algorithm 1). Instead of keeping the batch size static, their scheduler progressively scales up the batch size over the course of pre-training based on cumulative data consumption.

Figure 2: Fitting results of 𝐸(𝑆) for 1B model. We select the target loss interval as [2.93, 3.25] and perform fitting on the 𝐸(𝑆) curves for target losses within this interval.

Datasets

The authors utilized the InternLM2 corpus for their initial curve-fitting and scaling experiments, which includes a high-quality mix of general text, code (from GitHub), and long-context data.

For downstream evaluation, they tested the trained models using the MMLU (Massive Multitask Language Understanding) and CMMLU (a comprehensive Chinese language benchmark) datasets via the OpenCompass evaluation platform.

Key Insights and Ideas

  • The Intersection Paradox: Under WSD, a larger batch size can actually be more data-efficient than a smaller batch size at lower target losses. This completely upends classical training intuition.
  • A Moving Sweet Spot: Because the optimal batch size ($B_{opt}$) grows continuously as the model learns, any static batch size configuration is mathematically guaranteed to be suboptimal across an entire training run.
  • Rethinking Learning Rate Scaling: Conventional wisdom dictates that when you increase batch size, you must scale up the learning rate (e.g., via a square-root or linear rule). The authors found that under WSD, keeping the learning rate constant while dynamically increasing the batch size yields better results, as higher learning rates amplify gradient noise and cancel out the benefits of larger batches.
Figure 3: The variation of 𝐵𝑚𝑖𝑛and 𝐵𝑜𝑝𝑡with respect to loss across different model sizes.

Key Results

The dynamic batch size scheduler was validated on Qwen3 MoE (4B total / 538M active parameters) and Qwen3 Dense (2B parameters) models:

  • Better Convergence: The dynamic strategy (scaling batch size from 2M to 6M tokens at 125B-token intervals) consistently achieved lower training loss than the fixed 4M baseline, yielding a loss reduction of $\Delta L = 0.04$ for the MoE model and $\Delta L = 0.03$ for the Dense model.
  • Downstream Gains: The lower training loss translated directly to superior performance on MMLU and CMMLU benchmarks throughout the stable and final data-annealing phases.

Limitations and Future Work

Despite its empirical success, the authors note a few limitations:

  1. Compute Constraints: Due to the massive cost of pre-training, curve fitting was restricted to a single baseline learning rate ($6 \times 10^{-4}$). How these dynamics shift across a wider range of learning rates remains unexplored.
  2. Lack of Formal Proof: While the framework is grounded in first principles and heavily validated by data, the dynamic scheduling strategy itself is empirically driven and lacks a rigorous mathematical proof.
  3. Sequence Length Instabilities: The authors tried increasing batch size by extending the sequence length (seqlen) rather than increasing the micro-batch size. However, this caused severe distribution shifts and temporary training instability, an issue they leave for future research.

Summary updated

BibTeX
@misc{zhou2026how,
  author = {Yunhua Zhou and Junhao Huang and Shuhao Xing and Yechen Zhang and Runyu Peng and Qiping Guo and Xipeng Qiu},
  title = {{How to Set the Batch Size for Large-Scale Pre-training?}},
  year = {2026},
  eprint = {2601.05034},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.05034},
}
Figure