RMSNorm Removes Re-Centering

RMSNorm scales each token record by its root mean square without subtracting its mean. Calculate it on the LayerNorm example, compare shift behavior, and audit axes and parameters.

RMSNorm scales a token record by its root mean square without first subtracting the record's mean. For rRdmodelr\in\mathbb{R}^{d_{model}},

RMS(r)=1dmodelkrk2+ϵ,\operatorname{RMS}(r)=\sqrt{\frac{1}{d_{model}}\sum_k r_k^2+\epsilon}, RMSNorm(r)k=γkrkRMS(r).\operatorname{RMSNorm}(r)_k=\gamma_k\frac{r_k}{\operatorname{RMS}(r)}.

The usual form has a learned gain γ\gamma and no learned bias. This is a different operation from LayerNorm, not a faster spelling of it.

Calculate the Same Row Again

For r=[1,2,3,4]r=[1,2,3,4], the mean squared value is

12+22+32+424=7.5.\frac{1^2+2^2+3^2+4^2}{4}=7.5.

Ignoring epsilon for the hand calculation, the root mean square is 7.52.738613\sqrt{7.5}\approx2.738613. With γ=1\gamma=1, RMSNorm returns approximately

[0.365148,0.730297,1.095445,1.460593].[0.365148,0.730297,1.095445,1.460593].

Unlike the LayerNorm result for the same row, these coordinates do not have mean zero. Their mean squared value is 1, up to epsilon and rounding.

A Constant Shift Separates the Operations

Add 10 to every coordinate. LayerNorm removes that shared shift when it subtracts the new mean, so its normalized result is unchanged before gain and bias. RMSNorm does not remove the shift, so its normalized direction changes.

Both operations reduce sensitivity to a common rescaling when epsilon is small, but neither makes a full network invariant to arbitrary changes in its inputs. Learned gains, biases elsewhere, nonlinearities, and finite epsilon still matter.

Axis and Parameter Audit

Like LayerNorm in a Transformer, RMSNorm acts independently on the final feature axis of each (b,t)(b,t) record. Under the usual gain-only convention it has dmodeld_{model} learned entries, compared with 2dmodel2d_{model} for LayerNorm with gain and bias.

Q1. Normalize with an RMS

Ignoring epsilon and using unit gain, what is the first coordinate of RMSNorm([3,4])([3,4])?

Compute it first, then check your number.

Hint
The mean squared value is (9+16)/2=12.5(9+16)/2=12.5.
Solution
3/12.50.8485283/\sqrt{12.5}\approx0.848528.
Not attempted
Review

Not marked done.

Reference

Pause and reflect

In your own words, note what you understood, what remains unclear, or what you want to revisit. The note stays with this lesson.

0 of 1 exercises marked done

Review

Not marked done.