RMSNorm⁡\operatorname{RMSNorm}

RMSNorm — root-mean-square normalization

Read "R M S norm". It is LayerNorm without the mean subtraction and without the shift (β): divide each vector by its root mean square, then apply a learned scale.

Root mean square means: square each entry, take the mean, then the square root. RMS⁡(x)=1d∑ixi2+ϵ\operatorname{RMS}(\mathbf{x}) = \sqrt{\frac{1}{d}\sum_i x_i^2 + \epsilon}, and the layer outputs xRMS⁡(x)⊙γ\frac{\mathbf{x}}{\operatorname{RMS}(\mathbf{x})} \odot \boldsymbol{\gamma}.

Skipping the mean saves one pass over the vector. In practice it works about as well as LayerNorm, which suggests the rescaling does the useful work, not the re-centring. Gemma, LLaMA and Qwen all use it.

Example

RMS⁡([3,4])=9+162≈3.54  ⟹  [0.85, 1.13]\operatorname{RMS}([3, 4]) = \sqrt{\tfrac{9 + 16}{2}} \approx 3.54 \;\Longrightarrow\; [0.85,\, 1.13]

Ignoring ε, with γ = 1. The mean is not subtracted.

Where the course uses it

Related terms