NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Layer Normalization

Lei Jimmy Ba, Jamie Ryan Kiros, Geoffrey E. HintonarXiv 2016

Abstract

Layer Normalization (LN) is a technique to normalize the activations of a neural network layer for each training instance independently. Unlike Batch Normalization, which depends on mini-batch statistics, LN computes normalization statistics from the summed inputs to the neurons within a single layer. This approach is particularly effective for Recurrent Neural Networks (RNNs), where it stabilizes hidden state dynamics and enables faster convergence across varying sequence lengths and batch sizes.

Introduction

Introduced in 2016 by Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey Hinton, Layer Normalization has become a foundational component of modern deep learning, particularly within Transformer architectures. While Batch Normalization (BN) revolutionized feed-forward networks, its application to recurrent architectures remained challenging due to its dependency on batch size and sequence-specific statistics. LN addresses these limitations by transposing the normalization logic to operate across features rather than samples.

The Challenge: Internal Covariate Shift

Training deep networks is often hindered by "internal covariate shift," where the distribution of inputs to a layer changes as previous layers' parameters are updated. Batch Normalization mitigates this by normalizing inputs using mini-batch means and variances. However, BN suffers from several drawbacks:

  1. Batch Dependency: Performance degrades with small or unit batch sizes (online learning).
  2. RNN Complexity: Sequence length variability requires storing separate statistics for every time step.
  3. Inference Mismatch: Differences between training (batch stats) and testing (running averages) can cause instability.

Methodology

Layer Normalization computes the mean and variance of all summed inputs to the neurons in a specific layer for a single training case.

The Mechanism

For a layer with $H$ hidden units, the mean $\mu$ and variance $\sigma$ are calculated across the vector of summed inputs $a$: $$\mu = \frac{1}{H} \sum_{i=1}^{H} a_i, \quad \sigma = \sqrt{\frac{1}{H} \sum_{i=1}^{H} (a_i - \mu)^2}$$ The normalized inputs are then scaled and shifted by learnable parameters $g$ (gain) and $b$ (bias).

Advantages for RNNs

In an RNN, LN is applied to the recurrent hidden state at each time step. Because the statistics are local to the input, LN handles varying sequence lengths naturally and maintains consistent behavior during training and inference. This stabilizes the hidden-to-hidden dynamics, preventing the common issues of exploding or vanishing gradients.

Experimental Results

The authors evaluated LN across diverse tasks, including image-sentence ranking (MSCOCO), question-answering (Attentive Reader), and unsupervised sentence representation (Skip-thought vectors).

Convergence Speed

On the Attentive Reader task, LN-LSTM demonstrated significantly faster convergence compared to standard LSTM and Batch Normalized variants. While BN-LSTM improved over the baseline, LN-LSTM reached lower validation error rates much earlier in the training process.

Validation error rate on the Attentive Reader task comparing LSTM, BN-LSTM, and LN-LSTM.

Generalization and Robustness

LN consistently improved final validation results across multiple benchmarks. In the Skip-thought vector task, LN enhanced performance across various downstream evaluations, such as the Customer Review (CR) dataset, showing better generalization than the original baseline.

Accuracy on the CR dataset using Skip-thought vectors with and without Layer Normalization.

Furthermore, LN proved robust to batch size variations. While BN performance drops significantly with small batches (e.g., size 4), LN remains stable because its computation is independent of other samples in the batch.

Discussion and Limitations

LN provides stability by controlling the magnitude of hidden states. However, it is less effective than BN for Convolutional Neural Networks (CNNs). The authors hypothesize that because spatial locations in images have distinct statistics, averaging them across an entire layer destroys valuable information. This observation suggests that normalization strategies must respect the underlying structure of the data.

Conclusion

Layer Normalization offers a robust, batch-independent alternative to Batch Normalization. Its ability to stabilize recurrent dynamics and simplify implementation in complex architectures has made it an essential tool in modern deep learning, particularly for sequence-based models.

Summary updated

BibTeX
@misc{ba2016layer,
  author = {Lei Jimmy Ba and Jamie Ryan Kiros and Geoffrey E. Hinton},
  title = {{Layer Normalization}},
  year = {2016},
  eprint = {1607.06450},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1607.06450},
}
Figure