Multi-query attention
Method · 2019 · Also known as MQA
Definition
“Multi-head attention layers, as used in the Transformer neural sequence model, are a powerful alternative to RNNs for moving information across and between sequences.”
From the defining paper: Fast Transformer Decoding: One Write-Head is All You Need (Noam Shazeer, arXiv preprint).
Lineage
Parent: Multi-head attention
Children: Grouped-query attention
Incoming edges (1)
improves · memory efficiency
From Multi-head attention · confidence 1 (All three quotes are verbatim substrings of the to-paper abstract; confidence 1.0.)
- Bottleneck
- “is often slow, due to the memory-bandwidth cost of repeatedly loading the large” Source: Fast Transformer Decoding: One Write-Head is All You Need
- Mechanism
- “the keys and values are shared across all of the different attention” Source: Fast Transformer Decoding: One Write-Head is All You Need
- Trade-off
- “incur only minor quality degradation from the baseline” Source: Fast Transformer Decoding: One Write-Head is All You Need
Outgoing edges (2)
improves · accuracy
To Grouped-query attention · confidence 0.8 (Tradeoff quote is null; confidence 0.8.)
- Bottleneck
- “However, MQA can lead to quality degradation” Source: GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints
- Mechanism
- “introduce grouped-query attention (GQA), a generalization of multi-query attention” Source: GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints
- Trade-off
- No trade-off quoted.
improves · memory efficiency
To Multi-head Latent Attention · confidence 0.8 (Tradeoff quote is null; confidence 0.8.)
- Bottleneck
- “characterized by economical training and efficient inference” Source: DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model
- Mechanism
- “significantly compressing the Key-Value (KV) cache into a latent vector” Source: DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model
- Trade-off
- No trade-off quoted.