the.ai

Attention / Efficiency

verified

Grouped-Query Attention

Multi-head attention gives every head its own keys and values; multi-query gives them all one set. Grouped-query sits between: heads are divided into groups, and each group shares. It recovers most of the quality lost by full sharing while keeping most of the memory saved.

Viz primitive · budget-splitgroups = 8 · heads = 64

groups holds 50% of the budget; rest holds the remaining 50%.

Cache taken by the shared key and value groups against the rest of memory. Drag the group count from one to the head count to move between multi-query and multi-head.

8

Reviewed by opendroid · 2026-08-04

  • arXiv:2305.13245 — GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints