Module 2 · Inside the block

Many heads, and what has actually been found inside them

In this lesson

  • 9 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 5 of 10 in this chapter

This chapter’s goalImplement single-head attention from scratch in NumPy, explain which half of a block holds most of the parameters and which half moves information between positions, and predict how grouped-query attention, key-value caching and a mixture-of-experts design each change memory and speed.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

Why more than one

A single attention head produces one set of weights per position: one opinion about where to look. That is limiting. A position often needs several things at once: the subject of its clause, the opening bracket it must close, the last time this entity was mentioned.

Running many heads in parallel, each with its own learned projections, lets the layer gather several different kinds of information in one step. Each head operates on a slice of the width: a model with width 4,096 and 32 heads gives each head 128 dimensions to work in. Total compute is roughly the same as one full-width head, so the parallelism is nearly free.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the AI, Actually Explained exam.

Stuck on something?Ask Anjali, your AI tutor

How to cite: Addaly (2026) ‘Many heads, and what has actually been found inside them’, in How a Language Model Actually Works. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/how-llms-work/many-heads-and-what-they-do (Accessed: 29 November 2026).