Large Batch Training › Worked Example: Training with Different Batch Sizes
Language AI HandbookAll chapters Large Batch Training › Worked Example: Training with Different Batch SizesOne section · Sections in this chapter4 / 12 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Let us work through a concrete example to make the scaling rule tangible. Suppose you have determined through experimentation that batch size trains well with learning rate using SGD.
You now want to scale to a 64-GPU cluster where, to keep all GPUs busy, you need to use at least 16,384 examples per step.
The scaling factor is:
The linearly scaled learning rate is:
For warmup, a common practice is to linearly increase the learning rate from a small initial value to the target over the first few epochs, often 5 epochs for ImageNet-scale tasks.
At the end of training, the model has processed the same number of gradient updates relative to data seen. If the original run did 100 epochs of 1,000 steps with batch size 256, the scaled run does 100 epochs of roughly 16 steps with batch size 16,384. The same amount of data is processed overall, but in far fewer, more accurate steps.
In practice, this specific example is near the edge of where the rule holds. For batch sizes beyond roughly 8,192 on ImageNet, researchers have found that extra techniques (gradient noise injection, LARS/LAMB, more aggressive warmup) are needed to maintain quality. This example sits at 16,384, so you would likely need at least LAMB or careful warmup tuning to close the generalization gap.