passdrill
AI & LLM Engineering · How LLMs Work: Transformers & Training · Card 008/012 easy

Each sublayer in the Transformer encoder and decoder (Vaswani et al., 2017) is wrapped with a residual connection before layer normalization is applied. What role do these residual connections play in training deep stacks of transformer blocks?

  1. They reduce the total number of attention heads needed by allowing heads to share weights across different layers
  2. They eliminate the need for a softmax normalization step within the self-attention mechanism
  3. They replace the position-wise feed-forward sublayer with a simple identity function during inference, to speed up generation
  4. They add each sublayer's input directly to its output before normalization, giving gradients a direct path backward through the addition and easing optimization of many stacked layers
Next card → Shuffle