DeepSeek-V4.1-Flash: Pushing the Limits of KV Cache Compression
Reading guide · Based on sections of the original paper
Why read this
Practitioners serving input-heavy, long-context agents can use it to see how layer-, sequence- and precision-level KV compression combine in a model that remains competitive on agentic benchmarks.
What the authors found
- The authors report a global KV cache, always held in HBM, of 890 bytes per token. That is roughly 1/4 of DeepSeek-V4-Flash's footprint. They attribute the reduction to CSA2 cross-layer reuse plus FP4 caching. Elsewhere, they report that dropping SWA KV from persistent storage brings the persistent cache to about 1/8 of V4's. Opening
- At Max effort, the post-trained model scores 90.6 Pass@1 on Terminal-Bench 2.1, against 89.1 for Opus-5 and 82.7 for DS-V4-Flash. It scores 74.2 on DeepSWE v1.1, against 74.0 for Opus-5. On harder long-horizon tests it trails Opus-5: Terminal-Bench 3.0 is 30.0 vs 43.3, and 4.0 is 31.2 vs 51.8. Several reported scores come from internal or version-specific benchmarks. 5.3.2 Evaluation Results
- The authors call the base model on par with V4-Flash-Base and V4-Pro-Base. The table is mixed, though. On LongBench-V2 it scores 45.2, against 44.7 for V4-Flash and 51.5 for V4-Pro. That is notable for a model aimed at long contexts. 4.3.1 Evaluation Benchmarks
Main limitation
The 1/8 persistent-cache saving relies on SWA Bounded Replay. The authors acknowledge this replay reconstructs SWA state only approximately. They describe the quality impact as negligible, but the supplied text gives no quantified measurement of it. 3.2.2 SWA Bounded Replay
Where to start
2.3.1 Cross-Layer KV and Index Reuse · How the Full, Reindex and Reuse modes share main KV, indexer K and Top-K indices. These modes drive most of the KV savings. Pair this section with the layer schedule in S21.
Abstract
The widespread adoption of long-horizon agents has made model workloads increasingly input-heavy. Although prior work has substantially reduced the cost of long-context computation, prefill remains computationally expensive, and large KV caches continue to strain HBM and SSD capacity and data-transfer bandwidth. Together, these compute, storage, and bandwidth demands constitute the primary bottleneck to further lowering deployment costs. To address this challenge, we introduce DeepSeek-V4.1-Flash, a multimodal Mixture-of-Experts (MoE) model with 552B backbone parameters and support for contexts of up to one million tokens. With its Causal Encoder-Decoder (CED) architecture, the model activates 16B parameters per token during decode but only 8B parameters during prefill, substantially improving cost efficiency for agentic workloads. To push the limits of KV cache compression, DeepSeek-V4.1-Flash combines cross-layer KV cache reuse in Compressed Sparse Attention 2 (CSA2) with FP4 KV caching. These designs reduce its global KV cache footprint (always in HBM) to 890 bytes per token, roughly 1/4 of the corresponding footprint of DeepSeek-V4-Flash. Further, through a dedicated deployment optimization known as SWA Bounded Replay, DeepSeek-V4.1-Flash reduces its persistent KV cache footprint (always on SSD or in host memory) to roughly 1/8 of that of DeepSeek-V4-Flash. Despite its much smaller KV cache footprint, the model delivers substantially better performance than the baseline. In addition, we streamline the DeepSeek-V4 architecture and introduce several efficient architectural extensions. We pretrain DeepSeek-V4.1-Flash on a multimodal corpus comprising 45T tokens and conduct comprehensive post-training, yielding strong performance across diverse text-based and multimodal agentic scenarios. Model checkpoints are available at https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash.