Hugging Faceben burtenshawExplainer
DeepSeek-V4: a million-token context that agents can actually use
Summary
DeepSeek V4 is presented as an open model family aimed at long-running agentic workloads, with Pro and Flash MoE checkpoints offering 1M-token context windows. Its central architecture alternates Compressed Sparse Attention (CSA) and Heavily Compressed Attention (HCA), compressing KV entries by 4x and 128x respectively, while using FP8/BF16 storage and FP4 indexing. The post-training design preserves reasoning across user turns when tool calls are present, introduces a dedicated XML tool-call schema, and relies on DSec, a Rust sandbox platform for RL rollouts. At 1M tokens, Pro uses 27% of V3.2's single-token FLOPs and 10% of its KV cache, while Flash uses 10% and 7%; V4-Pro-Max reports 80.6% on SWE Verified and 0.59 MRCR 8-needle retrieval at 1M.
Context
Long-running agent workflows can fail when reasoning is discarded across user turns, context growth exceeds the budget, KV cache memory fills the GPU, or tool-call round trips degrade over many steps. The post positions efficient large-context inference and agent-specific training as responses to these failure modes.
Approach / What changed
DeepSeek V4 alternates CSA and HCA attention layers, compresses KV entries, and uses FP8, BF16, and FP4 storage choices to reduce inference and cache costs. It preserves reasoning across tool-call turns, adds an XML-based tool-call schema with dedicated tokens, and trains agent behavior in DSec, a Rust sandbox platform supporting function calls, containers, microVMs, and full VMs.
Takeaways
V4-Pro uses 27% of DeepSeek-V3.2's single-token inference FLOPs and 10% of its KV cache at 1M tokens; V4-Flash uses 10% of the FLOPs and 7% of the cache.
CSA compresses KV entries 4x and uses a FP4 lightning indexer for sparse block selection, while HCA compresses them 128x and applies dense attention over the compressed sequence.
V4 preserves reasoning across user-message boundaries when tool calls are present, while non-tool conversations continue to flush reasoning at each new turn.
Source and freshness
- Source
- huggingface.co
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.