Final Normalization Prepares the Vocabulary Readout

A separate final LayerNorm normalizes each last-block token record before vocabulary projection. Calculate its statistics, distinguish its axis and parameters, and test per-position independence.

After the last decoder block, this model applies one final LayerNorm before the vocabulary projection:

H=Nf(X(2)).H=N_f(X^{(2)}).

The final norm has its own learned gain and bias. It does not reuse either normalization operation inside a block.

Calculate One Final Record

Use the illustrative last-block record

r=[1,2,1,4].r=[-1,-2,-1,4].

Its mean is 0 and its population variance is

1+4+1+164=5.5.\frac{1+4+1+16}{4}=5.5.

Ignoring epsilon only for this hand calculation and using unit gain and zero bias gives

h[0.426401,0.852803,0.426401,1.705606].h\approx[-0.426401,-0.852803,-0.426401,1.705606].

This row will be reused for the tied-unembedding calculation. Carrying the same row across lessons makes it possible to check every later number.

Normalize Features, Not Time or Vocabulary

For X(2):(B,T,4)X^{(2)}:(B,T,4), final LayerNorm acts independently along the last feature axis. It does not combine different positions. Vocabulary width does not exist yet; it appears only after unembedding.

An axis error may preserve (B,T,4)(B,T,4) while coupling positions. Test it by changing one token record and confirming that another record's final-norm output remains unchanged.

Count and Ablate Carefully

The final gain and bias add 2dmodel=82d_{model}=8 learned entries. Removing final normalization changes the function and the scale presented to unembedding. A forward ablation can measure that change for fixed parameters, but it is not equivalent to training an architecture that never contained the norm.

Q1. Calculate final-norm variance

What population variance does LayerNorm calculate for [1,2,1,4][-1,-2,-1,4] before adding epsilon?

Compute it first, then check your number.

Hint
Divide 1+4+1+161+4+1+16 by 4.
Solution
The variance is 22/4=5.522/4=5.5.
Not attempted
Review

Not marked done.

Pause and reflect

In your own words, note what you understood, what remains unclear, or what you want to revisit. The note stays with this lesson.

0 of 1 exercises marked done

Review

Not marked done.

LLM PrimerFinal Normalization Prepares the Vocabulary Readouthttps://llmprimer.com/transformers/decoder-only-language-models/final-normalization-prepares-the-vocabulary-readout© 2026 LLM Primer