Decode the acronym MHA in the transformer attention context.
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
MHA stands for Multi-Head Attention, the Vaswani 2017 baseline where h independent (Q, K, V) heads run in parallel inside one attention layer.
Picture a panel of expert reviewers reading the same document. Each reviewer has a different angle: one tracks grammar, one tracks logic, one tracks tone, one tracks references. They all read the same text at the same time, write their notes independently, and the editor then merges the notes into a final report. MHA is that panel inside one step of a transformer. Several reviewers (called heads) work on the same sentence at the same time, each with their own private set of reading glasses, each picking up on a different kind of relationship between words. At the end, their notes are stitched together and combined into one summary the model uses to keep thinking.
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.
3m: what MHA stands for, the parallel-head mechanism, why parameters are unchanged vs single-head, parallel specialization across heads, and the relationship to MQA, GQA, MLA.
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.
Reading MHA as 'masked head attention' or thinking the h heads increase parameter count. Heads partition the existing d_model budget; the M stands for Multi, not Masked.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.