Multi-Head Attention
The whole model
One forward pass, from text to the next token. Click any part, or step through it.
Attention up close
Every head of the attention sublayer, and the computation inside one of them.
KV cache per token, per layer
Values stored per token for 16 query heads of dimension 128, the head layout of DeepSeek-V2-Lite. GQA uses 4 groups; MLA a 512-dim latent plus a 64-dim rotary key; DSA adds a 128-dim index key.
During generation the KV cache, more than the arithmetic, limits how long a context or how large a batch fits in GPU memory, and reading it back slows every new token. That is why these variants exist.
MQA shrinks the cache the most but can cost quality. GQA recovers most of that quality at close to MQA's speed (Ainslie et al., 2023). DeepSeek reports MLA outperforming MHA in its ablations while caching about as much as GQA with 2.25 groups.
The two newer designs attack the growth with length itself. Gated DeltaNet replaces the cache with a fixed-size memory, so Qwen3-Next keeps a per-token cache in only 12 of its 48 layers. Sparse attention still stores every token, but each new token reads only the 2,048 that its indexer selects, so the work per token stops growing with the context.
* Gated DeltaNet stores nothing per token. Each layer keeps one fixed-size state instead: 16 heads × 128 × 128 = 262,144 values at the sizes compared here, however long the context.
A projector into the token stream
From pixels to tokens
One image on its way into the language model. Click any part, or step through it.
Up close
What one image costs
Sparse retrieval
From a question to the documents
Every text becomes a vector; a document’s score is its dot product with the query’s. Open the boxes on the arrows for each step.
Input
Vocabulary
Sparse vectors
Output
What the model receives
Thinking
A reasoning model such as DeepSeek-R1 thinks by writing. After <think>, every token is one more pass through the same network, and every pass reads all the text before it: the question and the thinking so far.
One thought, one token at a time
Step through the thought or play it, and click any part of the diagram for what it does.
Coming soon
Agents
How a language model uses tools in a loop to finish multi-step tasks.
Planned
- The agent loopModel → tool call → result → model, until the task is done.
- ToolsFunction definitions, structured calls, and how a call is decoded token by token.
- ContextWhat goes into the window on every turn: instructions, history and tool results, and what is cached.
- Memory and planningNotes, task lists and summaries that let work continue beyond one context window.
- ProtocolsStandard ways to connect models to tools and data, such as the Model Context Protocol.
This page is a placeholder; its explorer is not built yet. Back to the architectures