Tencent Open-Sources DFly2: Up to 4.2× Faster Generation on Long Contexts
Tencent has open-sourced DFly2, a generation accelerator for the Hy4 Flash model aimed at long contexts and agents. A small model proposes several tokens ahead, and the main model verifies them in one pass and accepts the ones that fit. The result is up to 4.2× faster generation, and the draft model does not need its own KV memory. For long-context agents, this is a way to cut latency without adding GPU memory.
AI-processed from TG: @ai_machinelearning_big_data (Machinelearning); edited by Hamidun NewsWhen an agent reads a repository of hundreds of thousands of tokens or drags along a long history of actions, the main pain point is not answer quality but speed. A large model generates text one token per step, and every step is expensive. Tencent has released DFly2, a speculative decoding mechanism for its Hy4 Flash model, which the company says accelerates generation up to 4.2× specifically on long contexts and agentic workloads.
How Speculative Decoding Works, in Plain Terms
Picture a senior editor correcting a junior writer's text. If the editor writes every word themselves, progress is slow. If the junior drafts a whole phrase right away, and the editor scans it at a glance and strikes only the faulty tail, the work moves noticeably faster. It works the same way here: a small auxiliary model proposes several possible continuations in advance, and the main model checks them in a single pass and accepts all the suitable tokens at once.
The gain depends on two things: how cheap the draft is and how often the main model agrees with it. The more tokens accepted per pass, the fewer expensive steps the large model has to take.
What's New in DFly2
The usual problem with such schemes is that the draft model also needs context. On long inputs, its own KV memory (the cache where the model stores what it has "read") balloons and eats up the benefit. DFly2 is built differently: it uses the KV cache of the target, that is, the main, model together with a top-k token selection mechanism. No separate KV memory is needed for the draft model.
The second feature is that the cost of generating draft tokens stays nearly constant regardless of context length. For conventional accelerators, long context is exactly what breaks the economics, but here the draft does not get more expensive as the input grows from 8 to 128 thousand tokens.
Tencent also offers a comparison with DSpark, a related approach. On agent tasks with identical configurations, DFly2 shows roughly 30% higher speed. It also accepts 10.4% more of the proposed tokens than the open version of DSpark. This means its draft variants match what the main model would have produced more often, and less work is thrown away.
What Practitioners Should Do With This
If you are building agents on long contexts, such as coding assistants that read many files or assistants with long dialogue histories, this is precisely the scenario being optimized. Response latency drops, which makes each agent step cheaper and speeds up the think-act-verify loop. The lack of extra KV memory matters for teams constrained by GPU memory: you do not have to buy another graphics card to get the speedup.
The code is published in the AngelSlim repository on GitHub, the ready-made models are on Hugging Face under the same name, and the details are described in a technical paper on arXiv. This lets you verify the results yourself rather than take them on faith.
Limitations
The 4.2× figure is a maximum on the most favorable tasks, not an average gain across any workload. All comparisons so far come from Tencent itself; the announcement contains no independent measurements. DFly2 is built for Hy4 Flash, and porting it to other models will require separate draft training and validation. Finally, speculative decoding helps when the model runs in a low-latency mode; under very large batch loads, the gain is usually smaller.
Still, the direction is clear: acceleration for long agentic sessions is becoming a distinct class of tooling, and DFly2's open code gives teams a ready starting point for experiments. It is worth running it on your own agent traces and comparing the accepted-token rate and real latency before and after.
- Nov 26, 2026Hugging Face sped up Inkling 2 Mini on an RTX PRO 6000 by 40%, to 190 tok/s
- Nov 26, 2026Blogger Releases Ready-Made Colab Notebooks for ComfyUI: Weights Download 9x Faster
- Nov 26, 2026Ostris Releases Open VAE Decoder for MiniMax-H3-Image: Cleaner Small Text and Faces Without Over-Sharpening
- Nov 25, 2026Sber's OrbitLM Scores 14.2 Points Higher on School Math Problems Thanks to Looped Layers
Key Questions Answered
How Speculative Decoding Works, in Plain Terms?
Picture a senior editor correcting a junior writer's text. If the editor writes every word themselves, progress is slow. If the junior drafts a whole phrase right away, and the editor scans it at a glance and strikes only the faulty tail, the work moves noticeably faster. It works the same way here: a small auxiliary model proposes several possible continuations in advance, and the main model checks them in a single pass and accepts all the suitable tokens at once.
What's New in DFly2?
The usual problem with such schemes is that the draft model also needs context. On long inputs, its own KV memory (the cache where the model stores what it has "read") balloons and eats up the benefit. DFly2 is built differently: it uses the KV cache of the target, that is, the main, model together with a top-k token selection mechanism. No separate KV memory is needed for the draft model. The second feature is that the cost of generating draft tokens stays nearly constant regardless of context length.
What Practitioners Should Do With This?
If you are building agents on long contexts, such as coding assistants that read many files or assistants with long dialogue histories, this is precisely the scenario being optimized. Response latency drops, which makes each agent step cheaper and speeds up the think-act-verify loop. The lack of extra KV memory matters for teams constrained by GPU memory: you do not have to buy another graphics card to get the speedup.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
