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

Vaswani et al. (2017) use multi-head attention instead of a single attention function operating on the full-dimensional queries, keys, and values. What was the main motivation for splitting attention into multiple heads?

  1. It lets the model jointly attend to information from different representation subspaces at different positions, since a single attention head would average this into one weighted combination
  2. It doubles the effective context window length by processing two halves of the input sequence in parallel
  3. It removes the need for positional encoding, because each head learns to represent a different position offset
  4. It ensures that every attention head produces an identical set of attention weights, providing an ensembling effect through redundancy
Next card → Shuffle