Zenaique

RMSNorm versus LayerNorm, what is kept and what is dropped?

MCQ·Medium·4.0 · 0·~1 min·Asked atCursorObserve Ai·Relevant atMeta
Attempt it
TL;DR

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.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

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.

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

LN(x)=γxμσ2+ϵ+β\text{LN}(x) = \gamma \cdot \frac{x - \mu}{\sqrt{\sigma^2 + \epsilon}} + \beta

where:

  • mu = mean(x) over the d_model axis.
  • sigma^2 = mean((x - mu)^2) over the d_model axis.
  • gamma, beta are learnable vectors of shape (d_model,).
  • eps is 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

RMSNorm(x)=γx1dxi2+ϵ\text{RMSNorm}(x) = \gamma \cdot \frac{x}{\sqrt{\frac{1}{d}\sum x_i^2 + \epsilon}}

where:

  • The denominator is the RMS of x: square each element, take the mean, square root.
  • gamma is a learnable vector of shape (d_model,).
  • eps is 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.

Why the dropped operations are empirically safe
Cost savings at scale
Why retrofitting fails
The normalization-technique landscape
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.
PropertyLayerNormRMSNorm
Mean centeringYes (x - mu)No
Scale normalizationDivide by stdDivide by RMS
Learned scale gammaYesYes
Additive bias betaYesNo
Reductions per call2 (mean, var)1 (mean of squares)
Parameters per norm2 * d_model1 * d_model
Modern LLM adoptionBERT, GPT-2, GPT-3Llama 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.
Sign in to see more production examples.

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?
A

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.

1 more follow-up an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Claiming RMSNorm and LayerNorm are equivalent or just a rename. They have different gradients and remove two specific operations from LayerNorm.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Explain scaled dot product attention.
Short answer·Medium