{
  "id": "grouped-query-attention",
  "code": "PTL-0255",
  "term": "Grouped-Query Attention",
  "aliases": [
    "GQA",
    "multi-query attention",
    "MQA"
  ],
  "category": "foundations",
  "definition": "Grouped-query attention (GQA) is a transformer attention variant in which groups of query heads share a single key head and value head, using more key-value heads than multi-query attention but fewer than standard multi-head attention, to shrink the key-value cache and speed up decoding.",
  "description": "Multi-query attention, which uses one key-value head for all query heads, decodes much faster than multi-head attention but can lose quality. Ainslie et al. proposed GQA in 2023 as an intermediate setting and showed how to convert (\"uptrain\") an existing multi-head checkpoint to it using about 5% of the original pre-training compute. They reported that uptrained GQA came close to multi-head quality at a speed comparable to multi-query attention. Because the KV cache grows with the number of key-value heads, the savings matter most for long contexts and large batches.",
  "example": null,
  "broader": [],
  "narrower": [],
  "related": [
    "kv-cache",
    "flashattention",
    "pagedattention",
    "context-window"
  ],
  "introduced": 2023,
  "added": "2026-11-27",
  "sources": [
    {
      "title": "GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints",
      "authors": "Ainslie et al.",
      "year": 2023,
      "url": "https://arxiv.org/abs/2305.13245"
    }
  ],
  "url": "https://protologue.com/t/grouped-query-attention/",
  "citation": "Protologue. (2026). Grouped-Query Attention. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.9.1, PTL-0255). https://protologue.com/t/grouped-query-attention/"
}