In plain words
A model learns by making guesses on examples, measuring how wrong it was, and nudging its internal numbers to do better. The question is how many examples it should look at before each nudge.
That number is the batch size. With a batch size of one, the model adjusts after every single example: lots of quick, jittery steps. With a batch as big as the whole dataset, it adjusts once per full pass: one careful step that is slow to compute. Most training sits in between, with batches of tens to hundreds of examples.
Batch size is chosen by people before training, so it is a hyperparameter. It affects speed, memory use on the chip doing the work, and sometimes how well the finished model does on new data.
Everyday example
Checking homework
A tutor has 40 maths worksheets to mark. She could give the student feedback after every worksheet: quick, but each comment is based on one sheet and may be a fluke. She could wait and give one summary after all 40: well-informed, but rare. Or she could give feedback after every 8 sheets. That middle option is how most AI models are trained.
Where the example breaks: The tutor's feedback is in words. A model's feedback is the average gradient over the batch, a precise number for every internal setting, and the batches are shuffled at random rather than taken in order.
How it actually works
Google's glossary: batch size is "the number of examples in a batch", and a batch is "the set of examples used in one training iteration".
Three regimes
Batch size 1 is stochastic gradient descent (SGD): cheap steps, very noisy. Full batch uses the whole training set for every step, usually inefficient. Mini-batch, typically 10 to 1,000 examples according to Google's glossary, is usually the most efficient.
Steps per epoch
One epoch is a pass through all the training data, so updates per epoch = examples ÷ batch size. With 1,000 examples and a batch of 100, the model updates 10 times per epoch.
Noise can help
A small batch gives a rough estimate of the true direction downhill. That noise can stop training settling into a poor spot. Keskar and colleagues (2016) found very large batches tended to reach "sharp" solutions that generalised worse.
Hardware sets limits
Chips such as GPUs process a batch in parallel, so bigger batches use the hardware better, up to the limit of its memory.
Big batches need care
Goyal and colleagues (2017) trained an image model with batches of 8,192 images without losing accuracy by raising the learning rate in proportion to the batch size and warming it up gradually.
- Batch size 1
- Stochastic gradient descent (SGD)
- Usual range
- Mini-batches of about 10 to 1,000 examples (Google glossary)
- Updates per epoch
- Number of training examples divided by batch size
- Large-batch record
- 8,192 images per batch on 256 GPUs, about one hour to train on ImageNet (Goyal et al., 2017)
Questions people ask
What is batch size in simple terms?
The number of training examples a model processes before it updates its internal numbers once. A batch size of 32 means it looks at 32 examples, averages what it learned from them, then makes one adjustment.
What is the difference between batch size and epoch?
Batch size is how many examples go into one update. An epoch is one complete pass through all the training data. With 1,000 examples and a batch size of 100, one epoch contains 10 updates.
Is a bigger batch size better?
Not automatically. Bigger batches use hardware efficiently and give smoother steps, but need more memory, and very large ones can generalise worse unless the learning rate is adjusted. Smaller batches are noisier, which sometimes helps.
What batch size should I use?
It depends on the data and the memory of the hardware, so it is tuned like other settings. Google's glossary says mini-batches are usually between 10 and 1,000 examples. Change the learning rate along with it.
Further reading
- Machine Learning Glossary: batch, batch size, mini-batchGoogle for Developers, 2026
- Machine Learning Crash Course: Linear regression, hyperparametersGoogle for Developers, 2026
- On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minima (Keskar et al.)arXiv, 2016
- Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour (Goyal et al.)arXiv, 2017