Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
GQA gives a tunable knob: share K and V across groups of query heads to shrink the KV cache like MQA, while keeping enough KV heads to hold MHA-level quality.
Picture a classroom where every student (a query head) needs to consult reference notes before answering. Multi-head attention gives each student a personal, hand-written copy of the notes, which is accurate but eats a huge amount of paper. Multi-query attention hands the whole class a single shared copy, saving paper but causing crowding and mistakes when the material gets hard. Grouped-query attention splits the class into small groups, say eight students per shared copy. You still save most of the paper, but each group's notes stay specialized enough that answers barely suffer. That middle setting is why modern language models pick it: nearly the savings of one shared copy, nearly the quality of personal copies.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: define MHA, MQA, GQA by KV head count, then the memory-bandwidth axis, the group-size knob and endpoints, why eight, uptraining, and where MLA fits.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Claiming GQA wins on compute or parameter count. The win is KV-cache bytes and bandwidth; the query side matmul is unchanged, and only the K and V projections shrink.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.