I'm LongbridgeAI. Here is the key information I extracted- Utilizing KV Share and Index Share mechanisms to reuse main model resources and sparse attention architectures, DFly2 achieves up to a 4.2x speedup in long-context and AI Agent tasks without altering main model weights.…
Zhitong Finance APP learns that the Tencent Hunyuan team has officially open-sourced DFly2, a new-generation speculative sampling draft model. As a supporting acceleration component adapted for Hy4 Flash, it addresses the pain point of slow autoregressive generation in large models with million-token contexts, without altering the main model's weights or compromising output consistency. For long-context and AI Agent tasks, speed increases of up to 4.2x can be achieved.
The previously launched Hy4 Flash supports ultra-long contexts of up to one million tokens, allowing for the one-time loading of complete documents, codebases, and multi-turn Agent interaction trajectories. However, generation speed in long-context scenarios had become a bottleneck for practical application. DFly2 adopts a speculative sampling approach, where the draft model pre-generates candidate tokens, which are then verified and accepted by the main model, thereby compressing generation time. It is specifically designed for large models based on the 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 caches and sparse indices already computed by Hy4 Flash. The draft model focuses only on up to 2,048 key positions selected by the indices. This design ensures fixed attention computation costs, eliminates the need for separate KV GPU memory allocation, and adapts to the Prefill-Decode separated deployment architecture, reducing transmission and storage overhead for long contexts.
Empirical data shows that compared to solutions like DFlash and DSpark, the advantages of DFly2 amplify with context length. In the Agentic task benchmark AgentLongBench, the Hy4 Flash A12B version achieved up to a 4.2x speedup, with an average speedup of approximately 3.2x across four types of Agent tasks. The acceptance length improved by up to 68.5% compared to DSpark. In 128K long-context scenarios, the acceptance length increased by about 18% relative to DSpark, while maintaining approximately a 3.2x speedup. In real-world business tasks such as WorkBuddy, DFly2's acceptance length also outperformed the mainstream open-source DSpark solution.
At the training level, DFly2 relies on the AngelSpec framework, introducing a new hybrid online-offline training mode and launching DFly-OPD, a lightweight online distillation solution that eliminates the need for rollouts, thereby reducing computational consumption for training. It also optimizes communication and GPU memory strategies, supporting large-scale training with ultra-long contexts of up to 256K tokens. In terms of deployment, compared to the MTP solution, DFly2 delivers 26% higher end-to-end throughput under conditions of 32K input, 512 output, and a concurrency of 512.
The Hunyuan team stated that DFly2 represents 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 longer contexts yield more significant gains. Currently, DFly2 weights have been open-sourced alongside Hy4 and Hy4 Flash, and the training code has been integrated into AngelSpec, open for developer trial.
