Ask what should change when the equation is manipulated, then use the linked notebook demo to test that expectation.
Foundation Lab
Layer Normalization & RMSNorm
LayerNorm and RMSNorm use statistics from one activation vector rather than from other batch members; transformer families may use either convention
Selected Foundation Object
Keep the equation fixed; move through the evidence.
With positive ε, positive rescaling is only approximately canceled when activation variance dominates ε; negative rescaling also reverses the normalized direction before the affine map
Use the linked notebook demo, this key equation, and canonical papers as separate witnesses for the same object.
The useful learning product is the reusable mechanism you can carry into another model, paper, or engineering tradeoff.
This atlas page has no local demo; the domain notebook carries the interactive witness and the fuller Intuition -> Math -> Code -> Demo sequence.
Why It Matters for Modern Models
- LayerNorm and RMSNorm use statistics from one activation vector rather than from other batch members; transformer families may use either convention
- Pre-norm and post-norm place the same operator on different residual paths, so their gradient paths differ; stability effects depend on architecture and depth
- RMSNorm omits the mean calculation, reducing this page's toy scalar-operation count; end-to-end speed and model quality depend on the implementation and model
What Tutorials Skip
What is still poorly explained in textbooks and papers:
- With positive ε, positive rescaling is only approximately canceled when activation variance dominates ε; negative rescaling also reverses the normalized direction before the affine map
- Learned γ and β restore per-feature scale and shift after LayerNorm; they do not recreate the discarded per-vector statistics
- Pre-norm and post-norm are not interchangeable labels: moving normalization changes the residual and gradient paths
Visualization Status
Core Math (Optional Deep Dive)
If you want intuition first, start with the key equation here and the linked notebook demo. Come back here for the full walkthrough.
For one activation vector , with integer , let and set for this page. Write for coordinate of , and let denote elementwise multiplication.
LayerNorm centers the features and then applies an elementwise affine map:
RMSNorm omits mean centering and uses the stabilized root mean square:
The linked notebook demo's scalar and controls are broadcast across all features; the equations above state the general elementwise parameters. RMSNorm has no term under this page's convention.
The cited papers ground the centering-plus-affine LayerNorm object and RMS-only rescaling. This legacy entry and the linked notebook demo place inside each square root as an explicit numerical convention; library defaults, normalized axes, and affine variants may differ.