PapersSelected

DFly2:通过共享目标模型稀疏性加速长上下文投机解码

DFly2: Turbocharging Long-Context Speculative Decoding by Sharing the Target's Sparsity

Why we picked it

做长上下文推理服务的话这篇值得花十分钟。它让 drafter 直接用目标模型已算好的 KV 和位置选择,零额外缓存。在 DS-V4.1-Flash 上比 DFlash、DSpark 多接 10%-31% 的 token,64K 高并发吞吐高 62%-81%。

论文提出 DFly2,一种面向原生稀疏注意力模型(如 DeepSeek-V4、Hy4)的块并行投机解码 drafter。它的核心思路是:drafter 不再维护自己的 KV 缓存,也不做自己的位置选择,而是直接复用目标模型每层已缓存的 KV 和其 indexer 选出的位置(KV sharing + Index sharing),因此完全省掉了打分阶段。作者在 DS-V4.1-Flash 上测量发现,提前一步做出的位置选择仍能覆盖后续每个 token 实际选择的近九成位置,说明这种共享是可行的。

Body

在 DS-V4.1-Flash、GLM-5.3-Flash 和 Hy4-flash 三种稀疏架构不同的模型上,DFly2 每步接受的 token 数超过同等训练配方下的 DFlash 和 DSpark:在通用基准上领先 3.9%-10.5%,在长上下文和 agentic 基准上领先幅度扩大到 10.0%-31.5%。在 DS-V4.1-Flash 的高并发场景下,匹配每用户解码速度后,DFly2 在两个 64K 数据集上的吞吐分别高出 62% 和 81%。

对部署原生稀疏长上下文模型的服务方来说,这项工作把投机解码的额外成本(drafter 缓存、prefill、并发能力损失)基本归零,解码越慢、上下文越长的场景收益越大。

Original · arXiv: DeepSeek

DFly2: Turbocharging Long-Context Speculative Decoding by Sharing the Target's Sparsity

To avoid the quadratic cost of dense attention over long contexts, models such as DeepSeek-V4 and Hy4 have turned natively sparse, and speculative decoding, which matters most where decoding is slowest, increasingly runs on them. Their drafters, however, still keep a context cache of their own, over the whole prompt or a sliding window. Beyond memory, such a cache costs prefill time, prefix-cache hits and decode concurrency. Drafters that read the target's cache avoid one of their own, but settle only which cache, not which positions, and still read everything or a recent window. Neither rule is made for the query at hand, and computing a selection per query in the drafter would cost more as the context grows. Yet a natively sparse target already picks positions for each query, over a cache it keeps anyway. Both of the drafter's choices are therefore already made, and paid for, by the target: its cache and its selection. We measure how far one selection carries: made a step early, it still covers close to nine tenths of what each later token selects on DS-V4.1-Flash. We present DFly2, a block-parallel drafter that shares the target's sparsity. Each draft layer reads the KV its paired target layer cached (KV sharing), at the positions that layer's indexer selected, a fixed number anywhere in the context (Index sharing). DFly2 thus runs no scoring pass and keeps no cache of its own. On DS-V4.1-Flash, GLM-5.3-Flash and Hy4~flash, whose sparse attention and architecture differ, it accepts more tokens per step than DFlash and DSpark trained on the same recipe, over general, long-context and agentic benchmarks. Its margin over the stronger baseline widens from 3.9%-10.5% on general workloads to 10.0%-31.5% on long-context and agentic ones. At high concurrency on DS-V4.1-Flash, at matched per-user decode speed, its throughput is 62% and 81% higher on two 64K sets.

Industry Coordinates & Source Verification

This report is categorized under AITOP's "Papers" desk, focusing on China's AI industry and domestic foundation model ecosystem. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include DFly2, DeepSeek-V4, speculative decoding, sparse attention.

Primary source verification: published directly by arXiv: DeepSeek with first-party authority.