podcasts / The attention family / episode / question
Question

How are the outputs of multiple attention heads combined into one context vector per token?

Answered from Introduction to Multi-Head Attention (MHA) | The attention family series - Lecture 8 · The attention family · 2026-10-03

Sreedath Panat of Vizuara shows that each head's context vectors are concatenated along the embedding dimension, so two heads of six three-dimensional vectors become one six by six matrix. Because concatenation leaves the first three dimensions owned by head one and the last three by head two, the result then goes through an output projection, a square matrix sized by the embedding dimension, which mixes the values so no dimension can be traced to a single head. The projection keeps the shape unchanged: 12 tokens in 6 dimensions stay 12 by 6.

Source: our own transcription of the episode. The full conversation is on The attention family (2026-10-03). Read the whole episode summary →

▸More from this episode

Q1Why do transformers use multiple attention heads, according to Vizuara?Q3How many dimensions does each attention head get in GPT-2 and GPT-3?Q4Why is implementing multi-head attention with a for loop slow?Q5What is the weight split approach to multi-head attention that Vizuara teaches?Q6Why do you transpose dimensions 1 and 2 when computing batched multi-head attention?
Transcribe your links. Paste a YouTube, Google Drive or podcast link and WhipScribe gives you the transcript. Transcribe a link →