One important fact, buried in an otherwise empty sequence, at some fixed position. A Transformer can find it — attention can look anywhere, regardless of distance. So can the selective state-space model from two chapters ago — it just writes the fact into its state and freezes there. Same right answer, every length. So what was this whole part actually about?
Change the sequence length. The recovered value never changes — both architectures get it exactly right, every time. The bars do change, and they're the entire point: getting the right answer was never in question. Paying for it was.
Two architectures, the exact same task, two completely different cost profiles:
- — the sequence length, the one quantity every cost figure here is measured against.
- Every number traces back to an earlier chapter
- The comes from Chapter 1's attention matrix.
- The memory comes from Chapter 3's key-value cache.
- The comes from Chapter 4's selective state collapsing an entire sequence's history into one fixed-size number.
- This capstone adds no new mechanism
It just puts the two totals next to each other on the one task where both architectures happen to get the same right answer.
This is Chapter 1's exact chart, finished. The dashed line was always the alternative worth reaching for; the last three chapters were about building an architecture that actually lives on it, on a real task, without sacrificing correctness to get there.
The buried-fact task at , signal value at position :
- Both get the right answer
- Transformer: attention weights concentrate on position regardless of ; the retrieved value is exactly .
- Mamba: the selective rule writes into its state at position and freezes it through all remaining filler tokens. Also exactly .
- The costs already aren't close
- Transformer: ops.
- Mamba: ops — a single pass, one step per token.
Ratio: gap, for a sequence barely long enough to need a computer at all.
- The memory gap is just as stark
- Transformer: cached key-value pairs, one per token processed so far.
- Mamba: state.
Neither number depends on where in the sequence the signal was — only on how long the sequence got before an answer was needed.
Find the smallest sequence length, among the candidates, where the Transformer's cost clears 10,000 ops.
Neither architecture is strictly better — a Transformer's full attention matrix is also exactly computable and easy to parallelize across an entire sequence at once, which a strictly sequential recurrence gives up. What this part actually established is narrower and more useful than "Mamba wins": the quadratic cost this part opened with is a real, measurable consequence of one specific design choice (an explicit pairwise comparison), not an unavoidable tax on processing sequences at all — and an architecture built around a different choice can match a Transformer's correctness on tasks like this one while asking for a very different amount of compute and memory to get there. The next part turns from how a model processes a sequence to what kind of thing it can generate from one, picking up the generative architectures — GANs (short for Generative Adversarial Networks), diffusion, VAEs (short for Variational Autoencoders) — from Part IV and pushing every one of them further.