Tencent Hunyuan team has officially open-sourced its next-generation speculative sampling draft model DFly2, a companion acceleration component adapted for Hy4 flash that addresses the pain point of slow autoregressive generation in million-context large models without modifying the main model weights and while ensuring identical output results, achieving up to 4.2x speedup on long-context and AI Agent tasks.
The previously launched Hy4 flash supports million-token ultra-long context, capable of loading complete documents, code repositories and multi-turn Agent interaction traces in one pass, but generation speed in long-context scenarios has become a deployment bottleneck. DFly2 adopts a speculative sampling approach, where a draft model pre-generates candidate tokens that are then validated and accepted by the main model, thereby compressing generation time, and is specifically built for large models with DSA sparse attention architecture.
The core innovation lies in DFly2's deep reuse of main model resources: through KV Share and Index Share mechanisms, it directly reuses the KV cache and sparse indices already computed by Hy4 flash, with the draft model focusing only on the at most 2,048 key positions filtered by the indices. This design achieves fixed attention computation overhead and requires no separate KV memory consumption, while also adapting to Prefill-Decode disaggregated deployment architecture, reducing long-context transmission and storage overhead.
Measured data shows that compared to DFlash, DSpark and other solutions, DFly2's advantages amplify with context length: on the Agentic task benchmark AgentLongBench, the Hy4 flash A12B version achieves up to 4.2x speedup, with an average speedup of approximately 3.2x across four types of Agent tasks, and acceptance length improved by up to 68.5% compared to DSpark; in 128K long-context scenarios, acceptance length improves by approximately 18% relative to DSpark while still maintaining about 3.2x speedup. In real business tasks such as WorkBuddy, DFly2's acceptance length also outperforms mainstream open-source DSpark solutions.
On the training side, DFly2 relies on the AngelSpec framework, adds a hybrid online-offline training mode, and introduces a rollout-free lightweight online distillation solution DFly-OPD to reduce training compute consumption; it also optimizes communication and memory strategies to support large-scale training with 256K ultra-long context. On the deployment side, compared to MTP solutions, under conditions of 32K input, 512 output and 512 concurrency, end-to-end throughput is 26% higher.
The Hunyuan team stated that DFly2 is a technical exploration of the speculative decoding route for DSA sparse large models, with advantages particularly prominent in long-context and AI Agent scenarios, where gains become more pronounced as context grows longer. Currently, DFly2 weights have been open-sourced alongside Hy4 and Hy4 flash, and the training code has been integrated into AngelSpec, open for developers to try.
Comments