RMSNorm versus LayerNorm, what is kept and what is dropped?
RMSNorm keeps the divide-by-RMS step and the learnable scale, drops the mean centering and the additive bias. Cheaper, fewer parameters, no measurable quality loss.
Picture LayerNorm as a quality-control station that does three jobs: center the product on the conveyor belt (subtract the mean), shrink or stretch it to a standard size (divide by standard deviation), then apply 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. 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 quietly shapes the cost and stability profile of every modern transformer language model. Llama, Mistral, Gemma, Qwen, DeepSeek: every frontier open-weight family in 2026 uses RMSNorm. The original 2017 transformer and BERT used LayerNorm. The migration was complete by Llama 1 in early 2023 and has not reversed.
This deep dive walks both formulas in detail, explains the algebra of what gets kept and dropped, justifies why the dropped operations are empirically safe in transformer LMs, quantifies the FLOP and parameter savings at scale, covers the numerical-stability benefits under low-precision training, and closes with the architectural lineage of normalization techniques in deep learning.
By the end you should be able to write both formulas from memory, explain why the swap is safe at pretraining time but not at inference time, and name the 2026 models that use each.
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).
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.
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, the bias terms encode incorrect offsets, and 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.