WRITE · TRACE · UNDERSTAND

Layer Normalization

Normalize within one token’s feature vector, using population variance and epsilon inside the square root.

Your experiment

layer_norm(values, gain, bias, epsilon) returns per-feature gain*(x-mean)/sqrt(variance+epsilon)+bias. Inputs are nonempty with matching widths; epsilon > 0.

Python runs in your browser. Your draft stays on this device.

What to look for

Normalize within one token’s feature vector, using population variance and epsilon inside the square root. Learned gain and bias then restore useful scale.

Watch your code work

Ready to experiment

Write a solution or load the worked answer, then choose Trace & check.

Step through arrays, variables and training curves produced by your own Python.