🤖 AI Hot

DeepSeek-V4.1-Flash: 890-Byte KV Cache Compression

A
Alex Chen

DeepSeek has published the technical report for DeepSeek-V4.1-Flash, and the headline number is unusual: a global KV cache footprint of 890 bytes per token. That is roughly one quarter of what its predecessor, DeepSeek-V4-Flash, required, and a 437-fold reduction relative to the original DeepSeek V1. For anyone running long-context agents, this is one of the more consequential open source AI models to land in months, not because of raw parameter count but because of what it does to the memory and bandwidth math that dominates inference cost.

The paper (arXiv:2609.19969, submitted September 17, 2026) describes a multimodal Mixture-of-Experts model with 552 billion backbone parameters and support for a one-million-token context window. But the parameter count is almost the least interesting thing about it. The model activates only 8 billion parameters per token during prefill and 16 billion during decode. That asymmetry is deliberate, and it is aimed squarely at agentic workloads where prompts are enormous (tool outputs, file contents, multi-turn conversation) and generation is comparatively short.

The Causal Encoder-Decoder Architecture

Most Transformer decoders store key-value states at every layer, so the KV cache grows linearly with both sequence length and layer count. DeepSeek-V4.1-Flash breaks that relationship with a Causal Encoder-Decoder (CED) design. The 40 Transformer layers are split into two 20-layer halves: a causal encoder and a decoder. The decoder’s global KV cache is projected once from the final hidden states the encoder produces, and that single projection is reused across all decoder layers.

This is why a 552B model can activate so few parameters per token. The MoE routing helps too: 6 of 384 routed experts fire per token, plus one shared expert. The practical effect is that the expensive side of the ledger — prefill on long prompts — gets cheaper, which is exactly where agent workloads hurt.

The trade-off is architectural: you are giving the decoder access to a compressed, projected representation of context rather than full per-layer hidden states. The paper’s argument is that for the input-heavy, output-light pattern of agentic tasks, that trade is worth it. The benchmark results, which I will get to, largely back that up.

Compressed Sparse Attention 2 and FP4 KV Caching

The headline “890 bytes per token” figure comes from stacking two techniques. The first is Compressed Sparse Attention 2 (CSA2), which assigns each attention layer a static mode — Full, Reindex, or Reuse — so layers share KV data and reuse sparse-attention indices instead of recomputing them. A Hierarchical Sparse Indexer narrows the candidate pool in deeper indexing layers, which keeps indexing cost from scaling with total context length. That matters enormously at the one-million-token ceiling.

The second technique is FP4 KV caching using the E2M1 format, with one E4M3 scaling factor applied per 16 channels. This is layered on top of CSA2 to shrink memory use further without a separate quantization pass. Combined, they bring the footprint down to 890 bytes per token, held entirely in HBM.

There is also a deployment optimization called SWA Bounded Replay. Some layers use sliding window attention, which normally requires writing SWA states to disk so they can be recovered later. DeepSeek instead replays only the most recent window of tokens to reconstruct what is needed, skipping the SSD round-trip. This cuts the persistent KV cache (the copy that lives on SSD or in host memory) to about one-eighth the size of DeepSeek-V4-Flash.

Why this matters is worth spelling out. KV cache is not a theoretical concern. On long contexts it becomes the dominant memory consumer, and moving it between HBM, host memory, and SSD dominates latency and cost. A four-fold reduction in global KV cache and an eight-fold reduction in persistent KV cache changes what hardware can realistically serve a million-token model, and at what price.

LLM Benchmarks 2026: Where V4.1-Flash Lands

The benchmark story is nuanced, and I want to be precise about it rather than cherry-pick. The model card reports strong performance on agentic coding and tool-use tasks — Terminal-Bench 2.1, DeepSWE v1.1, and CyberGym — where it is competitive with or ahead of frontier peers. This makes sense given the design. Agentic benchmarks reward long-horizon reasoning over many tool calls, which is exactly the workload the CED architecture and the compressed cache are optimized for.

Where the model trails is on raw knowledge and some long-context recall benchmarks. This is the classic efficiency-vs-capability trade. The compressed KV representation and the lower activated parameter count save enormous cost, but they do not give you more raw knowledge density than a model that keeps full per-layer hidden states. If you need a general-purpose chatbot that scores high on trivia-style knowledge evals, this is probably not the first model you reach for. If you need an agent that runs cheaply over long, tool-heavy trajectories, it is a strong candidate.

Training followed a 45-trillion-token multimodal pretraining corpus. Sparse attention was trained at a 64K sequence length, then the context was extended to the full million-token window with an additional 34 trillion tokens. Post-training is the standard supervised fine-tuning to reinforcement learning to on-policy distillation pipeline, with no algorithmic changes. The paper is explicit that the gains came from the data side: large-scale automated generation of agent tasks and environments, scaled across data volume, task variety, and rollout count. That is a meaningful admission — it says the edge came from better training data, not a new RL trick.

One post-training feature worth calling out is a continuously controllable reasoning effort parameter, an integer from 1 to 100. Instead of picking between fixed model tiers, developers can dial inference cost against accuracy on a sliding scale. That is genuinely useful for production, where different requests have different latency and accuracy budgets.

Comparing to the Alternatives

DeepSeek-V4.1-Flash is not the only efficiency-focused open model, and an honest AI agent framework comparison should put it next to the obvious peers. The relevant axis here is cost per token of long-context agentic inference, not raw benchmark glory.

