AI State of the Art
SOTA/Advanced Attention Mechanisms/20 min
Section 80

DeepSeek V4.1-Flash: Read for 8, Write for 16

Listen as a podcast →

A Simple Observation About Agents

Watch what a coding agent does over a day: it reads tens of thousands of tokens (the repository, tool results, logs, the history) to write a few hundred (a command, a patch, an answer). Yet current models spend the same compute per token in both directions, and every token read leaves a trace in memory, the KV cache (explained in KV Cache), which must be kept, stored and moved around.

DeepSeek-V4.1-Flash's technical report, published on September 10, 2026 with MIT-licensed weights, is titled "Pushing the Limits of KV Cache Compression", and the title states the programme: what limits the deployment of long-context agents is no longer compute, it is the memory taken by caches and the bandwidth to move them. The whole model is built around that constraint: 552 billion mixture-of-experts parameters, but 8 billion active per token when reading and 16 when writing, and a cache brought down to 890 bytes per token.

The Idea: An Encoder-Decoder, but Causal

The very first Transformers were encoder-decoders: one half reads the input, the other produces the output (see the encoder-decoder architecture and BART). Language models then dropped that split for the decoder-only design, a single stack that handles input and output the same way.

V4.1-Flash brings the split back, drawing on a 2024 work (YoCo), with one decisive difference. Its 40 layers are arranged as 20 causal encoder layers followed by 20 decoder layers. The word "causal" matters: a classic encoder (BERT's) reads the whole text in both directions. Here the encoder reads left to right, like an ordinary decoder. When new tokens arrive (a tool result, a new message), it does not reread everything, it appends. The model thus keeps the incremental resumption agents live on.

The precise mechanism, as the report describes it: in a decoder-only model, every layer builds its own keys and values from its own state. In V4.1-Flash, the 20 decoder layers project their global keys and values from the output of the last encoder layer, with projection weights specific to each layer. Consequence: to read a text, running the first 20 layers is enough; the decoder gets its cache "almost for free". The report quantifies the saving: reading (the prefill) costs about half of an equivalent decoder-only model. One honest subtlety: every layer also keeps a small locally computed sliding-window attention over 128 tokens, and to avoid recomputing it over the whole text, the report replays only the last 128 tokens ("bounded replay"), an approximation whose effect it measures as negligible. The engine that exploits this setting was published on October 20, 2026: DeepInfer.

The Cache: From 40 Caches to Four

The second half of the programme is called CSA2 (Compressed Sparse Attention 2), the sequel to the sparse attention described in sparse attention and GLM-5.2. The report recalls that a cache can be compressed along three axes: the size of each entry (what MLA does), the sequence length (merging several tokens into one entry), and the number of layers. That third axis is the one CSA2 attacks.

Every layer gets one of three roles fixed in advance:

  • Full: it computes its own keys and values, and picks by itself the 512 positions of the context it will look at.
  • Reindex: it reuses the keys and values of the last Full layer, but makes its own choice of positions.
  • Reuse: it reuses everything, keys, values and chosen positions, and only computes the attention.

In V4.1-Flash, the encoder has just three Full layers (the first two layers only have a local window), and the decoder a single one, whose keys and values come from the encoder's output; all the others are Reindex or Reuse. Instead of 40 sets of global keys and values, there are four. Add cache storage in four bits (the FP4 format, with training adapted so precision holds) and the sums work out: 890 bytes per token, a quarter of V4-Flash, and according to the report's figure 437 times less than the first DeepSeek.

Why the cache is the real subject

On a one-million-token context, what limits the number of users a machine can serve is not compute, it is the memory taken by their caches, on the GPU during the conversation and on disk between two exchanges. Cutting the cache by four means serving four times more long conversations on the same hardware. The report adds a second gain, on the disk side: by no longer keeping the small local caches (rebuilt on demand by bounded replay), the persistent footprint falls to one eighth of the previous generation. And compute per generated token stays almost constant as the context grows: going from 4,000 to one million tokens, 256 times more, raises that cost by only a quarter.

One last trick, reserved for the decoder: the hierarchical indexer. Picking 512 positions out of a million is expensive if every layer starts over. Here, the decoder's first layer scans the whole context once and builds a pool of 16,384 candidate positions (2,048 blocks of 8); the following layers only search within that pool. Their search cost becomes independent of context length.

The Rest of the Spec Sheet

The backbone follows the DeepSeek recipe from MoE in practice: 384 routed experts plus one shared expert per layer, six routed experts active per token. The report adds a conditional memory of 196 billion parameters ("Engram"): tables looked up by runs of two to four tokens, prefetched from host memory, which relieve the network of pure memorisation and leave it the computation. An in-house speculative decoder (DSpark) speeds up generation. An image encoder trained from scratch (DeepSeek-ViT, up to roughly 1,344 × 1,344 pixels) is present from the start: 45 trillion tokens of pre-training, seven text tokens for every multimodal one, with sparse attention learned directly on 64,000-token sequences without any dense-attention phase. A one-million-token context.

And a reasoning-effort dial from 1 to 100, whose mechanics the report gives: during reinforcement learning, each answer carries the requested level, and a penalty on reasoning length, decaying exponentially with the level, teaches the model to think more or less. The result is measurable: going from 25 to 100 raises average accuracy on eight reasoning benchmarks from 67.1% to 76.3%, for roughly 2.5 times more output tokens (see controlling how much a model thinks).

The price stays in the house tradition: $0.15 per million input tokens and $0.60 for output at off-peak hours, double at peak. And a fact that matters to anyone who built on the previous high-end model: since September 14, 2026, calls to V4-Pro are routed to V4.1-Flash. A "Pro" retired in favour of a smaller "Flash" that beats it almost everywhere: the model lifecycle described on this page applies at every provider.

What the report says it did not invent

The most useful passage of the report fits in one sentence: post-training "introduces no algorithmic innovation". Supervised fine-tuning, reinforcement learning, then on-policy distillation, exactly V4's recipe. All the capability gains come from data: automated pipelines that synthesise agent tasks and build their environments at scale, and an infrastructure that runs thousands of agents in parallel to train them. When a lab of this level says the architecture serves to cut costs and the intelligence comes from the data, it is worth remembering.

What the Numbers Say, and What They Do Not

The report publishes a full table, at maximum effort, against Claude Opus 5, GPT-5.6 Sol, Kimi K3, GLM-5.3 and its own predecessors. Three readings.

Against its predecessor, it is clear-cut. On DeepSWE, 74.2% against 62.7% for V4-Pro and 54.4% for V4-Flash; on Terminal-Bench 4.0, 31.2% against 12.4% and 7.0%. A model with a third of V4-Pro's total parameters and a quarter of its active ones beats it almost everywhere. Routing V4-Pro away is not a commercial whim.

Against closed models, it is parity on the established. 74.2% against 74.0% for Opus 5 on DeepSWE, 90.6% against 89.1% on Terminal-Bench 2.1, 54.8% against 50.3% on Automation-Bench. At under a dollar per million output tokens, this is the heart of DeepSeek's argument since 2025, and it still holds.

On the hardest, the gap remains. 31.2% against 51.8% on Terminal-Bench 4.0, 36.8% against 56.3% on Humanity's Last Exam. The report says so itself, to its credit: standard benchmarks saturate, and score parity "does not imply that the model matches the frontier capabilities" of Fable 5 or Astra on complex tasks. It also flags its own blind spots: possible selection errors in sparse attention and the approximation of bounded replay, at the edges of what its tests cover. The grid from how to read a benchmark score applies: against what, on which benchmarks, at which effort setting.

Key Takeaways

  1. An asymmetry that follows usage: agents read a lot and write little, so V4.1-Flash spends half as much to read as to write.
  2. The encoder-decoder returns, made causal: the decoder builds its keys and values from the encoder's output, the encoder reads left to right to keep incremental resumption, and reading costs half as much.
  3. Four caches instead of forty: layers share their keys and values (CSA2), stored in four bits; 890 bytes per token, a quarter of the previous generation, an eighth on disk.
  4. Intelligence comes from data, not architecture: the report says it in so many words, the architecture cuts costs, post-training follows the standard recipe fed by agent tasks synthesised at scale.
  5. Parity on the old, lag on the new: level with Opus 5 on established coding benchmarks, far behind on the hardest, and DeepSeek acknowledges it. Remarkable value, not a frontier.
Check your understanding0 / 4

1. Why does V4.1-Flash activate 8 billion parameters per token when reading and 16 when writing, rather than the same number both ways?

2. V4.1-Flash's encoder is called « causal », whereas BERT's is not. What does that make possible?

3. By what mechanism does the KV cache fall to 890 bytes per token, about a quarter of the previous generation?

4. The report states that V4.1-Flash's post-training « introduces no algorithmic innovation ». Where do its capability gains come from, then?