QUESTION 5 OF 15

Why use multiple attention heads?

Reveal the answer and explore the explanation.

05
MediumHigh priority

Why use multiple attention heads?

Answer
Answer

Runs multiple learned attention projections in parallel and combines their outputs.

Deeper understanding

Each head has separate learned projections of queries, keys and values. Outputs are concatenated and projected to model width. Multiple heads can learn different relationships but the attention weights are not guaranteed faithful causal explanations.

Practical example

Let different heads capture different relations.

Reference: Further reading ↗

Last 30 min revisionHigh-yield interview Q&As