The Shapes of Multi-Head Attention

Following the dimensions — batch, sequence, heads, head-dimension — turns multi-head attention from a diagram into something you could implement. The key trick is that heads are just a reshaped view of one big projection.

Large Language Models: From Transformers to Frontier Models

Sign up free to read the rest of this lesson