← All models

MODEL EXPLORER / MODERN LLMS

Scale without centering

What does normalization change in one token vector?

Curated by TensorVizRMSNorm · 4-step tour
Static architecture
What does normalization change in one token vector?
Opening the interactive graph…
Architecture snapshot · No Python requiredDownload graph ↓

RECORDED NUMERICAL EXAMPLE

Keep the vector. Change the normalization.

Recorded CPU calculations with unit gains, zero LayerNorm bias, and epsilon 0.000001. Choose an input transformation.

Both formulas agree for this zero-mean vector when their gains and epsilon match.

Input · 8 features
1
2
3
4
-1
-2
-3
-4
LayerNorm
0.3651
0.7303
1.095
1.461
-0.3651
-0.7303
-1.095
-1.461
RMSNorm
0.3651
0.7303
1.095
1.461
-0.3651
-0.7303
-1.095
-1.461

Bars share one scale within this example. Values are rounded to four significant digits.

LayerNorm output mean
0
RMSNorm output mean
0
Verified by the local recipe
  • LayerNorm removes a common offset; RMSNorm preserves its effect
  • RMS normalization and positive rescaling agree within epsilon tolerance
  • Zero input stays finite and learned gain rescales the result

Download the source and run.py to reproduce these checks. Choosing an example here replays recorded values.

ABOUT THIS EXAMPLE

Compare LayerNorm and RMSNorm on the same eight features, then change the input's offset and scale.

Component · 2019

RMSNorm

Eight-feature implementation of the normalization equations; unit gains at initialization.

Source, capture & limitations +

Normalization type and placement are separate choices. This forward comparison does not establish training stability or speed. The recorded experiment uses float64; the captured graph input uses float32.

Original TensorViz teaching example. PyTorch provides the underlying operators.

No separate redistribution license has been declared for these project examples.

Content revision
57dce70f3f8f53cb
Source SHA-256
cb7f385265455049f0b476eb05031c6efb964dec3f92b8420bb1d4a32ddef028
Captured
2026-09-17 · Python 3.13.13 / Torch 2.7.1

One seeded CPU forward plus recorded numerical invariants. Untrained, reduced teaching implementation; no accuracy claim.

Read the model manifest ↗