Multi-Query Attention › Quality Trade-offs

Michael BrenndoerferUpdated August 4, 20254 min read
Language AI HandbookAll chapters
Part 29 of 67Modern Decoder Models
Chapter 210Multi-Query Attention › Quality Trade-offs
Reading section 6 of 11 · Quality Trade-offs · 4 minSection 6 of 11 · 4 min

Book contents

Section 6 of 11 · 4 min read

Multi-Query Attention › Quality Trade-offsOne section · Sections in this chapter6 / 11 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

The extreme parameter sharing in MQA raises an important question: what do we lose by sharing keys and values across all heads? The answer depends on the task.

What Each Head Learns

In standard MHA, each head can specialize its key and value representations. Research has shown that different heads often capture distinct linguistic phenomena:

  • Syntactic heads: Attend to grammatical structure (subject-verb, modifier-noun)
  • Semantic heads: Capture meaning relationships (synonymy, entailment)
  • Positional heads: Focus on local context or specific positions
  • Rare pattern heads: Specialize in infrequent but important patterns

When we share K and V, all heads must use the same "retrieval index" (keys) and the same "information content" (values). They can still differ in what they query for (different Q projections), but they're constrained to retrieve from the same representation.

Empirical Quality Results

The original MQA paper and subsequent studies found modest quality degradation. Let's examine representative benchmark results across translation and summarization benchmarks, as well as language-modeling tasks.

Out[20]:
Visualization
Bar chart showing performance comparison between MHA and MQA across different NLP benchmarks.
MQA typically shows modest quality degradation of 1-3% compared to MHA across various benchmarks. The trade-off is often acceptable given the memory and throughput improvements.

The quality degradation typically falls in the 1-3% range. For many applications, especially inference-heavy deployments where throughput matters more than the last percentage point of accuracy, this is an excellent trade-off.

When MQA Hurts More

Some tasks are more sensitive to the reduced expressiveness:

  • Long-range reasoning: Tasks requiring diverse attention patterns over long contexts
  • Multi-task learning: Models expected to handle many different tasks
  • Fine-grained linguistic tasks: Parsing, detailed entity typing, relation extraction

For these applications, Grouped Query Attention (GQA) offers a middle ground, sharing K/V among groups of heads rather than all heads.