Your batch size should have a schedule, too
Created:
TL;DR. Batch size should be proportional to the current learning rate divided by the square root of the remaining area under the learning-rate curve, then normalized to keep the total token budget fixed. The resulting schedule depends on the LR shape, not its peak value.
We warm up the learning rate. We decay it. Yet we often keep the batch size fixed. Could the same training tokens do more useful work if we changed when we spent them?
In our paper, with Zhiqi Bu and Shiyun Xu, we derive a batch-size schedule from a planned learning-rate schedule, then test it on language and vision-language models. The idea is to redistribute a fixed budget across updates, rather than simply use more data.
Llama3 scaling experiments
Qwen3 MoE scaling experiments
across optimizer updates
The efficiency figures are reported in Figure 5. They are compute comparisons, not measured wall-clock speedups.
- 1. Look at both tokens and steps
- 2. Let the learning-rate shape choose the batches
- 3. Spend the budget where it reduces noise most
- 4. Scale the whole recipe
- 5. Check the downstream trade-offs
- 6. What to try in a training run
- Citation
1. Look at both tokens and steps
A larger batch processes more tokens per update. The two views of Figure 1 tell a complementary story: the ordinary dynamic schedule improves final loss, while a larger average batch reaches the reference loss in fewer optimizer updates at a similar token budget. Compare iterations on the left with tokens on the right.
Figure 1 / Pre-training
Larger batches: fewer updates to the same loss
Optimizer iterations
Loading interactive chart...
Training tokens
Loading interactive chart...
Source: Figure 1, FineWeb-Edu at a fixed 1020-FLOP budget. Curves are approximate reconstructions; iteration-reduction labels are taken from the paper.
2. Let the learning-rate shape choose the batches
The answer is not always an increasing ramp. Cosine calls for a rise and fall. WSD calls for a rise followed by a plateau during cooldown. Linear decay gives a constant batch size. Change the peak learning rate below: the batch-size shape stays the same.
Table 2 / Schedule explorer
Choose a learning-rate shape
- Learning rate here
- Ideal batch here
- Budget used here
Hover a plot or use the progress slider to align all three cursors: learning rate, batch size, and the token budget consumed at the same point in training.
Computed from Table 2, without warmup or integer-batch rounding. Fixed sequence length is assumed, so equal total sequences imply equal total tokens. The constant-LR curve has a singular endpoint and is displayed only up to 99.5% of training; cosine approaches zero. Real runs need feasible batch bounds and rounding.
The schedule formulas and why peak learning rate cancels
Fix the learning-rate schedule $\eta(t)$, the horizon $T$, and a total budget $K$. Define the remaining learning-rate area and its associated noise weight:
\[S(t)=\int_t^T\eta(s)\,ds, \qquad w(t)=\frac{\eta(t)^2}{S(t)}.\]Theorem 3 gives
\[B^*(t) =K\frac{\sqrt{w(t)}}{\int_0^T\sqrt{w(s)}\,ds} =\frac{K\eta(t)}{2\sqrt{S(0)S(t)}}.\]The normalization uses $\int_0^T\eta(t)/\sqrt{S(t)}\,dt=2\sqrt{S(0)}$, so $\int_0^T B^*(t)\,dt=K$. If $\eta(t)=a f(t)$ and $F(t)=\int_t^T f(s)\,ds$, then
\[B^*(t) =\frac{Kaf(t)}{2\sqrt{aF(0)\,aF(t)}} =\frac{Kf(t)}{2\sqrt{F(0)F(t)}}.\]The peak multiplier $a$ cancels. That is why changing peak learning rate in the explorer changes the LR plot but leaves the batch allocation unchanged.
For the shapes in Table 2, set $x=t/T$, $\bar B=K/T$, and $\beta(x)=B^*(xT)/\bar B$:
\[\begin{aligned} \beta_{\mathrm{constant}}(x)&=\frac{1}{2\sqrt{1-x}},\\ \beta_{\mathrm{linear}}(x)&=1,\\ \beta_{\mathrm{cosine}}(x)&= \frac{\cos^2(\pi x/2)}{\sqrt{1-x-\sin(\pi x)/\pi}}. \end{aligned}\]For WSD, let $c$ be the fraction of training before linear cooldown begins:
\[\beta_{\mathrm{WSD}}(x)= \begin{cases} \displaystyle\frac{1}{\sqrt{(1+c-2x)(1+c)}},&0\le x\le c,\\[6pt] \displaystyle\frac{1}{\sqrt{1-c^2}},&c<x\le1. \end{cases}\]Endpoint values are interpreted as limits. The derivation optimizes a convex-SGD loss characterization with fixed learning-rate schedule and horizon. Its usefulness for nonconvex neural networks and adaptive optimizers is tested empirically, rather than guaranteed by that theorem.
3. Spend the budget where it reduces noise most
In the characterization, noise from different updates carries different weight in the final loss. A constant batch spends equally on unequal contributions. Move the slider from static to derived, then keep going: exaggerating the allocation can give back the benefit.
Theorem 3 / Budget allocation
Find the useful amount of scheduling
0 = static / 1 = derived schedule / 2 = exaggerated schedule
Hover either plot to align both cursors at the same training progress: . Compare the batch allocated here with the noise contribution accumulated so far.
A numerical illustration of the batch-dependent noise term in Equation 3.3. Every allocation uses the same total budget. The right plot accumulates this term over training, normalized by the static schedule's full-run value; its endpoint matches the comparison above. The derived schedule minimizes the full-run total, not every intermediate cumulative value. This is not an observed training curve or a prediction of total LLM loss. For linear decay, the derived schedule is already static.
The allocation objective, a short proof, and what the slider changes
Up to a fixed positive factor, the batch-dependent part of the loss characterization is
\[J[B]=\int_0^T\frac{w(t)}{B(t)}\,dt, \qquad \int_0^T B(t)\,dt=K, \qquad w(t)=\frac{\eta(t)^2}{S(t)}.\]The budget couples all updates: increasing one batch leaves fewer examples for others. Cauchy-Schwarz gives the best achievable value directly:
\[\begin{aligned} \left(\int_0^T\sqrt{w(t)}\,dt\right)^2 &=\left(\int_0^T \sqrt{\frac{w(t)}{B(t)}}\sqrt{B(t)}\,dt\right)^2\\ &\le \left(\int_0^T\frac{w(t)}{B(t)}\,dt\right) \left(\int_0^T B(t)\,dt\right)\\ &=KJ[B]. \end{aligned}\]Equality holds when $B(t)$ is proportional to $\sqrt{w(t)}$. Normalizing to the budget gives $B^*$ and
\[J[B^*]=\frac{1}{K} \left(\int_0^T\sqrt{w(t)}\,dt\right)^2.\]The allocation-strength slider explores a budget-matched family around that solution:
\[B_\alpha(t) =K\frac{[B^*(t)]^\alpha} {\int_0^T[B^*(s)]^\alpha\,ds}.\]At $\alpha=0$, this is the static schedule $B_{\mathrm{static}}=K/T$. At $\alpha=1$, it is the derived optimum. Larger values exaggerate the shape. Every choice still integrates to $K$.
The right-hand plot shows cumulative noise contribution at progress $x$:
\[C_\alpha(x)= \frac{\displaystyle\int_0^{xT}\frac{w(t)}{B_\alpha(t)}\,dt} {\displaystyle\int_0^T\frac{w(t)}{B_{\mathrm{static}}}\,dt}.\]Its endpoint $C_\alpha(1)=J[B_\alpha]/J[B_{\mathrm{static}}]$ is the displayed noise-term ratio. The optimum minimizes the full-run term; it need not minimize its cumulative value at every intermediate time. These are calculations from the characterization, not measured LLM losses.
4. Scale the whole recipe
For a training horizon four times longer, the joint recipe halves both peak learning rate and weight decay. The normalized batch shape is unchanged; the budget sets its overall size. This combines batch scheduling with a transfer rule for the other hyperparameters.
Section 4 / Scaling recipe
Plan a longer training run
- Peak LR, starting from 0.01
- Weight decay, starting from 0.1
The 1 / square-root-of-horizon rule in Equation 4.1. The starting values are illustrative, not tuned recommendations. Figure 5's reported compute gains use joint scaling and the dynamic batch schedule; they are distinct from Figure 1's reductions in optimizer steps.
The horizon-transfer equations
Let $r=T/T_{\mathrm{ref}}$ compare a new horizon with a reference run. The joint rule in Equation 4.1 is
\[\eta_{\mathrm{peak}}(T) =\frac{\eta_{\mathrm{peak,ref}}}{\sqrt r}, \qquad \kappa(T)=\frac{\kappa_{\mathrm{ref}}}{\sqrt r},\]where $\kappa$ is weight decay. At $r=4$, both multipliers are $1/2$. For a fixed normalized learning-rate shape, the batch schedule can be written
\[B_T^*(t)=\frac{K}{T}\,\beta(t/T).\]The shape $\beta$ is unchanged, while $K/T$ sets its average size. Keeping total tokens fixed and keeping average batch fixed are different choices: the former changes the average as $T$ changes; the latter changes the total token budget. The explorer illustrates the transfer factors, rather than prescribing tuned starting values.
5. Check the downstream trade-offs
Better validation loss should also be checked against the tasks we care about. In Table 1, the dense model improves on all eight reported benchmarks. The MoE model improves on seven, with a small ARC-Challenge regression. Inspect the exact scores below.
Table 1 / Last-iterate evaluation
Which benchmarks improve?
Exact values from Table 1, evaluated with lm-evaluation-harness v0.4. Differences are percentage points, not relative percentages. Hover or focus the chart to inspect individual tasks.
Can changing the batch simply replace learning-rate decay?
Matching the learning-rate-to-batch ratio does not make two runs equivalent. Appendix C.5 compares schedules with the same ratio trajectory and total token budget: realizing the schedule through the learning rate gives lower final loss in every reported comparison.
Table 4 / A useful counterexample
Same ratio, different final loss
Source: Table 4. Lower loss is better. The paper's reported gaps can differ slightly from subtracting its rounded printed losses. This experiment tests interchangeability; it is separate from comparing the derived schedule against static batches.
6. What to try in a training run
Keep the comparison simple: fix the model, sequence length, token budget, and learning-rate schedule, then compare static batches with the derived allocation. Implement feasible effective batches with rounding and appropriate gradient accumulation. Check tokens, FLOPs, wall time, and downstream quality separately.
The benefit is not universal. It shrinks as the baseline batch grows, and the paper finds that it can disappear in purely low-precision training. Those are reasons to test the recipe in your own stack, not to assume a headline gain will transfer unchanged.
The takeaway: batch size is a schedule worth designing alongside learning rate. The useful question is where each token does the most work.
Citation
If you find this work useful, please cite our paper:
@misc{li2026jointscaling,
title = {Towards joint scaling laws with optimal batch size schedules},
author = {Jiaxiang Li and Zhiqi Bu and Shiyun Xu},
year = {2026},
eprint = {2607.27731},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
doi = {10.48550/arXiv.2607.27731},
url = {https://arxiv.org/abs/2607.27731}
}