DeepSeek-V4.1-Flash: How a Causal Encoder-Decoder Architecture Cuts Agent Memory Costs by 75%
Released on September 10, 2026, DeepSeek-V4.1-Flash is a 552-billion-parameter multimodal Mixture-of-Experts model that takes a fundamentally different approach to the KV cache problem. Rather than optimizing attention computation — the path DeepSeek-V4 took — V4.1-Flash attacks the memory footprint of long-running AI agents directly. The result is a global KV cache of 890 bytes per token, roughly one-quarter of what V4-Flash required, and one-eighth the persistent SSD storage.
DeepSeek describes V4.1-Flash as the first model in a new architecture lineage: the Causal Encoder-Decoder (CED) design, the Compressed Sparse Attention 2 (CSA2) cache-sharing system, FP4 cache quantization, and the elimination of persistent sliding-window attention storage are four distinct innovations working in combination.
Why Agent Memory Became the Binding Constraint
Every time a large language model processes a prompt, it generates key-value pairs for each token and stores them in a KV cache. For a basic chatbot, this overhead is manageable. For a long-running agent that spends hours reading tool outputs, inspecting code, and iterating on plans, the cache grows continuously — and at sufficient context length, it outgrows the model weights themselves. For enterprise teams running agents at scale, KV cache management becomes the dominant operational cost. The technical report on Hugging Face frames the entire architecture around this goal: "Pushing the Limits of KV Cache Compression."
The Causal Encoder-Decoder Split
The most structurally significant change in V4.1-Flash is the Causal Encoder-Decoder (CED) architecture. The model's 40 Transformer layers are divided into two asymmetric halves: a 20-layer causal encoder and a 20-layer decoder.
During the prefill phase — when the model reads a long input — only the 20 encoder layers process the full context. The decoder's global KV cache is then synthesized directly from the encoder's final hidden states, rather than being recomputed by each decoder layer independently. The practical consequence: the model activates only 8 billion parameters per token during input processing, compared to 16 billion during text generation. For input-heavy agentic workloads, this roughly halves the most computationally expensive phase. The design draws on the YOCO ("You Only Cache Once") research approach from 2024, which demonstrated that global KV caches could be shared across decoder layers rather than recomputed independently.
Compressed Sparse Attention 2: Three Modes of Cache Sharing
DeepSeek's prior V4 architecture used a static attention compression scheme. V4.1-Flash introduces CSA2, a cache-sharing system in which every Transformer layer is assigned one of three operating modes:
- Full: Compute a fresh KV cache and select the most relevant positions (top 512 per layer).
- Reindex: Share an existing KV cache from an earlier layer, but independently choose which entries to attend to using the current layer's own queries.
- Reuse: Share both the KV cache and the prior layer's attention selections outright — effectively saying "those notes look good, I'll use exactly those."
In Reuse mode, a decoder layer borrows the work of a shallower layer entirely, avoiding redundant KV storage and computation across the network's depth. A Hierarchical Sparse Indexer limits the candidate pool for attention indexing to 16,384 positions, keeping indexing costs stable regardless of context length.
FP4 Cache Quantization and SWA Bounded Replay
Two additional techniques complete the memory reduction:
FP4 quantization: V4.1-Flash stores its main global KV cache in 4-bit floating-point (E2M1) format rather than the FP8 used by V4, roughly halving the memory required per cache entry. DeepSeek applied quantization-aware training from the start, preventing the accuracy degradation that typically accompanies aggressive post-hoc quantization. The local sliding-window attention cache remains at FP8.
SWA Bounded Replay: Sliding-window attention state covers only the most recent tokens and becomes irrelevant quickly — yet in V4's prior architecture, SWA KV occupied nearly half of persistent SSD cache capacity unnecessarily. V4.1-Flash stops persisting SWA state to SSD entirely. A temporary DRAM pool holds SWA state for the brief window it is useful; when reconstruction is needed after a session pause, SWA Bounded Replay replays only the last 128 tokens. The practical effect: persistent SSD storage drops to one-eighth of V4-Flash's requirement.
Together, these four techniques reduce the global KV cache footprint to 890 bytes per token. A 1M-token context requires approximately 0.87 GiB of global KV cache — making million-token agent sessions economically viable at scale.
The Engram Module: Offloading Rote Recall
V4.1-Flash also integrates a 196-billion-parameter conditional memory module called Engram. Rather than forcing the Transformer backbone to memorize patterns and facts, Engram uses n-gram lookup tables (up to four tokens, roughly 16 million entries each) to handle rote recall. These tables reside in host memory and are accessed at specific layers (layers 1 and 14) during inference. By offloading pattern lookup to Engram, the backbone can dedicate its expensive computation to reasoning.
Benchmark Results and the Harness Problem
At maximum reasoning effort, V4.1-Flash posts competitive numbers on agentic benchmarks: 90.6% on Terminal-Bench 2.1, 74.2% on DeepSWE v1.1, and 88.1% on CyberGym — leading DeepSeek's own V4-Pro on all 12 agentic benchmarks where both models were evaluated, per the Progressive Robot analysis. On knowledge-intensive tasks, V4-Pro retains meaningful leads: SimpleQA-Verified (55.2 vs. 42.3), LongBench-V2 (51.5 vs. 45.2).
The most important finding in the technical report is not a benchmark score — it is the harness-variance data. The same V4.1-Flash checkpoint scored between 65.5% and 74.2% on DeepSWE v1.1 depending solely on which agent scaffold wrapped it. That 8.7-percentage-point range was produced by changing the evaluation framework, not the model. Single-percentage-point differences between models on agentic benchmarks are within the noise introduced by harness selection alone.
Pricing and the September 14 Cutover
V4.1-Flash introduces tiered peak/off-peak pricing. At off-peak rates: input cache hits at $0.003 per million tokens, cache misses at $0.15 per million tokens, and output at $0.60 per million tokens — more than 3x cheaper than V4-Pro's off-peak output rate ($1.98 per million). Starting September 14, 2026, all API traffic directed to deepseek-v4-pro will be automatically rerouted to V4.1-Flash at V4.1-Flash rates. The model is released under the MIT license, with weights available on Hugging Face as a 511 GB checkpoint.
Practitioner Implications
The CED + CSA2 + FP4 + SWA Bounded Replay combination is a coherent architectural response to a real deployment problem. For teams running production agent workloads where KV cache costs dominate the inference bill, V4.1-Flash represents a structural improvement, not a marginal one. What it does not change is the competitive ceiling on knowledge-intensive tasks — the gaps on SimpleQA-Verified and LongBench-V2 are real constraints for workloads requiring broad factual recall.
For teams evaluating self-hosting: the checkpoint requires at least 614 GB of accelerator memory, making it a multi-GPU infrastructure decision. Teams in regulated industries should note that the hosted API routes prompts to DeepSeek's servers in China, subject to China's National Intelligence Law — a fixed legal condition that does not change with model version or architectural improvements. Self-hosting the MIT-licensed weights on non-Chinese infrastructure eliminates the data-routing concern.
The CED design, CSA2 cache-sharing modes, and SWA Bounded Replay are techniques worth studying regardless of deployment context. As the field continues to treat agent memory economics as a first-class engineering problem, these patterns will likely appear in other models.
Top comments (0)