Tencent DFly2 Reuses Target Sparse KV Cache for 81% Throughput at 64K

Published • news
Speculative DecodingOpen Weights

Speculative decoding has a dirty secret at long context: the drafter's own KV cache consumes memory that high-concurrency serving needs. Tencent's Hunyuan AI Infra team has open-sourced DFly2, a 0.85B-parameter, 5-layer drafter that removes that cache by reusing the target model's sparse attention state. The drafter ships in tencent/Hy4-flash, and the work is described in the paper "DFly2: Turbocharging Long-Context Speculative Decoding by Sharing the Target's Sparsity." MarkTechPost, citing Tencent's paper, reports up to 81% more throughput over the same-recipe DSpark baseline on DeepSeek-V4.1-Flash at 64K, at matched per-user decode speed; at matched throughput, users decode 15% to 24% faster.

How DFly2 reuses the target's cache

Conventional drafters attend over the full prefix and store their own KV cache; a 3-layer drafter adds 3.0 to 3.4 KiB per token in bf16, per Table 2 of the paper. DFly2 keeps none of it. Each of its five draft layers pairs with one sparse attention layer in the target and shares two things: that layer's latent KV cache and its top-k indexer selections. The draft layer attends only to positions the target's indexer picked.

Sparse selections are temporally stable. On DeepSeek-V4.1-Flash, a top-k selection made one step early covers close to 90% of the positions later block tokens select; a same-size sliding window recovers less than 20%. According to the AngelSpec GitHub page, each draft token attends to at most about 2,000 keys, so drafting cost stays roughly flat at any context length. DFly2 also skips prefill entirely; the prefill-to-decode handoff transfers a single last-layer hidden state.

The drafter is not an arbitrary small model. Each draft layer initializes from its paired target layer's weights, the target's last-layer hidden state is gated into the draft block, and intra-block correction rereads the shared context slot by slot within a block. Block-parallel drafting fills several slots at once, and the target verifies the whole block in one pass.

The memory win

TargetTarget KV per tokenDrafter cache per tokenTotal increase
DeepSeek-V4.1-Flash4.4 KiB3.4 KiB1.76x
GLM-5.3-Flash11.7 KiB3.0 KiB1.26x
Hy4 flash17.2 KiB3.4 KiB1.20x

The drafter overhead is proportionally worst on the smallest target KV: it nearly doubles total memory per token on DeepSeek-V4.1-Flash. Removing it lets the same memory pool hold 1.73x as many requests at 32K context, according to the paper reported by MarkTechPost. In long-context agentic serving, that can determine whether another GPU node is required.

Acceptance and serving numbers

MarkTechPost's benchmark breakdown shows DFly2 beating both DFlash and DSpark on average accepted length (τ) across all three targets and general benchmarks. On DeepSeek-V4.1-Flash at temperature 0, τ reaches 4.12, against 3.81 for DSpark and 3.65 for DFlash. The margin over DSpark runs 3.9% to 10.5% on general workloads and 10.0% to 31.5% on long-context and agentic workloads up to 128K. DFly2's agentic average stays within 4% of its general average, while DSpark's falls 11% to 21%.

End-to-end greedy speedup at concurrency 1 is 2.97x on DeepSeek-V4.1-Flash, 2.36x on GLM-5.3-Flash, and 3.19x on Hy4 flash in Tencent's reported tests. On DeepSeek-V4.1-Flash served on NVIDIA H20 GPUs with vLLM and TP8 per instance, Tencent reports +28% throughput on short text, +62% on CodeSpan 64K, and +81% on SWE 64K over DSpark at matched per-user decode speed.

Deployment

DFly2 ships inside tencent/Hy4-flash, a 220B-total, roughly 12B-active MoE with 1M context. vLLM serves it via vllm/vllm-openai:hy4-flash with the dfly speculative method on by default; SGLang uses the DFLY algorithm through lmsysorg/sglang:hy4-flash. To train a drafter for another sparse model, AngelSpec's quick start expects one node with 8 GPUs: 4 for inference and 4 for training.

AI Mastery analysis

The architectural insight matters more than any single benchmark. DFly2's gain is not a faster drafter; it is removal of a structural inefficiency—the redundant draft KV cache—from the serving path. That fits the 2026 pattern documented in infrastructure rewrites, not model-weight scaling, are driving serving gains. The same coupling also limits DFly2 to natively sparse models: each draft layer must pair with a target sparse attention layer, so the design does not transfer to dense transformers. For first-party deployments, paired-layer initialization and hidden injection are acceptable costs. The smallest reported gain—3.9% on Hy4 flash general workloads—is a warning to teams adopting sparse attention: the upside concentrates where the draft cache would otherwise dominate memory, in long-context and agentic traffic.

Sources

Frequently asked questions

How does DFly2 avoid needing its own KV cache?

DFly2 pairs each of its five draft layers with one sparse attention layer in the target and reuses that layer's latent KV cache and top-k index picks. It keeps no separate draft cache, and the prefill-to-decode handoff transfers only one last-layer hidden state.

What throughput gain does DFly2 report on DeepSeek-V4.1-Flash?

At matched per-user decode speed on NVIDIA H20 GPUs with vLLM and TP8 per instance, Tencent reports +28% throughput on short text, +62% on CodeSpan 64K, and +81% on SWE 64K over DSpark.

How much memory does a separate draft cache add?

Per Table 2 of the paper, a conventional 3-layer drafter adds 3.0 to 3.4 KiB per token in bf16 across DeepSeek-V4.1-Flash, GLM-5.3-Flash, and Hy4 flash. Removing it lets the same memory pool hold 1.73x as many requests at 32K context.

Does DFly2 work with dense transformers?

No. The design pairs each draft layer with a target sparse attention layer and reuses its KV cache and index selects, so it applies to natively sparse models rather than dense transformers.

Related Reading