batch normalization
Batch normalization, often shortened to BatchNorm, is a technique for training deep neural networks that rescales a layer’s inputs so that each feature has roughly zero mean and unit variance across a mini-batch. A mini-batch is the small group of training examples the network processes in one step. The technique lets networks train faster and tolerate higher learning rates.
Sergey Ioffe and Christian Szegedy introduced it in a 2015 paper. For each feature or channel, a batch normalization layer subtracts the mini-batch mean and divides by the mini-batch standard deviation. It then applies a learned scale and shift, two extra parameters that let the network undo the normalization where that helps.
The widget below tracks one feature across a mini-batch of eight examples. It shows the raw inputs, the normalized values, and the output after the learned scale and shift:
During training, the layer also keeps running averages of the mean and variance. At inference time, it uses those stored averages instead of batch statistics, so a single input gets the same output no matter what else is in the batch.
The original paper credited the speedup to reducing internal covariate shift, the drift in each layer’s input distribution as earlier layers update. A 2018 study by Santurkar and colleagues argued instead that the main benefit is a smoother loss landscape. Either way, it eases the vanishing gradient problem and adds mild regularization through batch noise.
Batch normalization became standard in convolutional networks such as ResNet, where it sits alongside residual connections. Its reliance on batch statistics makes it unreliable with small batches and awkward for sequence models. Transformers and large language models use layer normalization or RMSNorm instead, which normalize across the features of each example on its own.
Related Resources
Tutorial
Python AI: How to Build a Neural Network & Make Predictions
In this step-by-step tutorial, you'll build a neural network from scratch as an introduction to the world of artificial intelligence (AI) in Python. You'll learn how to train your neural network and make accurate predictions based on a given dataset.
For additional information on related topics, take a look at the following resources:
- Building a Neural Network & Making Predictions With Python AI (Course)
- PyTorch vs TensorFlow for Your Python Deep Learning Project (Tutorial)
- Python Deep Learning: PyTorch vs Tensorflow (Course)
- Use TorchAudio to Prepare Audio Data for Deep Learning (Tutorial)
- Python AI: How to Build a Neural Network & Make Predictions (Quiz)
- Use TorchAudio to Prepare Audio Data for Deep Learning (Quiz)
Have a question about this? Mentor AI can show you examples, compare related terms, and point you to tutorials.
By Martin Breuss • Updated Nov. 25, 2026