---
id: 18332
lang: en
title: "Tencent Open-Sources DFly2: Up to 4.2× Faster Generation on Long Contexts"
published_at: "2026-11-26 16:25:46"
source_name: "TG: @ai_machinelearning_big_data (Machinelearning)"
source_url: "https://t.me/ai_machinelearning_big_data/11442"
canonical_url: "https://news.hamidun.com/en/news/18332"
categories: ["llm", "research"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# Tencent Open-Sources DFly2: Up to 4.2× Faster Generation on Long Contexts

> **Краткая суть (BLUF):** 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.  - On agent tasks, DFly2 is roughly 30% faster than DSpark - It accepts 10.4% more draft tokens than the open DSpark - The 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.

---
- **Первоисточник:** [TG: @ai_machinelearning_big_data (Machinelearning)](https://t.me/ai_machinelearning_big_data/11442)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18332
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
