// deepseek v4.1 flash
The most interesting number of this launch is not the size of the model.
DeepSeek published V4.1 Flash with 552 billion parameters, a million tokens of context and open weights under an MIT licence.
But the figure that best explains what changed is a different one.
890 B
Global KV cache, per context token
It was around 3.5 KB in V4 Flash. Close to 389 KB in DeepSeek V1.
| Model | Global KV per token | Global KV for 1M tokens |
|---|---|---|
| DeepSeek V1 | ~389 KB | ~389 GB |
| DeepSeek V4 Flash | ~3.5 KB | ~3.5 GB |
| DeepSeek V4.1 Flash | 890 B | ~0.89 GB |
This is not quantisation alone. To get there DeepSeek changed how it reads the prompt, what memory it shares between layers, how many bits it stores it with and how long it decides to keep it.
Available now on every Helmcode plan, on EU infrastructure, with zero log retention.
10 September 2026
- Parameters
- 552B
- Active per token
- 8B prefill / 16B decode
- Context
- 1M
- Global KV
- 890 B/token
- Licence
- MIT
// reading routes
You do not need to read the whole piece. Choose how deep you want to go.
// the whole thing
Before going in piece by piece, this is the whole machine.
The whole thing
LONG AGENT CONTEXT
02 CAUSAL ENCODER · 20 LAYERS · 8BGLOBAL MEMORY
PERSISTENT · ≥72 H
HOST DRAM · MINUTES
OUTPUT
Four decisions explain almost the whole story:
- The prompt stops walking all 40 layers.
- Most layers stop keeping their own global KV.
- The global KV drops from FP8 to FP4.
- The local memory stops being persisted for hours.
I the problem
// 01 · input-heavy inference
Why an agent changes inference.
An agent reads files, runs code, calls tools, receives results, fails, reads the error again and carries on. At every step it drags most of what came before along with it.
When you send a prompt to a model two things happen, simplifying. First it reads it: prefill. Then it generates the answer token by token: decode.
So that it does not recompute the whole context on every token, the model keeps intermediate representations of what it read. The first time round you can think of them as working notes. The real name is KV cache.
In a short conversation this matters little. On a long agent trajectory it does not.
- prompt
- read repo
- tool result
- edit
- test
- error
- read error
- edit
- ...
Every result is appended to the next request. After enough steps, the model can receive hundreds of thousands of tokens and generate only a few hundred.
Two different costs show up there: computing the input, which is prefill compute, and storing and moving its memory, which is the KV cache.
Sparse attention has cut the first problem a great deal. In doing so, the second weighs more: the active cache occupies HBM, reusable prefixes need storage outside the GPU, and moving all that state consumes bandwidth.
V4.1 Flash is built around that second half.
Global KV cache per token
Logarithmic scale. On a linear one the small bars would be almost invisible.
II four decisions
// 02 · CED
Reading the prompt with half the model.
V4.1 Flash has 40 Transformer layers, but the prompt no longer walks all of them the same way.
You can think of the first 20 as the reader and the other 20 as the writer. Technically DeepSeek calls them causal encoder and decoder.
They are not two independent models. They still form a single autoregressive architecture of 40 layers. What changes is where the prompt goes.
Where the prompt goes
CONVENTIONAL TRANSFORMER
PROMPT
40 LAYERS · ALL OF THEM READ IT
V4.1 FLASH
PROMPT
CAUSAL ENCODER · 20 LAYERS · 8B
DECODER · 20 LAYERS · 16B
For global attention, the prompt stops walking the second half layer by layer.
For global attention, each decoder layer projects the KV it needs from the final representation of the encoder. It does not need to walk the whole prompt again layer by layer.
That is where one of the strangest numbers in the model comes from: 8B active parameters per token at prefill, 16B at decode. Reading uses less model than writing.
On an agentic workload that makes sense: the call can carry far more input than output.
8 / 16 B
Active parameters per token, prefill and decode
Reading uses less model than writing.
what the encoder cannot hand over
The separation is not total. V4.1 keeps Sliding Window Attention in all 40 layers, with a local window of 128 tokens.
The decoder needs to rebuild that local state before generating. Doing it exactly would be expensive, so DeepSeek replays only the last 128 tokens.
The cost of prefill goes from roughly O(N × L) to O(N × L/2 + n_window × L/2). For long contexts the second term is small and the main cost of reading lands close to half.
// 03 · CSA2
Sharing the memory between layers.
Cutting prefill solves one part. The other is how much memory the model holds while it works.
V4.1 introduces Compressed Sparse Attention 2, CSA2.
There are three ways to compress attention: make each entry of the memory smaller, store or query fewer positions, or stop every layer from keeping an independent copy of very similar information. CSA2 pushes the third one in particular.
A Full layer builds its global KV and does the complete search for the positions to attend to. A Reindex layer reuses the global KV of an earlier Full layer, but scores the positions again with its own query. A Reuse layer reuses both the global KV and the Top-K selection.
Full, Reindex and Reuse
FULL · KV + SEARCH
REINDEX · SHARED KV + NEW SEARCH
REUSE · SHARED KV + SHARED TOP-K
Sharing KV does not force every layer to look at the same positions.
Sharing memory does not force every layer to look at exactly the same information. The Reindex layers keep the ability to change the selection.
The 40 layers split into 4 Full, 4 Reindex, 30 Reuse and 2 that only do SWA. The 30 Reuse layers reuse both the global KV and the selection computed by another layer. They still have their own query and their own local SWA state.
The 40 layers by mode
CAUSAL ENCODER · 20
DECODER · 20
- FULL (4)
- REINDEX (4)
- REUSE (30)
- SWA ONLY (2)
30 / 40
Layers that reuse another layer’s KV and selection
Four build both, four re-score the positions, two keep only the local window.
This is what lets an architecture that is more complex on paper have a very short execution in some layers. DeepSeek reports paths of 15 kernels in prefill and 11 in decode for the Reuse layers.
searching a million tokens without searching a million
Sharing KV does not by itself solve the cost of deciding where to look.
The first Full layer of the decoder does the wide search. It selects its Top-512 positions and, at the same time, builds a pool of candidates out of 2,048 blocks of 8 positions: 2,048 × 8 = 16,384 candidates.
Hierarchical Sparse Indexer
1,000,000 TOKENS
FULL INDEXER
16,384 CANDIDATES
REINDEX
TOP-512
The deep Reindex layers score a fixed pool instead of the whole context.
The Reindex layers below it score that pool instead of searching the full million tokens again. With a fixed pool, the cost of those indexers stops growing linearly with the total length of the context.
The restriction is introduced during training, so the model learns to search inside the same space it will have in production.
CSA2 also takes pieces out
CSA2 is not only CSA with reuse between layers.
It also removes the overlap between compressed entries, removes the absolute positional embedding the indexer used, and derives the indexer K from the main KV instead of keeping a separate compression path from the hidden states.
There is more reuse, and also less machinery.
// 04 · FP4
Storing the global KV in four bits.
After cutting the number of independent caches, DeepSeek cuts the size of each one.
V4 Flash stored its main KV in FP8. V4.1 takes the global KV down to FP4.
Not all of the memory goes to four bits. The KV belonging to Sliding Window Attention is more sensitive to quantisation and stays in FP8.
The quantisation is introduced during post-training through Quantization-Aware Training. The model learns under the same numeric conditions it will later have to work with.
DeepSeek uses E2M1 with an E4M3 scale for every 16 channels. It applies the quantisation after RoPE and removes an additional global scale that other NVFP4 formats do use.
why they can remove that scale
The format admits magnitudes of approximately 2,688. The theoretical bound computed for the KV values is around 22.6, and during training they observed peaks close to 10.
There is a lot of numeric headroom.
DeepSeek also dequantises before running attention, which avoids depending on native support for that particular FP4 multiplication.
// 05 · cache hierarchy
Separating the memory that lasts hours from the memory that lasts minutes.
V4 persisted two memories with very different reuse patterns.
The global KV can still be useful hours or days later. The SWA KV describes the recent local state of a session and usually loses its value much sooner.
In V4 both could end up occupying persistent storage for a long time. In V4.1 they are separated.
How long each cache lives
In V4 both could be persisted for far longer.
The global KV stays in persistent storage, with a guaranteed life of at least 72 hours in the design described. The SWA moves to a distributed pool built from approximately 10% of the host DRAM of each machine, and lives for minutes.
The interesting part shows up when that local memory has already expired. V4 had proposed rebuilding it. Doing that exactly was too expensive for production.
V4.1 uses Encoder SWA Bounded Replay: it replays only the last 128 tokens. It does not rebuild exactly the same state. It bounds the cost of recovery.
A miss stops opening a large recomputation and gets a bounded cost instead.
Along with the rest of the changes, the persistent cache lands at around 1/8 of V4 Flash. Part of the improvement comes from storing the memory better. Part comes from not storing it.
1 / 8
Persistent cache, against V4 Flash
Part of the improvement comes from storing the memory better. Part comes from not storing it.
What happens to an agent's repeated context
III cost and results
// 06 · checkpoint
V4 Flash → V4.1 Flash.
After the four decisions, the change can be summed up like this.
| V4 Flash | V4.1 Flash | |
|---|---|---|
| Backbone | 284B | 552B |
| Active/token | 13B | 8B prefill / 16B decode |
| Prompt | walks the whole backbone | CED: 20 encoder + 20 decoder |
| Attention | CSA + HCA | CSA2 |
| KV between layers | mostly independent | Full / Reindex / Reuse |
| Global KV | FP8 | FP4 |
| Persistent SWA | yes | temporary DRAM + replay |
| Global KV/token | ~3.5 KB | 890 B |
| Persistent cache | baseline | ~1/8 |
There is a less obvious change behind the table. V4.1 almost doubles the backbone, from 284B to 552B, but the active path does not grow in the same proportion.
More total capacity does not mean paying for all that capacity on every token.
// 07 · compute, memory, bill
Compute, memory and the bill.
The four decisions attack different resources.
- Less compute when reading.
- CED makes the long context go mainly through 20 layers during prefill.
- Less HBM per context.
- CSA2 shares KV between layers and FP4 reduces the size of the global KV.
- Less persistent storage.
- The local memory stops living for hours, and Bounded Replay makes rebuilding it approximately affordable.
- Less indexing work.
- The deep Reindex layers search inside 16,384 candidates, not the whole context.
- Less overhead in the Reuse layers.
- DeepSeek reports 15 kernels in prefill and 11 in decode for that path.
- More reusable prefixes on the same infrastructure.
- If each prefix takes less room, more of them fit. If more fit, the chances of a cache hit go up.
From 4K to 1M
From 4K to 1M tokens the context grows 256×. The cost of decoding a token, measured by DeepSeek in precision-weighted FLOPs, grows around 25%.
The metric weights BF16 = 1, FP8 = 0.5 and FP4 = 0.25. It is not end-to-end latency and it is not an invoice. It is useful for seeing the goal: that the cost per generated token should stop growing in proportion to the length of the context.
Decode FLOPs per token
- V4 FLASH
- V4.1 FLASH · +25% FROM 4K TO 1M
FLOPs weighted by precision: BF16 = 1, FP8 = 0.5, FP4 = 0.25.
Where it shows up in price
DeepSeek cut its rates with the launch. The largest cut is on cached input, which is exactly the part that matters most when an agent resends a growing trajectory and much of that context has already passed through the system.
| V4 Flash | V4.1 Flash | Change | |
|---|---|---|---|
| Input with cache hit | $0.007/M | $0.003/M | -57% |
| Input without cache hit | $0.22/M | $0.15/M | -32% |
| Output | $0.66/M | $0.60/M | -9% |
Price cut
Price per million tokens, off-peak.
The 890 bytes are not an abstract metric: they end up changing how much context can be kept reusable and how much it costs to use it again.
// 08 · model + scaffold
The benchmarks do not tell a single story.
V4.1 Flash does not win everything.
On several agentic and software benchmarks it competes with very large closed systems. On harder reasoning and expert-knowledge tasks there are still clear differences.
On Codeforces it reaches 3,471, against 3,348 for V4 Pro and 3,289 for V4 Flash.
DeepSeek also publishes perplexity tests on internal corpora, company documentation, private repositories and academic material, much less exposed to contamination than public benchmarks. The base model of V4.1 Flash improves on that of V4 Pro across all three reported sets.
Slide the table to see every column.
| Benchmark | V4.1 Flash | Opus 5 | GPT-5.6 Sol |
|---|---|---|---|
| Terminal-Bench 2.1 | 90.6 | 89.1 | 88.8 |
| DeepSWE v1.1 | 74.2 | 74.0 | 73.0 |
| AutomationBench | 54.8 | 50.3 | 45.8 |
| Agents' Last Exam | 31.8 | 28.6 | 26.7 |
| CyberGym | 88.1 | - | 84.5 |
| Terminal-Bench 4.0 | 31.2 | 51.8 | 39.9 |
| ProgramBench | 20.3 | 37.0 | 23.0 |
| GPQA Diamond | 90.9 | 93.4 | 94.1 |
| Humanity's Last Exam | 36.8 | 56.3 | 44.5 |
Reasoning effort at maximum. A dash means DeepSeek reports no figure.
There is another important variable: the harness.
the same checkpoint can move almost nine points
On DeepSWE v1.1, the same checkpoint gets around 65.5 with one harness and 74.2 with another. On Terminal-Bench 2.1, around 84.1 and 90.6.
The model did not change. The system around it did.
On agentic benchmarks we are measuring something closer to model + harness + tools + context strategy + inference.
The architecture that makes context cheap and the harness that decides how to use it are two different layers of the same system.
IV the rest of the architecture
// 09 · what stayed the same
What has not changed.
V4.1 introduces plenty of new mechanisms, but CED should not be read as if DeepSeek had turned the model into a classic encoder-decoder architecture.
- It is still an autoregressive model.
- It is still a MoE.
- It still uses local attention through SWA.
- It still uses sparse attention for long context.
- The decoder is not a second independent model.
- CED changes how the prompt is processed and reused inside the 40-layer stack.
// 10 · other changes
Other pieces that changed.
The four decisions above explain the bulk of the context economics. V4.1 also changes other parts of the system.
-
Engram
Adds approximately 196B parameters of conditional memory across two modules.
It memorises patterns of 2, 3 and 4 tokens through hash tables. Because the memory address can be computed directly from the input, those embeddings can be prefetched from host memory over RDMA while the Transformer carries on working.
More parametric capacity without keeping all of it resident in HBM.
-
DSpark
Replaces the previous MTP approach to speculative decoding.
A draft model proposes several tokens and an additional head estimates the probability of acceptance per position. The system combines that confidence with real throughput curves to decide how much speculation is worth it under load.
The goal is not to always propose more tokens. It is to maximise real throughput.
-
Single-Pass mHC
DeepSeek reorganises certain dependencies of its mHC residual connections so that operations can be fused into a Mega-mHC kernel.
The intended consequence is less activation traffic and fewer trips to memory.
-
Native vision
V4.1 Flash carries vision natively.
Before handing the visual representation to the language model, a 3×3 pixel-unshuffle reduces the number of visual tokens by approximately nine times.
Another way of cutting context before it reaches the expensive part.
// 11 · deployment topology
EPD: encoder, prefill and decode stop scaling together.
DeepSeek introduces Encoder-Prefill-Decode disaggregation, EPD.
- visual encoding
- prefill
- decode
The three phases have different hardware profiles. Prefill looks for massive processing throughput. Decode is far more sensitive to memory bandwidth and to latency. Visual encoding introduces a different load again.
EPD lets them be scaled independently and lets part of the work overlap.
For anyone consuming an API this is almost invisible. For anyone serving the model, it can change the whole topology of the deployment.
// same model, different economics
In DeepSeek Harness the idea was same model, different agent: the checkpoint does not by itself determine what an agent can do. The scaffold, the tools, the memory and the rules around it matter.
V4.1 Flash adds the other half. The inference architecture is not neutral either.
- CED changes what it costs to read again.
- CSA2 changes how much state each layer holds.
- FP4 changes how much that state occupies.
- The new cache hierarchy changes what is worth keeping for hours and what can disappear in minutes.
For years the main question of every launch was how smart the model was. Then what a token cost started to matter.
For an agent there is another unit that is starting to be more useful:
what it costs to finish the job.
V on helmcode
// 12 · run it
Running it on Helmcode.
V4.1 Flash is available on Helmcode now, on European infrastructure and with zero log retention.
It replaces V4 Flash in the same slot on the plans and keeps the model id, so an existing integration can receive the new architecture without changing the client.
curl https://api.helmcode.com/v1/chat/completions \
-H "Authorization: Bearer sk-your-key-here" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"messages": [
{
"role": "user",
"content": "Explain RAG in one sentence."
}
]
}' You need an active Helmcode or NaN subscription and an API key from your dashboard.
If you are choosing between the models included in your plan, V4.1 Flash makes sense when agentic work, long documents or the million-token window are what weigh. For RAG, classification, short code and other workloads, the choice may be a different one. see_the_model_guide →
// use it
Point your agent at it
V4.1 Flash is on every Helmcode plan, at a flat rate, on EU infrastructure with zero log retention.
Sources
- DeepSeek-V4.1-Flash: Pushing the Limits of KV Cache Compression. Technical report, September 2026.
- Model card and reference implementation of DeepSeek-V4.1-Flash.
- DeepSeek API documentation and pricing.
- DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence.
The numbers on this page come from the linked sources. Where DeepSeek does not publish a figure, we do not estimate it.