ZeroShotMind

Paper

Root Mean Square Layer Normalization

RMSNorm removes mean-centering and the shift parameter from LayerNorm, achieving ~15% speedup with negligible quality loss — now standard in LLaMA, Gemini, and DeepSeek.

Biao Zhang, Rico Sennrich — University of Edinburgh2019arXiv ↗Views:

architecturenormalizationtransformers

What LayerNorm actually computes

LayerNorm standardizes a vector across its feature dimension and then applies a learned affine transform, so for an input xRdx \in \mathbb{R}^d it first measures the mean and standard deviation of the dd coordinates.

μ=1di=1dxi,σ=1di=1d(xiμ)2\mu = \frac{1}{d}\sum_{i=1}^{d} x_i, \qquad \sigma = \sqrt{\frac{1}{d}\sum_{i=1}^{d} (x_i - \mu)^2}

It then re-centers by subtracting μ\mu, re-scales by dividing by σ\sigma, and finally lets the model stretch and shift each coordinate through learned parameters γ\gamma (scale, initialized to 11) and β\beta (shift, initialized to 00).

yˉi=xiμσγi+βi\bar y_i = \frac{x_i - \mu}{\sigma}\,\gamma_i + \beta_i

This is two statistics, two element-wise passes, and two parameter vectors per normalization site, and a deep transformer has hundreds of these sites.

The hypothesis: only the scaling matters

The paper's claim is that LayerNorm's benefit comes almost entirely from the re-scaling — dividing by σ\sigma to keep activation magnitudes stable across depth — and very little from the re-centering that subtracts μ\mu. The intuition is that any mean shift the network actually needs can be reabsorbed downstream: the bias terms of the following linear layers can add back whatever constant offset re-centering would have removed, so spending compute to subtract μ\mu at every norm is largely redundant.

Dropping the mean

RMSNorm acts on that hypothesis by replacing the standard deviation with the root mean square of the raw coordinates, which never subtracts a mean.

RMS(x)=1di=1dxi2\operatorname{RMS}(x) = \sqrt{\frac{1}{d}\sum_{i=1}^{d} x_i^2}

Normalization then divides by this quantity and applies only the scale parameter, with no shift.

yˉi=xiRMS(x)γi\bar y_i = \frac{x_i}{\operatorname{RMS}(x)}\,\gamma_i

Compared to the LayerNorm equations above, two things are gone: the mean μ\mu is never formed or subtracted, and the shift vector β\beta no longer exists.

What removing them saves

The savings are concrete. Dropping mean-centering removes one reduction over the feature dimension and one element-wise subtraction, and dropping β\beta removes one learned vector per norm along with the add that applies it. The net is roughly 15% fewer operations at each normalization site, and because these sites are on the critical path of every forward and backward pass, that compounds into a measurable wall-clock and memory win across a full model — for negligible change in final quality.

The invariance it keeps and the one it loses

The two norms differ in what transformations of the input leave their output unchanged. RMSNorm is invariant to re-scaling: multiply the input by any constant cc and the RMS scales by the same cc, so the ratio — and therefore the output — is identical.

cxiRMS(cx)=cxicRMS(x)=xiRMS(x)\frac{c\,x_i}{\operatorname{RMS}(c\,x)} = \frac{c\,x_i}{c\,\operatorname{RMS}(x)} = \frac{x_i}{\operatorname{RMS}(x)}

What RMSNorm gives up is re-centering invariance: shifting every coordinate by a constant changes its output, whereas LayerNorm — which subtracts the mean first — would absorb that shift. The paper's empirical result is that this lost invariance simply does not matter for transformer quality, which is the whole bet.

Adoption

The bet paid off completely. LLaMA 1, 2, and 3 use RMSNorm, as do Mistral, Qwen, Falcon, DeepSeek, and Gemini. Practically every major open model released after 2022 ships RMSNorm rather than LayerNorm — one of the rare architecture simplifications that became universal because it costs nothing and saves something on every single layer.