Home Tools Glossary Grouped-Query Attention
Technique

Grouped-Query Attention

Grouped-Query Attention (GQA)

/groopt-kweer-ee uh-ten-shun/

A transformer attention variant that groups query heads to share key-value heads, balancing model quality and inference speed.

In plain English
Grouped-Query Attention acts as a sweet spot between standard attention and multi-query attention, grouping query heads together to share memory keys and values for fast inference without losing accuracy.
Real-world example
Balancing high inference generation throughput and model accuracy in open-weight foundation models.
Technical definition
Grouped-Query Attention (GQA) generalizes multi-query attention by partitioning query heads into multiple groups, with each group sharing a single key-value head. This architecture achieves an optimal balance between the high quality of multi-head attention and the memory bandwidth efficiency of multi-query attention, widely adopted in models like Llama 3.