What is residual connection?
Adding a sub-layer's output to its input instead of replacing it. This gives gradients a direct path through 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.
Questions
- What is residual connection?
- Adding a sub-layer's output to its input instead of replacing it. This gives gradients a direct path through deep networks.
- Where is residual connection 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 residual connection?
- A block is attention then an MLP, each wrapped in a residual connection with layer normalisation.
- Where can I learn residual connection step by step?
- In the lesson “The transformer block” in Gradient’s course on the maths behind AI, with interactive diagrams and questions.