Home Tools Glossary Multi-Query Attention
Technique

Multi-Query Attention

Multi-Query Attention (MQA)

/muhl-tee-kweer-ee uh-ten-shun/

A transformer attention variant that shares a single key-value head across multiple query heads to reduce memory bandwidth bottlenecks.

In plain English
While standard attention uses separate memory keys and values for every single attention head, Multi-Query Attention shares key-value pairs across all heads, dramatically speeding up inference memory bandwidth.
Real-world example
Serving long-context language models efficiently with reduced KV cache memory footprints.
Technical definition
Multi-Query Attention (MQA) is an optimization of the Transformer self-attention mechanism where multiple query heads share a single key and value head. By drastically reducing the size of the Key-Value (KV) cache, MQA lowers memory bandwidth consumption during autoregressive inference, significantly increasing generation throughput.