The Long-Context Tax: Token 32,768 Costs 20x Token 1
This week brought two very different answers to the same problem. Qwen4 uses Gated DeltaNet in 30 of its 40 layers. Amazon's Ergo, a 1.1T-parameter open-weight model, uses sliding-window plus grouped-query attention. The problem both are solving: every token an LLM generates re-reads the keys and values of every earlier token, in every layer.
I wanted the actual size of that tax, so I built the decode step from scratch in numpy and measured it on my MacBook (M4 Pro, 24 GB): six attention designs, one Qwen3-4B-shaped model, contexts from 0 to 32,768 tokens. Nothing was downloaded; random weights at real model shapes time exactly like trained ones. The full script is at the end.

What token 32,768 costs in units of token 1, with 32 users sharing the server:
- Multi-head attention (MHA): 78x, and an 18.0 GiB KV cache per user.
- Grouped-query attention (GQA, 8 KV heads), the default of most open models: 20x, 4.5 GiB.
- Multi-head latent attention (MLA), DeepSeek's design: 6.4x, 1.27 GiB.
- A 3:1 DeltaNet hybrid, Qwen4's layer ratio: 4.9x, 1.15 GiB.
- A 4K sliding window, the building block of Ergo and Gemma: 3.4x, 0.56 GiB.
- Gated DeltaNet (linear attention) alone: 1.0x, 0.04 GiB.
Then I ran the config.json of 19 open models through the same arithmetic. Per 128K-token conversation, Llama 3.1 70B keeps 40 GiB of cache, Amazon Ergo 8.1 GiB, Qwen4 2.6 GiB and DeepSeek V4 Flash 0.68 GiB.
I think the KV cache, not FLOPs, is now the main design constraint of open LLMs. Every architecture trend of 2026 shrinks the bytes kept per token; none of them makes the matrix multiplications cheaper.
Btw, for a single user the tax is only 1.6x on a GQA model at the bandwidth floor. It explodes when a server batches users, which is what everyone paying for inference does. The rest of this post is the measurements behind each number, an architecture gallery of what each design stores, the 19-model simulation, and how this week's releases read through it.