The closest comparisons are DeepSeek’s own prior V4-Flash and the wider field of low-activation MoE models. V4-Flash was already cheap, but V4.1-Flash cuts its KV cache by roughly four times and its persistent cache by eight times while improving agentic benchmarks. Against closed frontier models, the comparison is different: GPT-5-class and Claude-class models still win on some raw knowledge and instruction-following evals, but at a multiple of the inference cost for long contexts, and without the ability to self-host.

For self-hosters, the practical consideration is hardware. The paper positions the model as servable with dramatically lower memory requirements than a 552B parameter count would suggest, because of the low activated-parameter count and the compressed cache. I would not trust marketing numbers here without testing, but the architectural claims are specific enough to be falsifiable: if the global KV cache really holds at 890 bytes per token in HBM, a million-token context is about 890 MB of KV cache, which is dramatically more tractable than the multi-gigabyte footprints of comparable models.

The Economics of Agentic Inference

To understand why this model exists, you have to look at where inference cost actually goes in 2026. A typical long-horizon agent run is not one prompt and one answer. It is a loop: the model reads a task, calls a tool, reads a large tool result, calls another tool, and so on, dozens or hundreds of times. Each turn re-sends the entire accumulated context. The result is that prefill — processing the input prompt — dominates the cost, and the KV cache, which has to hold all that context in memory across the entire loop, dominates the memory.

That is a fundamental mismatch with how most models are priced and optimized. Most models optimize for a mix of short interactive chat and modest context, where decode dominates and KV cache is an afterthought. DeepSeek-V4.1-Flash is built for the opposite: huge inputs, modest outputs, long memory. The 8B-prefill versus 16B-decode activation split is the clearest signal of intent, because it makes the prefill side cheaper precisely where agent workloads are most expensive.

The compressed KV cache compounds the savings. If your agent holds 100,000 tokens of context, a model with a 3,500-byte-per-token footprint needs about 350 MB of KV cache just for that context, while 890 bytes per token needs about 89 MB. Scale that to a million tokens and the gap becomes gigabytes. On a single GPU serving many concurrent agents, that difference directly determines how many requests you can fit in HBM, which determines your per-request cost. This is not an academic optimization. It is the difference between a self-hosted agent fleet being economical and being a money pit.

Hardware and Self-Hosting

If you want to run this yourself, the memory math is more forgiving than the 552B label suggests, but you still need real hardware. The weights for a 552B model, even with low activation, run to hundreds of gigabytes at full precision. In practice most self-hosters will serve it quantized, and the FP4 KV caching already reduces the cache side of the equation. The paper and the model card are specific enough that you can validate the claims on your own hardware: watch the actual HBM footprint during a long-context decode and confirm the 890-byte-per-token figure holds rather than taking it on faith.

The Rust-based deepseek-recipe toolkit is a nice touch for prompt encoding, but the missing Jinja chat template means you will be writing some integration glue before you can drop this into a standard serving stack. Budget for that.

Who Should Use This

Developers and teams running long-horizon agents — coding agents, browser agents, multi-step tool use — are the primary audience. The cost profile is built for exactly that shape of workload. Teams that already self-host DeepSeek models will find the migration path straightforward, and the MIT license removes the legal friction that many other models carry.

Researchers interested in KV cache compression will also want to read the paper directly. The CED architecture and CSA2 are concrete, reproducible techniques, and the model card is unusually detailed about where the gains come from. Checkpoints are available on Hugging Face at deepseek-ai/DeepSeek-V4.1-Flash, alongside a Rust-based toolkit called deepseek-recipe for prompt encoding.

Who Should NOT Use This

If your workload is short-prompt, high-knowledge-density, or you need the absolute strongest general-purpose assistant, this is probably not your model. The compressed cache and low activated-parameter count are real trade-offs, and the paper itself acknowledges the model trails on raw knowledge and some long-context evals. You would be paying for efficiency you do not need.

You should also not use this if you need a plug-and-play chat template out of the box. The model ships without a Jinja chat template by default, which is a real annoyance for quick integration. It is solvable, but it is friction you should know about before you start.

Limitations and Caveats

The biggest caveat is that I am reporting from the model card and the technical report, not from my own benchmarks. Independent evaluation is still thin, and DeepSeek has historically been selective about which benchmark numbers it highlights. The agentic wins are credible and align with the architecture, but the “competitive with frontier peers” language deserves a skeptical read until third-party evals land.

The CED architecture itself is a bet. Cross-layer KV reuse trades representational richness for memory efficiency, and the long-term ceiling of that approach is not yet proven at extreme context lengths. The paper shows strong results at up to a million tokens, but million-token evals are notoriously noisy and hard to do well.

Finally, the MIT license is a genuine differentiator, but it does not mean the weights are easy to run. A 552B model, even with 8B/16B activation, still needs substantial aggregate memory for the weights themselves. “Cheaper than before” is not the same as “cheap.”

The pattern here is clear: DeepSeek is betting that the future of inference is dominated by long-context agents, and it is engineering specifically for that. The 890-byte figure is the concrete expression of that bet, and it is a number the rest of the open source field will now be measured against.

Disclosure: CarCare Guide is reader-supported. When you buy through links on our site, we may earn an affiliate commission at no extra cost to you. Learn more.
A
Alex Chen