Layer Normalization
BatchNorm couples every example to the rest of the mini-batch and fights RNNs. LayerNorm computes mean and variance over the hidden units of one example so train equals test and sequence models stay stable.
Deep nets train faster when the summed inputs to each nonlinearity sit in a stable range. Batch normalization (Ioffe & Szegedy) does that by estimating a mean and variance for each neuron across the mini-batch. It works brilliantly in many feed-forward ConvNets — and then trips over two walls: the estimate depends on batch size, and it is awkward inside recurrent nets whose “batch” axis mixes time steps poorly.
Layer normalization flips the axis. For one training case, take the summed inputs into a layer, compute a shared and over those units, re-center / re-scale, then apply a learned per-unit gain and bias before the nonlinearity. Train and test use the same formula. For RNNs, recompute those stats at each time step.
The abstract’s punchline: stabilize hidden-state dynamics in recurrent nets and substantially reduce training time versus prior techniques on the paper’s suite (order-embeddings, reading comprehension LSTMs, skip-thoughts, DRAW, handwriting, MNIST MLPs) — with an honest caveat that ConvNets still preferred BatchNorm in their preliminary trials.
What this paper explains
Ba, Kiros, and Hinton give a small, sharp alternative to BatchNorm:
- Name BatchNorm’s limits. Mini-batch statistics couple examples; train-time differ from test-time running averages; RNNs do not have a clean “batch of independent cases” at each step.
- Normalize within a layer. For summed inputs on one case, set
- Keep an affine after the normalize. Like BatchNorm, each unit gets its own gain and bias so the representation can still stretch and shift after re-centering.
- Specialize to RNNs. At time , normalize the pre-activations with from that step’s units — no dependence on other sequences in the batch.
- Analyze invariances. Show how LayerNorm’s invariance to global weight/data rescaling differs from BatchNorm and weight normalization (their §5), then validate on six tasks (§6).
This is not a new optimizer and not a regularization trick like Dropout. It is a reparameterization of the pre-nonlinearity activations that changes the geometry of learning.
Prior limits
- Unnormalized deep nets suffer from shifting activation distributions as parameters move — the “covariate shift” motivation BatchNorm popularized.
- BatchNorm estimates per neuron over the batch. Small batches make noisy estimates; RNNs / online decoding want a definition that does not lean on other examples.
- Train ≠ test under BatchNorm. Training uses batch moments; inference typically uses running averages — an extra moving-target surface.
- Recurrent batch normalization existed as a fix attempt; the authors still find LayerNorm simpler and, in their reading-comprehension setup, less brittle to gain initialization.
The mechanism
From BatchNorm’s axis to LayerNorm’s axis
A standard feed-forward step (paper Eq. 1) is
BatchNorm (paper Eq. 2) replaces with a version normalized by expectations over the data distribution / mini-batch for that unit .
LayerNorm instead pools across units for a fixed example (paper Eq. 3 above). Every hidden unit in the layer shares the same and . The normalized, affine-adjusted pre-activation (feed-forward form in the analysis section) looks like
with the understanding that under pure LayerNorm the are the shared layer statistics (the subscripts on collapse). In the common modern shorthand (and the paper’s supplementary helper),
Why RNNs like this
At time , the recurrent layer re-centers and re-scales using only (paper Eq. 4):
Normalization terms depend on the current summed inputs, not on other sequences or on a running average store. Sequence length at test can exceed anything seen in training without breaking a BatchNorm population-stat contract.
Invariance intuition (short)
§5 shows LayerNorm is invariant to rescaling the entire weight matrix and to rescaling a single training case, while BatchNorm’s invariances sit on a different axis (per-unit batch moments). You do not need the Fisher-geometry derivations to use the layer — but they explain why the gain behaves differently than a raw weight scale.
Algorithm / figure walkthrough
- Receive a vector of summed inputs for one example (or one time step).
- Compute scalar and (paper uses the average inside the square root; frameworks often add for stability).
- Form .
- Apply learned : .
- Apply nonlinearity .
- For RNNs / GRUs / LSTMs, apply the same pattern to the paper’s chosen pre-activations (supplement gives explicit GRU/LSTM expansions).
- Default init in their experiments: adaptive gains to (they note sensitivity differs from recurrent BatchNorm’s scale init).
The opening visual is the same arc: ENTER with batch-tied BatchNorm / RNN pain; RUN with per-example feature-axis plus gain/bias; LEAVE with train=test math and steadier recurrent dynamics.
What to notice when reading
- Axis is the idea. If you remember only one sentence, remember “across features, not across the batch.”
- Gain and bias are not optional decoration. Without them the layer could only emit zero-mean unit-variance pre-activations; restore expressive scale and shift.
- RNN results are the center of gravity. Four of six experiment sections are sequence models; the MNIST MLP probes batch-size robustness; ConvNets are explicitly preliminary and mixed.
- They do not claim ConvNet supremacy. §6.7: LayerNorm beat an unnormalized baseline but BatchNorm still looked better in their ConvNet trial — “further research is needed.”
- Modern Transformers. Pre-/post-LN Transformer blocks are descendants of this axis choice; the 2016 paper’s empirical home was RNNs first.
Results and evidence
Numbers and qualitative claims below are from the paper (arXiv:1607.06450) — not re-measured here.
| Setting | What the paper reports |
|---|---|
| Order-embeddings (GRU) | Faster per-iteration improvement on Recall@K curves; better final generalization vs the unmodified model (Fig. 1 + table in §6.1) |
| Teaching machines to read & comprehend (LSTM) | Faster training and better validation than recurrent BatchNorm in their setup; gain init worked better than , and LN was less brittle than recurrent BN to that choice (§6.2) |
| Skip-thoughts | Speedup vs baseline and better downstream metrics as a function of training iterations (Fig. 3); longer training continued to help |
| DRAW on binarized MNIST | Faster convergence of test NLL; layer-normalized model reaches 82.09 nats (§6.4) |
| Handwriting sequence generation | Comparable final log-likelihood to baseline, faster convergence; stress test with batch size 8 and sequence lengths 10–40 (§6.5) |
| Permutation-invariant MNIST MLP | LN robust across batch sizes 128 and 4; Fig. 6 compares NLL / test error vs BatchNorm (§6.6) |
| ConvNets (preliminary) | Speedup vs no normalization, but BatchNorm still stronger in their trial — open problem noted by the authors (§6.7) |
Read the figures as training-dynamics evidence, not as a 2026 leaderboard.
Limitations
- ConvNet story incomplete in-paper. Authors flag that BatchNorm remained preferable in their convolutional experiments.
- and framework details. Production LayerNorm adds a small under the square root; match your library’s definition when reproducing.
- Where you place LN matters later. Transformer pre-LN vs post-LN, and Megatron-era notes about LayerNorm rearrangement in BERT-like stacks, are later systems/modeling choices — not settled in this 2016 paper.
- Not a free lunch on width. Very small makes noisy; the method assumes a layer with enough units to estimate moments.
- Cousin methods exist. RMSNorm drops mean-centering; GroupNorm slices channels — useful comparisons, different papers.
How to read the paper
- Abstract + §3 — axis swap and Eq. 3–4.
- §3.1 — RNN formulation.
- §5.1 — invariance table/intuition (skim Fisher §5.2 unless you want the geometry).
- §6.1–6.2 — clearest empirical plots for sequence models.
- §6.7 + conclusion — honest ConvNet caveat.
- Supplementary — exact applications to GRU/LSTM variants.
Knowledge check
What axis does LayerNorm use for its mean and variance?
Why is LayerNorm a better default than BatchNorm inside an RNN cell?
After subtracting μ and dividing by σ, why keep learned gain and bias?
Keep reading / Sources
- Paper: arXiv:1607.06450 — Layer Normalization (Ba, Kiros, Hinton)
- Related Daily: Batch Normalization, Megatron-LM (systems note on LN placement), Dropout
- Next cousins to study: RMSNorm (arXiv:1910.07467), Group Normalization (arXiv:1803.08494)