AI News AI资讯 13h ago Updated 1h ago 更新于 1小时前 52

DeepSeek AI Released DeepSeek-V4.1-Flash with 1M Context, FP4 KV Cache, and Cross-Layer Attention Reuse DeepSeek AI发布DeepSeek-V4.1-Flash:支持100万上下文、FP4 KV缓存与跨层注意力复用

DeepSeek-V4.1-Flash achieves a global KV cache footprint of 890 bytes per token — roughly 1/4 of V4-Flash and 437x smaller than V1 — enabling 1M-token context windows without HBM/SSD bottlenecks The Causal Encoder-Decoder (CED) architecture splits the 40-layer backbone into 20 encoder + 20 decoder layers, halving prefill compute by having the decoder derive its global KV from the encoder's final hidden state rather than computing it independently Compressed Sparse Attention 2 (CSA2) introduces t DeepSeek-V4.1-Flash是552B骨干+196B Engram参数的多模态MoE模型,支持1M token上下文窗口,prefill激活8B参数、decode激活16B参数 全局KV cache降至890 bytes/token,约为V4-Flash的1/4、V1的1/437,持久化缓存约为V4-Flash的1/8 核心技术创新包括Causal Encoder-Decoder架构(预填充计算减半)、CSA2稀疏注意力(Full/Reindex/Reuse三层模式)、FP4 KV量化(E2M1+每16通道E4M3 scale)及SWA Bounded Replay 基于45T多模态

75
Hot 热度
72
Quality 质量
78
Impact 影响力

Analysis 深度分析

TL;DR

  • DeepSeek-V4.1-Flash achieves a global KV cache footprint of 890 bytes per token — roughly 1/4 of V4-Flash and 437x smaller than V1 — enabling 1M-token context windows without HBM/SSD bottlenecks
  • The Causal Encoder-Decoder (CED) architecture splits the 40-layer backbone into 20 encoder + 20 decoder layers, halving prefill compute by having the decoder derive its global KV from the encoder's final hidden state rather than computing it independently
  • Compressed Sparse Attention 2 (CSA2) introduces three layer modes (Full, Reindex, Reuse) that share main KV, indexer K, and Top-K indices across layers, with a Hierarchical Sparse Indexer capping candidate pools at 16,384 positions
  • FP4 (E2M1) KV cache quantization with per-16-channel E4M3 scales, combined with SWA Bounded Replay and DRAM-resident sliding-window storage, reduces persistent cache to approximately 1/8 of V4-Flash
  • The model matches DeepSeek-V4-Pro-Base on world knowledge and coding while using only 1/3 total and 1/4 activated parameters, and beats Opus-5 and GPT-5.6 Sol on Terminal-Bench 2.1 and DeepSWE v1.1 with open MIT-licensed weights

Why It Matters

Long-horizon agentic workflows are turning LLM serving into an input-heavy, KV-cache-bound workload, and DeepSeek-V4.1-Flash directly targets this emerging bottleneck with architectural and systems-level innovations that make million-token contexts practically deployable. For AI practitioners, the combination of open weights, aggressive compression, and competitive benchmark performance against closed models like Opus-5 and GPT-5.6 Sol demonstrates that high-quality, cost-effective agent infrastructure is becoming accessible without proprietary API dependency.

Technical Details

  • Architecture: Multimodal Mixture-of-Experts with a 552B backbone + 196B Engram parameters, 1M-token context window, 8B activated params per token during prefill (20 encoder layers) and 16B during decode (20 decoder layers). The Causal Encoder-Decoder derives decoder global KV via per-layer projection from the encoder's final hidden state, eliminating redundant KV computation.
  • CSA2 (Compressed Sparse Attention 2): Each of the 40 layers is statically assigned one of three modes — Full (computes own KV + indexer K, selects Top-512 indices), Reindex (reuses KV/indexer K, rescores with own indexer Q), or Reuse (skips indexer entirely, reuses latest Top-K). Encoder uses a 2:1 compression ratio (1 Full + 5 Reuse per 6-layer group); decoder uses 1:1 (Full + 3 Reuse or Reindex + 3 Reuse per 4-layer group). A Hierarchical Sparse Indexer bounds candidate pools to 16,384 positions (2,048 blocks × 8).
  • FP4 KV Cache + SWA Bounded Replay: Main KV quantized to E2M1 with one E4M3 scale per 16 channels (NVFP4-style without global scale), introduced via quantization-aware post-training. SWA KV (128-token window) is no longer persisted to SSD but lives in a distributed DRAM pool (10% host DRAM, minute-scale TTL), while global KV maintains a 72-hour lifetime. On cache miss, only 128 tokens are recomputed instead of layers × window.
  • Additional optimizations: Single-Pass mHC shifts input-mixing coefficients to halve activation memory traffic via a fused Mega-mHC kernel; Engram conditional memory modules at layers 1 and 14; DSpark speculative decoding (backbone frozen, trained post-pretraining); head-wise Muon optimizer. Single-token decode FLOPs increase by only 25% when scaling from 4K to 1M context.
  • Training: 45T multimodal tokens (7:1 text-to-multimodal ratio), sparse attention trained from scratch at 64K with no dense warmup, context extended to 1M at 34T tokens. Post-training uses large-scale verifiable agent task synthesis, RL across heterogeneous scaffolds (Claude Code, Codex, OpenCode, Pi, mini-SWE, DeepSeek Harness), and on-policy distillation from 40+ teachers.

