On the Role of Batch Size in Stochastic Conditional Gradient Methods
Organizations: University of Basel, Switzerland · MBZUAI, UAE · University of Bern, Switzerland · CentraleSupélec, France ·
Abstract
We study the role of batch size in stochastic conditional gradient methods under a -Kurdyka-Łojasiewicz (-KL) condition. Focusing on momentum-based stochastic conditional gradient algorithms (e.g., Scion), we derive a new analysis that explicitly captures the interaction between stepsize, batch size, and stochastic noise. Our study reveals a regime-dependent behavior: increasing the batch size initially improves optimization accuracy but, beyond a critical threshold, the benefits saturate and can eventually degrade performance under a fixed token budget. Notably, the theory predicts the magnitude of the optimal stepsize and aligns well with empirical practices observed in large-scale training. Leveraging these insights, we derive principled guidelines for selecting the batch size and stepsize, and propose an adaptive strategy that increases batch size and sequence length during training while preserving convergence guarantees. Experiments on NanoGPT are consistent with the theoretical predictions and illustrate the emergence of the predicted scaling regimes. Overall, our results provide a theoretical framework for understanding batch size scaling in stochastic conditional gradient methods and offer guidance for designing efficient training schedules in large-scale optimization.
Figures & tables
| Regime | Tuned at | Transfer Rule to | |||||
| FW Stepsize / LR | Batch Size | Momentum | FW Stepsize / LR | Batch Size | Momentum | ||
| Increasing | \beta_{1}=\beta_{0}^{\star}{\color[rgb]{0.7,0,0}\left(\frac{T_{1}}{T_{0}}\right)^{-1/3}}\chi_{0\to 1}^{2/3} | B_{1}S_{1}=B_{0}^{\star}S_{0}^{\star}{\color[rgb]{0.7,0,0}\left(\frac{T_{1}}{T_{0}}\right)^{2/3}}\chi_{0\to 1}^{2/3} | |||||
| Token Budget | |||||||
| Increasing | |||||||
| Token Budget and | |||||||
| Model Size | |||||||
| B | Batch Size | ||||||
| 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | |
| 1.2 | 3.4258 ±0.0004 | 3.3889 ±0.0012 | 3.3857 ±0.0013 | 3.4074 ±0.0010 | 3.4587 ±0.0010 | 3.5598 ±0.0012 | 3.7715 ±0.0013 |
| 2.4 | 3.4394 ±0.0007 | 3.3880 ±0.0043 | 3.3706 ±0.0019 | 3.3801 ±0.0016 | 3.4144 ±0.0004 | 3.4940 ±0.0009 | 3.6694 ±0.0021 |
| 3.6 | 3.4554 ±0.0008 | 3.3945 ±0.0015 | 3.3717 ±0.0020 | 3.3765 ±0.0017 | 3.4065 ±0.0007 | 3.4799 ±0.0017 | 3.6472 ±0.0023 |
| 4.8 | 3.4766 ±0.0016 | 3.4072 ±0.0048 | 3.3790 ±0.0013 | 3.3807 ±0.0006 | 3.4115 ±0.0025 | 3.4945 ±0.0038 | 3.6611 ±0.0020 |
| 6.0 | 3.4967 ±0.049 | 3.4198 ±0.0002 | 3.3875 ±0.0019 | 3.3887 ±0.0024 | 3.4202 ±0.0022 | 3.5005 ±0.0038 | 3.7013 ±0.0160 |
| B | Sequence Length | ||||
| 256 | 512 | 1024 | 2048 | 4096 | |
| 1.2 | 3.7076 ±0.0084 | 3.4647 ±0.0240 | 3.4587 ±0.0010 | 3.4126 ±0.0014 | 3.4811 ±0.0025 |
| 2.4 | 3.9622 ±0.0585 ∗ | 3.4633 ±0.0091 | 3.3706 ±0.0019 | 3.3834 ±0.0026 | 3.4299 ±0.0021 |
| 3.6 | 4.0441 ±0.2055 ∗ | 3.4796 ±0.0131 | 3.3717 ±0.0020 | 3.3792 ±0.0022 | 3.4216 ±0.0013 |
| 4.8 | 3.9292 ±0.0852 ∗ | 3.5004 ±0.0063 | 3.3790 ±0.0013 | 3.3829 ±0.0020 | 3.4243 ±0.0029 |
| 6.0 | 3.9901 ±0.0170 ∗ | 3.5134 ±0.0059 | 3.3875 ±0.0019 | 3.3910 ±0.0024 | 3.4374 ±0.0037 |
| Model | How to change w.r.t. 124M model? | How to change w.r.t. 124M model? | |||
| 124M | |||||
| 1B |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | 124M Model | 775M Model | 1B Model |
| Layers | 12 | 36 | 18 |
| Heads | 6 | 20 | 16 |
| Embedding Size | 768 | 1280 | 2048 |
| Weight Tying | Yes | ||
| Activation Function | ReLU 2 | ||
| Vocabulary Size | 50304 | ||
| n_embd n_layer | 3 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 |
| 384 | – | 5.3 | 6.2 | 6.5 | 6.2 | 18 | 7.6 | – | 27 | 7.84 |
| 576 | – | 6.4 | 7.7 | 7.0 | 7.4 | – | 7.5 | 8.5 | 7.9 | 8.2 |
| 768 | 6.1 | 6.5 | 6.9 | 7.6 | 8.3 | 18 | 9.9 | 8.5 | 8.7 | 10.0 |
| 1152 | – | – | – | 8.8 | 9.4 | 10.8 | 9.5 | – | – | – |
| 1536 | 3 | 7.9 | 9.2 | 12 | 9.9 | – | – | – | – | – |
| 2304 | – | 9.9 | – | – | – | – | – | – | – | – |
| n_embd n_layer | 3 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 |
| 384 | – | 35.5 | 41.3 | 48.2 | 48.7 | – | 50.7 | – | – | 58.0 |
| 576 | – | 42.1 | 53.8 | 61.1 | 62.9 | – | 64.2 | 64.6 | 66.2 | 68.6 |
| 768 | 31.2 | 52.6 | 64.1 | 67.1 | 72.4 | – | 80.2 | 87.0 | 86.3 | 89.2 |
| 1152 | – | – | – | 76.6 | 81.1 | 87.3 | — | – | – | – |
| 1536 | – | 67.5 | 77.4 | – | – | – | – | – | – | – |
| 2304 | – | – | – | – | – | – | – | – | – | – |
| batch_size | 256 | 512 | 1024 | 2048 | 4096 |
| 48.9 | 52.6 | 55.0 | 56.4 | 57.9 |
| n_embd n_layer | 3 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 |
| 384 | – | 3.4 | 3.1 | 3.1 | 3.0 | – | 2.9 | – | – | 2.7 |
| 576 | – | 3.3 | 3.2 | 3.0 | 2.9 | – | 2.7 | 2.6 | 2.5 | 2.4 |
| 768 | 3.7 | 3.2 | 3.0 | 2.9 | 2.8 | – | 2.6 | 2.5 | 2.3 | 2.4 |
| 1152 | – | – | – | 2.7 | 2.7 | 2.8 | 2.6 | – | 2.5 | – |
| 1536 | – | 3.2 | 2.9 | – | 2.9 | 3.0 | – | – | – | – |
| 2304 | – | 3.6 | – | – | – | – | – | – | – | – |
Stochastic Optimization
Stochastic optimization studies how to find good decisions or model parameters when objectives, data, or feedback are random or noisy.
See all 210 papers