TECHNOLOGY

Pre-norm and post-norm: where normalization sits on the gradient path

In this article
THE QUICK TAKE

Moving normalization across residual addition changes the block’s function and derivative structure, even when every component keeps the same dimensions.

Normalization and residual addition can be arranged in more than one order. Pre-norm normalizes the input to a branch, while post-norm normalizes the result after residual combination in the familiar comparison. Their difference is a concrete computational graph, not a cosmetic placement on a diagram.

Write the residual block in execution order

A simplified pre-norm block can be written as x plus F of normalized x. A simplified post-norm block normalizes x plus F of x. These expressions identify different inputs to F and different treatment of the continuing residual stream. They are explanatory forms rather than a complete specification of every Transformer variant. A real architecture can add final normalization or other details. The point is to make the ordering explicit before assuming that both diagrams describe the same forward computation.

Gradient routes inherit the placement decision

The backward graph follows the forward operations, so moving normalization changes the derivatives encountered along residual and branch routes. The primary research on Transformer normalization examines how placement affects training and warmup considerations. Such analysis provides a mechanism for discussing optimization rather than an unconditional ranking of trained models. Depth, initialization, objective and the broader recipe still matter. A result obtained under one complete setting should preserve that setting when it is used as evidence about the normalization arrangement.

Inspect the identity-branch case carefully

Set the branch update to zero in a conceptual block. The simplified pre-norm expression retains its direct residual input, while the simplified post-norm expression still normalizes the combined result. This makes their distinction visible without training a large model. It also shows why equal tensor dimensions do not imply interchangeable checkpoints. The thought experiment concerns those simplified expressions; any additional final normalization must be included when examining the output of the complete architecture rather than only the local block.

Treat reordering as a model change

A conversion or implementation port should preserve the checkpoint’s actual normalization placement, parameter values and epsilon conventions. Reordering layers because another arrangement is convenient changes the function, even if loading succeeds and shapes line up. A small reference comparison can establish local agreement before larger tests. If the goal is to study an alternative architecture, define it as an experiment with its own training or adaptation and acceptance evidence. This preserves the useful distinction between implementing an existing model and designing another model with familiar components.

Primary research and implementation references

Reproducible inference stacks: preserving a GPU pilot’s result; A GPU inference benchmark you can trust.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles