DEEP LEARNING · INTERVIEW QUESTION
Why can batch normalization behave poorly when training with very small per-device batch sizes?
🔴 advanced · Normalization · Batchnorm
Hint: Focus on the decision rule, assumptions, and failure mode behind normalization · batchnorm.
Answer
BN estimates mean and variance from each batch. Small batches produce noisy estimates; layer/group normalization or synchronized BN may help.
Interview reasoning
BatchNorm moments are computed per microbatch unless synchronized. Accumulating gradients does not aggregate those activation statistics.
Batch normalization uses minibatch and spatial statistics during training and running statistics at evaluation. Small per-device batches, correlated examples or changing domains make estimates unreliable. Group/layer normalization avoids batch dependence, while synchronized batch normalization pools worker statistics at communication cost.
Worked example. With global batch 64 split across 32 workers, each device sees two examples. Gradient accumulation does not merge their normalization statistics.
Validation
Compare evaluation-mode predictions, running moments, and GroupNorm or synchronized alternatives.
Compare local, synchronized and batch-independent normalization; inspect train/evaluation divergence, running statistics and quality at matched compute.
Common pitfalls
Small-batch failure is context dependent; batch size one is not categorically invalid for every tensor shape.
Effective gradient batch size is not the normalization batch size. Freezing weights also does not automatically freeze running statistics.
Likely follow-up: Compare evaluation-mode predictions, running moments, and GroupNorm or synchronized alternatives.