Architecture / Normalization
verifiedLayer Normalization
Deep networks drift. As signals pass through many layers their scale creeps up or down, and training becomes a fight against the drift rather than against the problem. Layer normalization rescales each position's activations to a fixed mean and spread, so every layer receives input in the range it was tuned for.
Normalize across the feature dimension per position — not across the batch, which is what makes it work with variable-length sequences and batch size one. Placement matters more than it looks: post-norm, as originally published, needs learning-rate warmup to train at depth, while pre-norm trains stably without it and is what nearly every modern transformer uses.
LN(x) = γ ⊙ (x − μ)/√(σ² + ε) + β with μ and σ² computed over the d sub model features of a single position. γ and β are learned per-feature. Pre-norm places LN inside the residual branch, x + F(LN(x)); post-norm places it after, LN(x + F(x)).
8 values. The left group decays steeply; the right group is 56% of the way to flat, and reads flatter than the left.
Activations across features before and after normalization. Drag the spread to see how far the raw signal can drift and still arrive at the same normalized scale.
Reviewed by opendroid · 2026-08-04
- arXiv:1607.06450 — Layer Normalization
- arXiv:2002.04745 — On Layer Normalization in the Transformer Architecture