Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →

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 News
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceTG: @ai_machinelearning_big_data (Machinelearning) ↗
Editor-in-Chief
Key metric #1On agent tasks, DFly2 is roughly 30% faster than DSpark
Key metric #2It accepts 10.4% more draft tokens than the open DSpark
Key metric #3The cost of drafting barely grows with context length

When 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.

Story

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.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

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.

Try Nomad AI →Launch Nomad Agent
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — Tencent Open-Sources DFly2: Up to 4.2× Faster Generation on Long Contexts https://news.hamidun.com/en/news/18332/tencent-open-sources-dfly2-up-to-4-2-faster-generation-on-lo

What do you think?
Loading comments…