What does RMSNorm keep from LayerNorm, and what does it drop?
RMSNorm keeps the divide-by-RMS step and the learnable scale. It drops the mean centering and the additive bias. It is cheaper, with fewer parameters and no measurable quality loss.
Picture LayerNorm as a quality-control station that does three jobs. It centers the product on the conveyor belt (subtract the mean). It shrinks or stretches it to a standard size (divide by standard deviation). Then it applies a known label (multiply by gamma plus add beta). RMSNorm decides two of those jobs are unnecessary overhead: it skips the centering and the label-adding, keeping only the resize step plus a multiplier. The same product comes out the other side at roughly the same quality, with fewer operations per item. That is why every modern open-weight LLM swapped LayerNorm for RMSNorm.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
RMSNorm versus LayerNorm is one of those architectural choices that looks tiny on paper, just dropping two operations. But it shapes the cost and stability profile of every modern transformer language model. Llama, Mistral, Gemma, Qwen, DeepSeek: every frontier open-weight family uses RMSNorm. The original 2017 transformer and BERT used LayerNorm. T5 already used an RMS-style norm in 2019, Llama 1 made RMSNorm the open-weight default in early 2023, and the shift has not reversed.
The swap is safe at pretraining time but not at inference time.
The two formulas, side by side
Both LayerNorm and RMSNorm act per token on a d_model-wide activation vector x.
LayerNorm
where:
mu = mean(x)over the d_model axis.sigma^2 = mean((x - mu)^2)over the d_model axis.gamma,betaare learnable vectors of shape (d_model,).epsis a small constant for numerical stability (typically 1e-5).
LayerNorm does three distinct operations: center (subtract mean), scale (divide by std), affine (multiply gamma plus bias).
RMSNorm
where:
- The denominator is the RMS of x: square each element, take the mean, square root.
gammais a learnable vector of shape (d_model,).epsis the same numerical stability constant.- NO
beta.
RMSNorm does two distinct operations: scale by RMS, multiply by gamma.
The algebraic relationship
If mu = 0, then sigma = RMS (since variance = mean((x - mu)^2) = mean(x^2) when mu = 0). So in that special case, LayerNorm's normalization step collapses to RMSNorm's. RMSNorm can be thought of as 'LayerNorm under the implicit assumption that x has zero mean'.
Transformer activations are roughly mean-centered to begin with (the input embeddings are initialized that way; downstream projections preserve this approximately). So the assumption holds well enough in practice that the centering step provides little benefit.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
| Property | LayerNorm | RMSNorm |
|---|---|---|
| Mean centering | Yes (x - mu) | No |
| Scale normalization | Divide by std | Divide by RMS |
| Learned scale gamma | Yes | Yes |
| Additive bias beta | Yes | No |
| Reductions per call | 2 (mean, var) | 1 (mean of squares) |
| Parameters per norm | 2 * d_model | 1 * d_model |
| Modern LLM adoption | BERT, GPT-2, GPT-3 | Llama 1-4, Mistral, Gemma, Qwen, DeepSeek |
Real products, models, and research that use this idea.
- Llama 4 Maverick uses RMSNorm pre-norm throughout, gamma per d_model dimension, no bias.
- Mistral Large 2 and Mistral Small use RMSNorm consistent with the Llama family convention.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy does retrofitting RMSNorm into a LayerNorm-trained model break the model?
The downstream projections (W_Q, W_K, W_V, FFN W_in) and biases have learned to expect mean-centered input from LayerNorm. Without centering, the projections see a shifted distribution and the bias terms encode incorrect offsets. The resulting Q, K, V vectors fall outside the regime the attention softmax was trained for. Quality collapses immediately.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Claiming RMSNorm and LayerNorm are equivalent or just a rename. They have different gradients and remove two specific operations from LayerNorm.
60 second bullets to scan on the way to the call.
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.