Skip to visualization
visualization / MQA · GQA

MinGPT · GQA / MQA

Grouped-Query & Multi-Query Attention
i
i
i
i
iGQA
i
i
i
i
i
Embed
Attention
MLP
Norm
Output
Cache
Click any highlighted line of code on the left
to see the corresponding transformer operation here.

🔍 Variable Inspector

click any code line
Click any line of code to inspect its variables, shapes, and meanings.

Click a code line or diagram node to inspect

About this lesson
Quick answer

What MQA and GQA Optimizations explains

Share key/value heads across many query heads to reduce cache bandwidth and memory.

Key concepts

Primary research

MQA 2019 · GQA extension 2023