DeepSeek-V4.1-Flash
DeepSeek-V4.1-Flash is a multimodal Mixture-of-Experts model with 552B backbone parameters, 1M-token context, and a novel Causal Encoder-Decoder (CED) architecture where the decoder's global KV cache is projected from encoder hidden states rather than recomputed per layer, activating only 8B/16B parameters per token during prefill/decode. It introduces Compressed Sparse Attention 2 (CSA2) with FP4 KV caching to cut the global KV cache footprint to 890 bytes/token (~1/4 of DeepSeek-V4-Flash, ~1/437 of DeepSeek-V1), alongside Engram conditional memory, DSpark speculative decoding, and a continuously controllable reasoning-effort setting (1–100). The card documents pre/post-training recipes (45T tokens, SFT→RL→on-policy distillation with synthetic agent environments) and reports results across agentic and code benchmarks (Terminal-Bench 2.1/3.0/4.0, DeepSWE v1.1, GPQA Diamond, Chartography, ZeroBench, AutomationBench), plus deployment instructions for Transformers, vLLM, SGLang, and Docker.
What it claims
DeepSeek-V4.1-Flash is an MIT-licensed, image+text-in / text-out MoE with 552B backbone parameters, a 1M-token context, and 8B (prefill) / 16B (decode) active parameters per token. The headline is KV cache size: 890 bytes per token of global KV cache, about 1/4 of DeepSeek-V4-Flash. The persistent KV footprint is about 1/8 of V4-Flash, because sliding-window attention (SWA) state no longer has to be persisted to SSD. The card frames the cost savings as targeting input-heavy agentic workloads.
How it works
- Causal Encoder-Decoder (CED). The model has 40 layers: a 20-layer causal encoder followed by a 20-layer decoder. The decoder's global KV is projected from the final encoder hidden states rather than computed per decoder layer. This is why prefill activates fewer parameters than decode.
- SWA Bounded Replay. Missing SWA KV is rebuilt by replaying only the last
n_wintokens instead of being stored. - CSA2. Each attention layer is statically assigned one of three modes:
- Full, Reindex, or Reuse, which share the main KV and indexer K across layers and reuse Top-K sparse indices.
- In the decoder, a Hierarchical Sparse Indexer limits later indexing layers to a candidate pool built by the first Full-mode layer. This makes deeper indexer cost independent of context length.
- FP4 main KV. Stored as E2M1 with one E4M3 scale per 16 channels.
- MoE. Each MoE layer has 1 shared expert and 384 routed experts, with 6 routed experts active per token.
- Engram conditional memory. 196B parameters, sparsely accessed by token-based lookup.
- Other components:
- Single-Pass mHC, a revised residual mixing with a Mega-mHC kernel.
- DSpark speculative decoding, which drafts semi-autoregressively and schedules verification by confidence.
- Vision. DeepSeek-ViT is trained from scratch with 2D-RoPE and 3×3 pixel-unshuffle, followed by a 2-layer MLP projector. Images are trained jointly with text from the start of pre-training.
- Pre-training. 45T multimodal tokens. Sparse attention was trained at 64K sequence length, and context was extended to 1M at 34T tokens.
- Post-training. Standard SFT → RL → on-policy distillation with no algorithmic changes. All the changes are in automated synthesis of agent tasks and environments.
Evidence
The card's comparison tables did not survive extraction. What remains:
- GPQA Diamond: 90.9. Instruct model at reasoning_effort=100, temperature=1.0, top_p=0.95. No baseline appears in the fetched text.
- ParseBench, via the DeepSeek API with thinking disabled (pipeline
parse_with_layout):
| Metric | Score |
|---|---|
| Mean | 56.57 |
| Text Content | 88.09 |
| Text Formatting | 66.05 |
These scores are marked with an asterisk.
- Agentic evaluation settings:
- Code-agent benchmarks (Terminal-Bench 2.1/3.0/4.0, DeepSWE v1.1, NL2Repo-Bench, ProgramBench) use the "Minimal mode" of DeepSeek Harness with a 1M context. Exceptions: DeepSWE v1.1 uses mini-SWE, and SEC-Bench Pro uses Claude Code.
- Visual-agent benchmarks use Claude Code with a 512k context.
- Scaffold comparisons use N=8 samples per task on DeepSWE v1.1 and N=3 on Terminal-Bench 2.1, with max_steps=500. Terminal-Bench 2.1 is run with no network access.
- Base-model reporting. Base-model scores within 0.3 of each other are treated as equivalent.
How to use it
No Jinja chat template ships with the release. Prompts must be built with one of two tools:
encoding/encoding.py, a Python reference with tests covering tool calls, thinking, numeric effort, mid-conversation system messages and interleaved images.- deepseek-recipe, Rust libraries with Python bindings. It converts Messages, Chat Completions and Responses API requests into prompts or token IDs and parses output, including streamed output. You still supply inference, tool execution and HTTP yourself.
Reasoning effort is an integer from 1 to 100. Weight conversion and local inference are documented in the inference folder. DeepSWE reproduction steps live in evaluation, including a patch for running dsh-minimal with Pier.
vllm serve "deepseek-ai/DeepSeek-V4.1-Flash"python3 -m sglang.launch_server \
--model-path "deepseek-ai/DeepSeek-V4.1-Flash" \
--host 0.0.0.0 \
--port 30000docker model run hf.co/deepseek-ai/DeepSeek-V4.1-FlashLimits
- Headline scores depend on settings. They use maximum reasoning effort and, mostly, DeepSeek's own harness. Expect lower scores at lower effort or under other scaffolds; the card reports a per-scaffold breakdown only for DeepSWE and Terminal-Bench 2.1.
- Recommended sampling parameters are missing from the fetched text.
- Chat formatting is unverified for the generic commands. Given the missing chat template, check that the vLLM and SGLang one-liners format chats correctly before relying on them.
- Hardware requirements are not given. No memory figures are stated for the 552B weights or the 196B Engram store.
Organisations named here
- DeepSeek-AI
- Agent's Last Exam
- AutomationBench
- BabyVision
- Chartography
- Claude Code
- DeepSeek
- DeepSeek-V4.1-Flash
- DeepSeek-V4-Flash
- DeepSWE
- GPQA
- Hugging Face
- NL2Repo-Bench
- SEC-Bench Pro
- Terminal-Bench
- terminal-bench-2.1
- ZeroBench
Technologies named here
- Transformers
- DeepSeek V4.1 Flash
- DeepSeek V4 Flash
- vLLM
- SGLang
- DeepSeek V1
- DeepSeek-ViT
- Docker Model Runner
- HuggingChat
- deepseek-recipe
- DeepSeek Harness
- mini-SWE harness
- Claude Code harness
- Pier
- Docker
- Vision language model
- Rust
- ProgramBench
- ParseBench
- Mixture of Experts
- Python
Techniques named here
- Causal Encoder-Decoder architecture
- SWA Bounded Replay
- Compressed Sparse Attention 2
- Hierarchical Sparse Indexer
- FP4 main KV caching
- Single-Pass mHC
- Engram conditional memory
- DSpark speculative decoding
- Continuously controllable reasoning effort
- SFT → RL → on-policy distillation post-training paradigm
- 2D-RoPE
- 3x3 pixel-unshuffle downsampling
Related in models


