Asked about From attention to a full language model
What are residual connections and layer norm for?
An answer that works
Two different jobs. The residual makes each block add to a running vector rather than replace it, so information survives dozens of layers and gradients have a short path back; without it the output of a deep stack is uncorrelated with its own input. Normalisation keeps the scale of that running vector predictable, since every block adds to it and the norm grows with depth. Current models use RMSNorm, which divides by the root mean square and applies a learned scale, and it is a rounding error in the parameter count.
Reading an answer is not being able to give one. The section that teaches this is From attention to a full language model, 6 hours of Transformers & attention.
Learn this properlyAlso asked about Transformers & attention