Long-horizon AI agents have turned large language model serving into a storage nightmare. Repeated prefills and million-token contexts strain HBM, SSD capacity, and bandwidth. DeepSeek AI built its newest release, DeepSeek-V4.1-Flash, to solve this exact bottleneck. The multimodal Mixture-of-Experts model features a 552B backbone and a 1M-token context window. Yet it activates only 8B parameters per token during prefill. The headline metric is a global KV cache footprint of just 890 bytes per token. That is roughly one-quarter of DeepSeek-V4-Flash and 437 times smaller than DeepSeek-V1.
The architecture splits the 40-layer backbone into a causal encoder and decoder. Inspired by YOCO, the decoder does not compute its own global KV cache. Instead, it derives projections from the final encoder hidden state. Prompt tokens stop at the encoder, which nearly halves prefill compute. Sliding-window attention still runs in every layer. But decoder states are rebuilt by replaying only the last 128 prompt tokens. This technique, called Decoder SWA Bounded Replay, avoids costly full recomputation. Compressed Sparse Attention 2 (CSA2) further attacks cache size along the layer axis. Layers switch between Full, Reindex, and Reuse modes to share indices and skip unnecessary indexing.
Storage efficiency gets another boost from FP4 quantization. The main KV cache uses E2M1 format with one E4M3 scale per 16 channels. This approach nearly halves storage compared to V4’s FP8 cache. At deployment, sliding-window KV no longer persists to SSD. It lives in a distributed pool carved from 10% of host DRAM with a minutes-long TTL. Global KV keeps a guaranteed 72-hour lifetime. On a miss, the system recomputes only 128 tokens. Single-token decode FLOPs rise by just one-quarter when context grows from 4K to 1M tokens.
Training covered 45T multimodal tokens with sparse attention trained from scratch. Post-training gains came from RL across heterogeneous scaffolds like Claude Code and Codex. The base model matches DeepSeek-V4-Pro-Base on world knowledge while using fewer activated parameters. Selected results show it beating Opus-5 and GPT-5.6 Sol on Terminal-Bench 2.1. Open weights ship under an MIT license with vLLM and SGLang support. This level of efficiency could finally make million-token contexts economically viable for production agent workflows.