podcasts / The attention family / episode / question
Question

How many dimensions does each attention head get in GPT-2 and GPT-3?

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

Vizuara's Lecture 8 gives the usual rule: with an embedding dimension d and n heads, each head works in d divided by n dimensions. GPT-2 had a 768-dimensional embedding and 12 heads, so each head works in 64 dimensions. GPT-3 had a 12,288-dimensional embedding and 96 heads, which Sreedath Panat rounds to about 128 dimensions per head. Panat notes each head could in principle use the full embedding size, but compute would blow up, so the d over n split is what is done in practice.

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?Q2How are the outputs of multiple attention heads combined into one context vector per token?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 →