normalization -- RMSNorm vs LayerNorm (and pre/post-norm)

Numbers passing through a deep network drift: run them through enough layers and they either grow without bound or fade away, and training stops working. The fix is to rescale each word's numbers back to a standard size before every layer, working the scale out from that word's own numbers and nothing else. Two recipes are common — one shifts the numbers to sit around zero and then divides by how spread out they are, the other skips the shift and only divides, which is cheaper and what most recent models use. Where the rescaling sits matters too: doing it before each layer rather than after the addition is what lets very deep models train at all.

Interactive page: the two normalizations used in transformers, applied per token (per row), and where the norm sits relative to the residual. Anchor: A8 normalization (Family C4).

What it shows

An input [N × D] (rows = tokens, cols = features). Each row is normalized independently, using statistics computed over its own D features:

The per-row stats (μ and σ, or RMS) are shown as columns next to the input, the normalized output on the right. Scrub the transport to walk row by row (highlighting that token's stats + before/after). Toggle RMSNorm / LayerNorm and pre / post-norm:

A small diagram shows the placement difference.

Render tier

T1 (Canvas2D heatmaps + a flow diagram).

Wiring

layout.mount + controls (tokens N, features D, norm, pre/post) + a per-row Transport, drawn with render.heatmap/cell + ctx tensor.seededRandn. ?step/?norm/?prenorm headless hooks. Source: page.js.