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

Root Mean Square Layer Normalization

Biao Zhang, Rico SennrichNeurIPS 2019

This paper introduces a modification that has become a staple in modern Large Language Model (LLM) architectures, such as Llama. It challenges the status quo of traditional Layer Normalization by asking a simple but highly impactful question: Do we really need to calculate the mean?

The Problem: The Computational Tax of LayerNorm

Training deep neural networks is notoriously difficult due to "internal covariate shift," a phenomenon where the distribution of a layer's inputs changes as previous layers are updated. Layer Normalization (LayerNorm) successfully mitigated this issue by re-centering (subtracting the mean) and re-scaling (dividing by the standard deviation) activations.

However, LayerNorm comes with a computational tax. As models grow deeper and wider, the overhead of calculating these statistics for every layer becomes a significant bottleneck. The authors hypothesize that the "re-centering" property of LayerNorm is actually dispensable, and that the "re-scaling" property is the true driver of training stability and success.

The RMSNorm Solution

To address this bottleneck, the authors propose Root Mean Square Layer Normalization (RMSNorm).

  • The Standard Approach (LayerNorm): Normalizes inputs using both the mean ($\mu$) and variance ($\sigma$).
  • The RMSNorm Approach: Discards the mean entirely. It regularizes the summed inputs to a neuron using only the Root Mean Square (RMS) statistic: $$\bar{a}_i = \frac{a_i}{\text{RMS}(\mathbf{a})} g_i, \text{ where } \text{RMS}(\mathbf{a}) = \sqrt{\frac{1}{n} \sum_{i=1}^n a_i^2}$$

By removing the mean-centering step, the algorithm requires fewer operations (no subtractions for the mean) and is simpler to implement in both hardware and software.

Key Insights

  1. Mean-Centering is Dispensable: The authors argue that mean normalization doesn't significantly reduce the variance of hidden states or gradients. Their experiments show that models remain stable even without it.
  2. Implicit Learning Rate Adaptation: A mathematical analysis of the gradients reveals that RMSNorm acts as an implicit learning rate adaptor. It dynamically controls the norm of gradients, which helps prevent weights from exploding and smooths the optimization landscape.
  3. Invariance Properties: Like LayerNorm, RMSNorm is invariant to the scaling of weights and inputs. If you multiply all weights by a constant, the output remains the same—a key ingredient for robust training.
  4. Robustness to Initialization: Surprisingly, RMSNorm proved more robust than LayerNorm when the weight initialization was intentionally biased (e.g., shifting the center of weights to 0.2).

Experimental Results

The authors evaluated RMSNorm across a diverse set of tasks and architectures to prove its generality, including Machine Translation (WMT14), Reading Comprehension (CNN/Daily Mail), Image-Caption Retrieval (Microsoft COCO), and Image Classification (CIFAR-10).

Valid BLEU score comparison across normalization techniques

Across all tasks, RMSNorm achieved comparable—and sometimes slightly better—accuracy and BLEU scores than standard LayerNorm. More importantly, RMSNorm consistently outperformed LayerNorm in speed. In Theano and PyTorch implementations, it offered speedups of 11% to 34%. In specific image-captioning tasks, the computational speedup reached up to 64%.

pRMSNorm: Pushing Efficiency Further

The authors also introduce pRMSNorm, a "partial" version where the RMS is estimated from only a subset ($p\%$) of the inputs to further reduce computation.

Valid BLEU score across different partial percentages (p) for pRMSNorm

The partial version (using as little as 6.25% of activations to estimate the RMS) performed nearly as well as the full version, maintaining stable BLEU scores across various subset sizes.

Limitations and Future Work

While RMSNorm is highly effective, the authors noted a few limitations:

  • Framework Optimization: While pRMSNorm is theoretically faster, current deep learning frameworks (like TensorFlow and PyTorch) aren't fully optimized for the tensor slicing operations required to make it truly shine in practice.
  • Niche Architectures: While tested on RNNs, CNNs, and Transformers, there may be specific architectures where re-centering invariance is more critical than the authors' experiments suggest.
  • Alternative Norms: The authors suggest exploring other norms, such as the $l_1$-norm, as potential alternatives to the RMS ($l_2$-norm) for even higher computational efficiency in future research.

Ultimately, RMSNorm simplifies a core component of deep learning, maintaining model quality while providing a significant, highly practical computational speedup.

Summary updated

BibTeX
@inproceedings{zhang2019root,
  author = {Biao Zhang and Rico Sennrich},
  title = {{Root Mean Square Layer Normalization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
}
Figure