Tencent has open-sourced DFly2, an inference accelerator for language models with sparse attention, on Thursday (November 26). Developed by the Hunyuan AI Infra team, the project was released in full: weights, training code in the AngelSpec framework, and the technical report published on arXiv on Wednesday (November 25).
DFly2 is a speculative decoding drafter — the technique in which a small model proposes several tokens at once and the target model verifies them in a single pass, without changing the output. The problem is that, on long contexts, the drafter usually keeps its own KV cache, which competes with the target model for memory and delays the first token. DFly2 removes that cost: it keeps no KV cache of its own.
KV sharing and Index sharing
The idea is to reuse what the target model has already computed. Each draft layer is paired with one sparse attention layer of the target and shares two things: that layer's KV cache (KV sharing) and the positions the target's indexer already selected (Index sharing). Because the selection is made by the target itself, the drafter needs no extra scoring pass and no prefill: each draft token attends to at most about 2,000 keys, whatever the context length. According to the paper, a selection made one step early still covers about 90% of what later tokens would select on DeepSeek-V4.1-Flash.
The drafter has 0.85 billion parameters across 5 layers and ships with Hy4 flash, Tencent's own model with about 220 billion total parameters (12 billion active) and a 1-million-token context. It was also trained for DeepSeek-V4.1-Flash and GLM-5.3-Flash, and all three draft models are on Hugging Face.
Benchmarks: up to 81% more throughput, according to Tencent
All figures below were published by Tencent itself and have no independent verification yet. In the company's tests, on NVIDIA H20 GPUs with vLLM, DFly2 reached end-to-end speedups of 2.97x on DeepSeek-V4.1-Flash, 2.36x on GLM-5.3-Flash and 3.19x on Hy4 flash. In serving throughput, at matched per-user speed, the gain over DSpark was 28% on short text, 62% on CodeSpan 64K and 81% on SWE 64K. On agentic tasks with Hy4 flash, Tencent claims up to 4.2x faster decoding. Without the drafter's cache, the same memory pool holds 1.73x more requests at 32K tokens.
Mean accepted length per step (τ) also beat the baselines trained on the same recipe: 4.12 versus 3.81 for DSpark and 3.65 for DFlash on DeepSeek-V4.1-Flash at temperature zero — and the lead grows on long-context and agentic workloads, from 10.0% to 31.5%.
How to use it
DFly2 already ships inside the Hy4 flash repository on Hugging Face and works with the vLLM framework (the dfly method, enabled by default in the Hy4 flash recipe) and SGLang (the DFLY algorithm). Anyone wanting to train a drafter for their own sparse model can use AngelSpec — the quick start calls for one node with 8 GPUs. The code uses the AngelSpec License; Hy4 flash remains under the Tencent Hy License.
DFly2 arrives one week after Tencent released the Hy4 flash weights, covered by Geekiki on November 21 — now, alongside the model, the community also gets the accelerator that ships with it and the code to train it on other sparse targets.
Image: diagram of the DFly2 architecture. Credit: Tencent Hunyuan AI Infra / AngelSpec (GitHub).
Sources
- arXiv — DFly2: Turbocharging Long-Context Speculative Decoding by Sharing the Target's Sparsity (relatório técnico)
- GitHub — Tencent/AngelSpec (código de treinamento do DFly2)
- MarkTechPost — Tencent Open-Sources DFly2: Speculative Decoding That Reuses the Target's Sparse KV Cache
- Hugging Face — tencent/Hy4-flash
Transparency note: this article was produced with the assistance of artificial intelligence, cross-checked against public posts on X and internet sources, and reviewed before publication. Please consult the original sources to confirm the information.
By Muse