Grouped-Query Attention (GQA)
Also known as: GQA
Category: Neural Networks & Architectures
An attention variant that groups query heads into clusters sharing keys and values, balancing quality and inference efficiency.
Full Explanation
Grouped-Query Attention (GQA), introduced by Ainslie et al. in 2023, is a middle ground between standard multi-head attention and multi-query attention. It divides the query heads into groups, where each group shares a single set of key and value projections. For example, with 32 query heads and 8 KV heads, every 4 query heads share one KV head. GQA reduces KV cache memory proportionally to the number of groups, providing significant inference speedups with minimal quality degradation. GQA approaches the quality of full multi-head attention while achieving much of the efficiency of multi-query attention. It has been adopted by LLaMA 2, Mistral, and many other modern large language models as the default attention configuration. GQA can also be obtained by uptraining existing multi-head attention models.
Related Terms
More in Neural Networks & Architectures
Explore More
- AI Tools Library — Discover AI tools related to Grouped-Query Attention (GQA)
- AI Education — Courses to learn about Neural Networks & Architectures
- AI News — Latest news and updates