Zenaique
Glossary · Architecture

Grouped-Query Attention (GQA)

Also known as: Grouped Query Attention, GQA

Compromise between MHA and MQA: query heads share KV heads in groups, cutting KV cache by 4-8x.

An attention variant where multiple query heads share a single set of key/value heads. Sits between multi-head attention (one KV per query) and multi-query attention (one KV total), trading quality for KV-cache size.

In practice

Powers LLaMA 2/3 70B and other large open models. Critical for serving cost: the KV cache shrinks proportionally.

How it compares

GQA reduces the KV cache size by sharing; the KV cache itself is what gets cached during inference.

Related topics

Related terms