Multi-head attention
Method · 2017 · Also known as MHA
Definition
“The dominant sequence transduction models are based on complex recurrent or convolutional neural networks in an encoder-decoder configuration.”
From the defining paper: Attention Is All You Need (Ashish Vaswani, Noam Shazeer, Niki Parmar, et al., NeurIPS 2017).
Lineage
Parent: Transformer (scaled dot-product attention)
Children: Multi-query attention; FlashAttention
Incoming edges (1)
extends · parallelization
From Transformer (scaled dot-product attention) · confidence 0.8 (Tradeoff quote is null; confidence 0.8.)
- Bottleneck
- “complex recurrent or convolutional neural networks” Source: Attention Is All You Need
- Mechanism
- “based solely on attention mechanisms” Source: Attention Is All You Need
- Trade-off
- No trade-off quoted.
Outgoing edges (3)
improves · memory efficiency
To Multi-query 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
improves · inference speed
To FlashAttention · confidence 0.8 (Tradeoff quote is null; confidence 0.8.)
- Bottleneck
- “Transformers are slow and memory-hungry on long sequences” Source: FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- Mechanism
- “an IO-aware exact attention algorithm that uses tiling to reduce the number of memory reads/writes” Source: FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
- 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.