Tencent Open-Sources DFly2: Speculative Decoding That Reuses the Target’s Sparse KV Cache
In one sentence
Tencent open-sourced DFly2, a speculative decoding drafter for natively sparse LLMs that reuses the target's sparse KV cache and indexer.
Key points
- DFly2 is a block-parallel speculative decoding drafter from Tencent’s Hunyuan AI Infra team built for natively sparse LLMs.
- It keeps no separate draft KV cache and instead shares the target layer's sparse KV cache and indexer selections to save memory in long-context serving.
- DFly2 achieves higher draft acceptance than same-recipe DFlash and DSpark across DeepSeek-V4.1-Flash, GLM-5.3-Flash, and Hy4 flash.
- On 64K SWE workloads, it delivers up to 81% higher throughput on DeepSeek-V4.1-Flash at matched per-user speed.
- DFly2 ships with Hy4 flash for vLLM and SGLang deployment, and can be trained for custom sparse models via AngelSpec.
In depth
An AI-written overview of the original article, not the article itself.
Tencent has open-sourced DFly2, a speculative decoding drafter built for natively sparse LLMs such as DeepSeek-V4.1-Flash, GLM-5.3-Flash, and Hy4 flash. By eliminating its own KV cache, DFly2 addresses memory bottlenecks in long-context and agentic serving.
Core Mechanism and Memory Benefits
Developed by Tencent's Hunyuan AI Infra team, DFly2 pairs each draft layer with a target sparse attention layer. It shares the target's latent KV cache and top-k indexer selections, while injecting the target's last-layer hidden state and rereading shared context within each block.
According to the article, DFly2 skips prefill entirely and attends to at most 2K keys per draft token, keeping drafting costs roughly flat across context lengths. Removing the separate draft cache lets a 32K memory pool hold 1.73x as many requests.
Benchmarks and Throughput Gains
In Tencent's self-reported tests against retrained DFlash and DSpark baselines, DFly2 achieved higher token acceptance across all three target models. On long-context and agentic tasks up to 128K, it outperformed the stronger baseline by 10.0% to 31.5%, though its smallest gain was 3.9% on Hy4 flash general tasks.
For serving throughput on DeepSeek-V4.1-Flash at matched per-user speed, DFly2 delivered 81% more throughput on SWE 64K and 62% more on CodeSpan 64K compared to DSpark. End-to-end greedy speedup reached 2.97x on DeepSeek-V4.1-Flash and 3.19x on Hy4 flash.
Deployment and Training Support
DFly2 ships as a 0.85B-parameter, 5-layer drafter inside Hy4 flash, a 220B MoE model with 1M context. It is supported by vLLM and SGLang, and developers can train custom drafters for their own sparse models using Tencent's AngelSpec repository.
This summary was generated by AI from the original article and may contain errors; the original is authoritative. Copyright belongs to the original author.