Multi-Query Attention
Also known as: MQA
Category: Neural Networks & Architectures
An attention variant that shares a single set of keys and values across all attention heads, dramatically reducing KV cache memory during inference.
Full Explanation
Multi-Query Attention (MQA), proposed by Shazeer in 2019, modifies standard multi-head attention by using separate query projections for each head but sharing a single key and value projection across all heads. This dramatically reduces the size of the key-value (KV) cache during autoregressive inference, as only one set of keys and values needs to be stored instead of one per head. The KV cache reduction translates directly to lower memory usage and faster inference, especially for long sequences. MQA has minimal impact on model quality in practice. It was adopted in models like PaLM and Falcon. Grouped-Query Attention (GQA) later provided a middle ground between standard multi-head attention and MQA by grouping heads into clusters that share keys and values.
Related Terms
More in Neural Networks & Architectures
Explore More
- AI Tools Library — Discover AI tools related to Multi-Query Attention
- AI Education — Courses to learn about Neural Networks & Architectures
- AI News — Latest news and updates