DEEP LEARNING · INTERVIEW QUESTION
Explain batch normalization. Why does it help training?
🟡 intermediate · CNNs
Hint: Think about internal covariate shift, the learnable parameters γ and β, and train vs inference behavior.
Answer
Batch Normalization normalizes activations to zero mean and unit variance within each mini-batch, then applies learnable scale () and shift ().
Benefits
- Original motivation: internal covariate shift — this is not an established complete explanation of its benefits
- Allows higher learning rates — faster training
- Acts as regularization — noise from batch statistics
- Smooths the loss landscape — easier optimization
Training vs Inference
| Phase | Statistics Used |
|---|---|
| Training | Batch mean/variance |
| Inference | Running averages |
Normalization Variants
| Method | Normalizes Across | Best For |
|---|---|---|
| BatchNorm | Batch dimension | CNNs (batch ≥ 16) |
| LayerNorm | Feature dimension | Transformers, RNNs |
| GroupNorm | Channel groups | Small batch sizes |
| InstanceNorm | Single sample | Style transfer |
Key limitation: Training needs more than one value per channel to estimate useful batch statistics. BatchNorm2d can still work at batch size 1 when spatial positions provide multiple values; inference can use stored running statistics. Use LayerNorm (preferred in Transformers) or GroupNorm instead.