Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuitionOlympiad trackCompetitions

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labsMock testsOlympiad

Reference

GlossaryBlogDiscoveries
Glossary › Layer normalisation

What is layer normalisation?

Rescaling each token's vector to mean 0 and variance 1, followed by a learned scale and shift. It keeps values in a steady range in deep networks.

Where it is taught

The transformer block. Attention moves information between tokens. Add an MLP, two normalisations and two shortcut connections, and you have the unit that a GPT repeats again and again.

What the lesson leaves you with

  • A block is attention then an MLP, each wrapped in a residual connection with layer normalisation.
  • Residual connections give gradients a direct path, so very deep stacks can be trained.
  • Size is set by the dimension, the number of blocks and the number of heads. The design does not change.
Open the lesson

Questions

What is layer normalisation?
Rescaling each token's vector to mean 0 and variance 1, followed by a learned scale and shift. It keeps values in a steady range in deep networks.
Where is layer normalisation used in AI?
Attention moves information between tokens. Add an MLP, two normalisations and two shortcut connections, and you have the unit that a GPT repeats again and again.
What is the key idea to remember about layer normalisation?
A block is attention then an MLP, each wrapped in a residual connection with layer normalisation.
Where can I learn layer normalisation step by step?
In the lesson “The transformer block” in Gradient’s course on the maths behind AI, with interactive diagrams and questions.

Related terms

  • Attention
  • Attention head
  • Autoregressive
  • Byte-pair encoding
  • Causal mask
  • Context length