DFly2 reuses the target's sparse index for drafting, lifting 64K serving throughput by 81%

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

Hong Liu, Rui Cen, Junhan Shi, Lin Niu, Runzhi Fan, Zhaojing Zhou, Haodi Lei, Jiebin Zhang, Saiyong Yang, Junqiang Zheng, Zhenghai Xue, Guanghua Yu, Jianchen Zhu

cs.CL

2026-11-26

DFly2 drafts by reusing the sparse target's KV cache and top-k selection, beating same-recipe baselines by 10-31.5% accepted length on long contexts and lifting 64K throughput by up to 81%.

What problem this solves

Speculative decoding matters most on long contexts, exactly where block-parallel drafters still run a paradigm built for dense targets: they keep a context KV cache of their own, either over the whole prompt (DFlash) or a sliding window (DSpark). That cache costs more than memory. On DS-V4.1-Flash, three draft layers add 3.4 KiB per token against the target's own 4.4 KiB, a 1.76× increase, and the more a target compresses its KV, the larger the drafter's share. It also forces the drafter onto prefill instances under disaggregation, breaks prefix-cache reuse (removing it lets DS-V4.1-Flash hold 1.73× as many requests at 32K), and reading every position still costs 14–23% of a decode step at 128K versus 4–6% for a fixed budget. Windows trade reach for those savings, and DFlash collapses to 1.08 tokens per step on Hy4-flash past the 32K it was trained at.

The observation that unlocks this: a natively sparse target (DSA-style) already scores every position with a trained indexer and attends to a fixed top-k per query. That query-aware selection was previously judged too expensive for drafting (MagicDec), but that verdict came on dense targets, where no ready-made selection exists. On a sparse target it is already computed and paid for.

Method

DFly2 hands both drafter decisions to the target:

The cross-block assumption is measured, not assumed: a top-512 selection made one step early still covers 0.87–0.88 of each later slot's own top-512 by index-score mass; a same-size window covers 0.15–0.18. The mechanism is that indexer queries carry their energy in low-frequency RoPE components, which barely move over a few positions, so the target's focus drifts rather than switches.

Two additions on top: the target's last-layer hidden state (held by no cache) is gated into the anchor slot, and an intra-block correction rereads the shared context and earlier slots, the only sequential part of a step, under 1% of decode time. Weights come from the paired layer too: attention initialized from it (its query latent also feeds the indexer, so draft queries start in the space that produced the top-k), and the FFN drawn from 128 of its routed experts. Training is single-stage KL+TV distillation with D-PACE slot weighting on DFly-SFT, 989,861 conversations and 7.42B tokens.

Results

Across three targets that differ in sparse-attention variant and architecture, DFly2 beats both same-recipe baselines in all 18 benchmark-temperature cells:

ComparisonWorkloadsAccepted-length gain
vs DSpark (stronger)general (GSM8K, LCB, ...)+3.9%–10.5%
vs DSparklong-context and agentic, 32K–128K+10.0%–31.5%

On agentic prompts, DFly2's average stays within 4% of its general average while DSpark drops 11–21%. On LSWE 128K with DS-V4.1-Flash it reaches 3.97 tokens per step (greedy) against DSpark's 3.29.

End to end, DFly2 averages 2.97× on the general family (3.14× decode-only), 2.13× on long-context and 2.11× on agentic with DS-V4.1-Flash, where both DFlash variants finish agentic sets slower than no speculation at all. At high concurrency (8P1D), matching DSpark's per-user decode speed, DFly2 delivers +28% throughput on short text, +62% on CodeSpan 64K and +81% on SWE 64K.

Ablations locate the gains: removing the target's top-k is the largest loss (3.57 to 3.14 on DS general), and repairing to layers 37–39 costs 4.6% because those layers reuse layer 36's selection, collapsing three views into one. On the YOCO-style target, unioning all five indexers' selections with history rows lifts recall from 0.80 to 0.91 at 2.6K positions, while a 2K read adds only 0.19% of a decode step.

Why it matters

For long-context serving, this rewrites the drafter's cost sheet: nothing at prefill, no prefix-cache interference, no concurrency footprint, and attention that does not grow with the context. Those are precisely the bottlenecks on 64K–128K agentic workloads. The design is also portable: three architectures with different sparse-attention variants run on the same recipe with nothing to tune in what the drafter reads. Against DFlash and DSpark this is a generational step under an identical training budget, and the gap widens as contexts grow.

Limitations

Terms

Source

What people are saying

Related papers

All paper explainers