AI engineering glossary · Transformers LLM architecture

What is pre-norm?

Pre-norm (also called Pre-LN): A block layout where normalisation is applied to the input of each sublayer, before attention or the MLP, and the sublayer output is added back to the unnormalised residual path. It makes very deep models much more stable to train than the original arrangement and is standard in modern LLMs.

Level: advancedTopic: Transformers LLM architecture

Pre-norm: an example

x = x + Attention(LayerNorm(x)); x = x + MLP(LayerNorm(x)).

Related terms

More Transformers LLM architecture terms

Where you learn it

Pre-norm is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.