Ask what should change when the equation is manipulated, then let the visualization test that expectation.
Foundation Lab
Layer Normalization & RMSNorm
LayerNorm is in every transformer—it stabilizes training by controlling activation scales
\text{LN}(x) = \gamma \odot \frac{x - \mu}{\sigma}Selected Foundation Object
Keep the equation fixed; move through the evidence.
LayerNorm makes networks robust to scale: you can multiply weights by constant without changing output
\text{LN}(x) = \gamma \odot \frac{x - \mu}{\sigma}Use the runnable panel, the key equation, and canonical papers as separate forms of evidence 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 keeps the working demo; the domain notebook carries the fuller Intuition -> Math -> Code -> Demo sequence.
Why It Matters for Modern Models
- LayerNorm is in every transformer—it stabilizes training by controlling activation scales
- Pre-norm vs post-norm placement affects gradient flow and training stability
- RMSNorm saves compute (no mean) with similar quality—used in modern efficient LLMs
What Tutorials Skip
What is still poorly explained in textbooks and papers:
- LayerNorm makes networks robust to scale: you can multiply weights by constant without changing output
- The learned γ, β parameters let the network "undo" normalization where needed
- Pre-norm (normalize before attention/MLP) is more stable for deep networks
Interactive Visualization
Core Math (Optional Deep Dive)
If you want intuition first, start with the key equation and the visualization. Come back here for the full walkthrough.
LayerNorm normalizes across features for each example:
where , .
RMSNorm (used in LLaMA, etc.) skips mean centering: