Layer normalization computes a mean and variance across the feature dimension independently for each individual example, then uses those per-example statistics to normalize that example's activations, in contrast to batch normalization's reliance on statistics computed across the whole batch. This per-example, batch-size-independent computation is specifically why layer normalization integrates more naturally into sequence models and Transformer architectures, where batch composition and sequence length can vary in ways that complicate batch normalization's batch-wide statistics.