Industry Insight

  • The 437x KV cache reduction per token signals a fundamental shift: million-token contexts are moving from research demos to production realities, and serving infrastructure (vLLM, SGLang) will need to prioritize sparse attention and DRAM-tiered caching over raw HBM capacity.
  • Open-weight models matching or exceeding closed competitors on agent benchmarks (Terminal-Bench, DeepSWE) under MIT licensing compress the advantage of proprietary APIs, accelerating the commoditization of high-capability agent backends and pushing providers to compete on infrastructure and tooling rather than model exclusivity.
  • The layered Full/Reindex/Reuse compression strategy demonstrates that static, per-layer attention mode assignment is a viable design space — future work may explore dynamic mode selection or learned compression ratios, but the current approach proves that aggressive KV sharing across layers can preserve quality while slashing memory by orders of magnitude.

TL;DR

  • DeepSeek-V4.1-Flash是552B骨干+196B Engram参数的多模态MoE模型,支持1M token上下文窗口,prefill激活8B参数、decode激活16B参数
  • 全局KV cache降至890 bytes/token,约为V4-Flash的1/4、V1的1/437,持久化缓存约为V4-Flash的1/8
  • 核心技术创新包括Causal Encoder-Decoder架构(预填充计算减半)、CSA2稀疏注意力(Full/Reindex/Reuse三层模式)、FP4 KV量化(E2M1+每16通道E4M3 scale)及SWA Bounded Replay
  • 基于45T多模态token训练(7:1文本/多模态比),后训练采用大规模可验证Agent任务RL、跨异构脚手架(Claude Code/Codex/OpenCode等)及40+教师蒸馏
  • 在Terminal-Bench 2.1(90.6)和DeepSWE v1.1(74.2)上超越Opus-5和GPT-5.6 Sol,MIT开源许可,支持vLLM/SGLang/Transformers部署

为什么值得看

DeepSeek-V4.1-Flash直击长周期Agent场景的核心瓶颈——百万token上下文带来的KV cache内存压力,通过架构级创新将缓存 footprint 压缩至历史水平的1/437,为工业级部署提供了可行路径。其开源MIT许可与领先的Agent基准表现,使开发者无需依赖闭源API即可构建高成本效益的长上下文应用。

技术解析

  • Causal Encoder-Decoder(CED)架构:40层骨干分为20层因果编码器+20层解码器,受YOCO启发,解码器不独立计算全局KV,而是通过逐层投影权重从编码器最终隐藏状态派生。提示token仅在编码器处理,预填充计算近乎减半;滑动窗口注意力(SWA,128 token窗口)通过Decoder SWA Bounded Replay仅重放最后128个提示token重建。
  • CSA2(Compressed Sparse Attention 2):纯稀疏注意力方案,每层静态分配三种模式之一:Full(计算主KV并选择Top-512索引)、Reindex(复用主KV和索引器K,用自身索引器Q重评分)、Reuse(完全复用主KV和最新Top-K索引)。编码器18层采用2:1压缩比(6层一组:1 Full+5 Reuse),解码器20层采用1:1压缩比(4层一组:首组1 Full+3 Reuse,其余1 Reindex+3 Reuse)。分层稀疏索引器构建最多16,384位置候选池。
  • FP4 KV量化与缓存分层:主KV缓存量化为E2M1(无全局scale,每16通道一个E4M3 scale),较V4的FP8缓存存储近乎减半。部署层面,SWA KV不再持久化至SSD,而是存储在占主机DRAM 10%的分布式池中(TTL分钟级),全局KV保证72小时生命周期;缓存未命中时仅重算128 token而非layers×window。
  • 训练与后训练:预训练覆盖45T多模态token,稀疏注意力从64K序列长度从头训练(无密集预热),上下文在34T token时扩展至1M。后训练无新算法,依赖大规模可验证Agent任务合成、跨异构脚手架RL(Claude Code/Codex/OpenCode/Pi/mini-SWE/DeepSeek Harness)及40+教师on-policy蒸馏。其他优化包括Single-Pass mHC(激活内存流量减半)、Engram条件记忆模块(第1/14层)、DSpark投机解码(预训练后冻结骨干训练)及head-wise Muon。

行业启示

  • 长上下文Agent的内存优化将成为下一阶段竞争焦点:DeepSeek通过架构创新(CED+CSA2+FP4)而非单纯堆参数解决HBM/SSD瓶颈,证明"效率优先"路线在百万token场景的可行性,后续模型需同步优化推理成本与上下文长度。
  • 开源生态将加速Agent基础设施成熟:MIT许可配合vLLM/SGLang/Transformers多路径部署,使开发者可本地化运行高性能长上下文模型,降低对闭源API的依赖,推动Agent工具链(如SWE-bench类基准)的民主化。
  • 后训练策略正从"算法创新"转向"数据与规模驱动":V4.1-Flash后训练未引入新算法,而是依靠大规模合成任务、多脚手架RL和40+教师蒸馏实现性能跃升,预示未来模型竞争将更依赖高质量训练数据工程和计算规模,而非架构突破。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Open Source 开源 LLM 大模型 Multimodal 多模态 Inference 推理 Quantization 量化