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

Understanding and Improving Layer Normalization

Jingjing Xu, Xu Sun, Zhiyuan Zhang, Guangxiang Zhao, Junyang Lin

TL;DR

This paper deconstructs Layer Normalization (LayerNorm) to reveal that its success stems from normalizing backward gradients rather than stabilizing forward distributions. The authors find that the standard learnable bias and gain parameters often lead to overfitting, and they propose AdaNorm, a parameter-free adaptive transformation that outperforms LayerNorm across various NLP and CV tasks.

What Problem Does This Paper Address?

Layer Normalization (LayerNorm) is a staple in modern deep learning, particularly within the Transformer architecture. While it is known to enable smoother gradients and faster training, the community has largely relied on the intuition that its effectiveness comes from "forward normalization"—stabilizing the distribution of inputs to each layer.

The authors identify two major gaps in this understanding:

  1. The "Why": Is forward stability actually the reason LayerNorm works?
  2. The "Parameters": LayerNorm includes learnable "gain" and "bias" parameters ($g$ and $b$) intended to restore expressive power. However, the authors suspect these parameters might actually contribute to overfitting since they are fixed after training and cannot adapt to varying input distributions at test time.

Methods

To investigate these issues, the authors designed several clever variants of LayerNorm:

  • LayerNorm-simple: A version of LayerNorm with the learnable gain ($g$) and bias ($b$) removed. This tests whether the affine transformation is actually necessary.
  • DetachNorm: A diagnostic tool that performs standard forward normalization but "detaches" the mean ($\mu$) and variance ($\sigma$) from the computational graph during the backward pass. This prevents their derivatives from affecting the gradients, allowing the authors to isolate the impact of forward normalization vs. backward gradient re-centering/re-scaling.
  • AdaNorm (Adaptive Normalization): The authors' proposed improvement. It replaces the learnable $g$ and $b$ with a new transformation function: $$\phi(y) = C(1 - ky)$$ Where $y$ is the normalized vector, $C$ is a hyper-parameter, and $k$ is a constant (recommended as $1/10$). This function adaptively scales weights based on the input values without requiring learned parameters that might overfit.

Datasets

The authors evaluated their findings across eight diverse datasets to ensure the results weren't architecture-specific:

  • Machine Translation: WMT English-German (En-De), IWSLT German-English (De-En), and IWSLT English-Vietnamese (En-Vi).
  • Language Modeling: Enwiki8 (using Transformer-XL).
  • Text Classification: RT (movie reviews) and SST5.
  • Image Classification: MNIST (using a 3-layer CNN).
  • Dependency Parsing: English Penn TreeBank (PTB).

Key Insights and Ideas

Gradients are King

The most surprising finding is that forward normalization has little to do with LayerNorm's success. In experiments with DetachNorm, performance plummeted compared to LayerNorm-simple. This proves that the derivatives of the mean and variance are the critical components because they re-center and re-scale the backward gradients.

Validation loss of DetachNorm vs LayerNorm-simple

The Overfitting Trap

Learnable bias and gain parameters often hurt more than they help. The authors show that LayerNorm often achieves lower training loss but higher validation loss compared to "LayerNorm-simple," a classic sign of overfitting.

Training and validation curves showing LayerNorm overfitting compared to LayerNorm-simple

Gradient Normalization Theory

The paper provides a theoretical analysis showing that LayerNorm's backward pass essentially forces the mean of the gradients to zero and reduces their variance. This "gradient normalization" is what truly stabilizes training.

AdaNorm's Adaptability

By using a fixed transformation based on the input's own distribution (via Chebyshev’s Inequality), AdaNorm provides the benefits of an affine transformation without the risk of memorizing training-set-specific biases.

Key Results

  • LayerNorm-simple vs. LayerNorm: Removing the learnable parameters actually improved performance on 4 out of 8 datasets, including a state-of-the-art result on En-Vi machine translation at the time of publication.
  • AdaNorm Superiority: AdaNorm outperformed standard LayerNorm on 7 out of 8 datasets.
  • In En-Vi translation, AdaNorm achieved 31.4 BLEU, significantly better than the baseline without normalization.
  • In Text Classification (SST5), AdaNorm reached 40.54% accuracy, compared to LayerNorm's 39.23%.
  • Convergence: Convergence curves showed that AdaNorm consistently achieves lower validation loss/BPC (Bits-Per-Character) than standard LayerNorm, confirming it generalizes better.

Limitations and Future Work

  • Hyper-parameter Sensitivity: While AdaNorm reduces the number of learnable parameters, it introduces a new hyper-parameter $C$. While the authors suggest $k=1/10$ based on statistical probability, $C$ might still require tuning for different architectures.
  • Scope of Architectures: The study focuses heavily on Transformers and RNN-like structures. While they tested a small CNN on MNIST, the impact of AdaNorm on very deep ResNets or modern Vision Transformers (ViTs) remains an open area for exploration.
  • Future Directions: The authors suggest exploring other transformation functions beyond their linear $\phi(y)$ that could further improve gradient normalization.

Summary updated

BibTeX
@inproceedings{xu2019understanding,
  author = {Jingjing Xu and Xu Sun and Zhiyuan Zhang and Guangxiang Zhao and Junyang Lin},
  title = {{Understanding and Improving Layer Normalization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=4g5i8T0DSR},
}
Figure