What is multi-head attention and why is it better than single-head?medium
Answer
Single-head computes one attention distribution — one way of relating tokens.
Explanation
Single-head computes one attention distribution — one way of relating tokens. Multi-head runs h parallel attention functions with different learned projections, then concatenates. Each head can attend to different relationship types (syntactic, semantic, positional). For sarcasm or contract parsing, some heads focus on negation, others on named entities, others on long-range dependencies.
Follow-upCan you give a production example?