Batch norm normalizes each feature across the batch, then applies learnable scale and shift; it speeds up convergence, allows higher learning rates, and acts as a mild regularizer.
It depends on batch statistics, so it struggles with small batches and sequences, and uses running averages at inference (remember model.eval() in PyTorch).
Layer norm normalizes across the features of each example, independent of batch size, so transformers and RNNs use it (often in the pre-norm position or as RMSNorm).
Loading…