Skip to content

Batch Size

The number of examples a model processes in one step of training before updating weights.

How It Works

Instead of computing the error on one example, the model takes a batch of N examples, averages the gradient, and makes one step.

Large vs Small

Large batch Small batch
Memory High Low
Step More stable Noisier, but more flexible
Speed Faster on GPU Slower

How to Choose

The almost universal constraint is GPU memory. Choose the largest batch that fits in VRAM and adjust the learning rate accordingly.

See Also

← All Terms