# Tencent DFlly2 Explained: Why It Makes LLM Inference Up to 4.2x Faster

> Source: <https://www.mindstudio.ai/blog/tencent-dfly2-speculative-decoding/>
> Published: 2026-11-27 00:00:00+00:00

**Recommendation:** When serving natively sparse models, have the drafter reuse the target model's attention selections rather than maintaining separate context memory, and benchmark end-to-end including prompt processing since gains narrow from 3.41x to 1.67x.
More in the playbook "Inference and self-hosting": <https://wpnews.pro/playbooks/inference-serving>

# Tencent DFlly2 Explained: Why It Makes LLM Inference Up to 4.2x Faster

Tencent's DFlly2 speeds up LLM inference by reusing the big model's own sparse attention notes. Here's how it compares to DSpark and MTP.

## What is DFlly2 and why does it matter?

DFlly2 is a speculative decoding method from Tencent that speeds up large language model inference by letting a small “drafter” model reuse the attention notes the big model has already computed, instead of building its own memory of the conversation. Tencent reports throughput gains of up to 4.2x on certain workloads, with the biggest wins showing up on long code generation and multi-step coding agent tasks. The core idea: stop making small models re-derive context the big model already figured out.

## TL;DR

- **Speculative decoding** works by having a small drafter model guess several tokens ahead, then letting the big model verify them all in a single pass instead of generating one token at a time.
- **DFlly2’s distinguishing trick** is that it skips building a separate context memory and instead reads the big model’s own sparse attention selections, the positions the big model already decided were important.
- **The method only works with natively sparse models** , meaning architectures whose attention layers already select specific earlier positions rather than scanning the entire context.
- **Reported gains vary by what you measure** : on HY4 Flash, DFlly2 hit 3.41x faster token generation versus 2.63x for DSpark, but when you include prompt processing time the gap narrows to 1.67x versus 1.55x.
- **Under heavy server load with DeepSeek V4.1 Flash** , DFlly2 delivered 28% more total output than DSpark on short text, 62% more on long code, and 81% more on a coding agent benchmark.
- **The paper doesn’t benchmark against MTP, Eagle 3, or DFlash2** directly, only against DFlash and DSpark versions Tencent trained itself using a matched training recipe, so cross-method comparisons require caution.
- **Tencent has been quietly productive** , pairing this inference research with other recent work like Sherry quantization, while slowing down on brand-new base model releases in favor of iterating on its HY4/HY3 family.

### Built like a system. Not vibe-coded.

Remy manages the project — every layer architected, not stitched together at the last second.

## Why is LLM text generation slow in the first place?

Autoregressive generation, the standard way large language models produce text, writes one token at a time. Each new token requires a full forward pass through the model, and each pass costs GPU time and memory bandwidth. Three tokens means three passes. For long outputs, like a page of code or a multi-turn agent response, this adds up to a lot of sequential, unparallelized work.

Speculative decoding attacks this bottleneck by decoupling “guessing” from “verifying.” A small, cheap drafter model proposes several tokens ahead, say five at a time, and the large model checks all of them in a single pass. Any correct guesses are kept, the first incorrect guess is replaced with the big model’s actual output, and everything after that point is discarded and redone. In a clean example, three passes that would normally yield three tokens can instead yield fifteen, because each pass verifies a whole batch of guesses rather than producing one token. Real-world gains are smaller than the ideal case, since drafting and verification both take time and guesses are often wrong, but the big model always retains final authority over the output.

## How does DFlly2 actually work?

The problem most drafters face is that to guess well, they need to know what already happened in the conversation. The common solution is to give the drafter its own memory, a running record of the context separate from the big model’s internal state. That memory costs GPU space and scales with conversation length.

DFlly2 takes a different approach: it reuses the big model’s existing work. Models that use natively sparse attention don’t scan every previous token when generating; their attention layers select specific earlier positions to focus on. DFlly2’s drafter reads those same selected positions directly from the big model’s attention layers, rather than maintaining a second, duplicate memory. The analogy used to describe it: borrowing a classmate’s notebook that already has the important lines highlighted, instead of rewriting your own notes from scratch. A practical side effect is that as the conversation grows, the number of positions DFlly2 has to read stays fixed, rather than growing with context length.

The tradeoff is architectural: this only works with models that are natively sparse to begin with. You can’t bolt DFlly2 onto an arbitrary dense transformer and expect the same benefit, because there’s no sparse attention selection to borrow from.

## How does DFlly2 compare to MTP, Eagle 3, DFlash, DFlash2, and DSpark?

Several existing speculative decoding techniques tackle the same problem differently:

- **MTP (multi-token prediction) and Eagle 3** draft tokens one after another in standard autoregressive fashion and maintain their own context memory separate from the main model.
- **DFlash** improves on this by drafting an entire block of tokens at once rather than one at a time, but it still keeps its own memory.
- **DFlash2** (not to be confused with DFlly2, despite the similar name) addresses a weakness in DFlash where neighboring token guesses within a block could contradict each other. DFlash2 keeps 16 candidate options at each position and selects a coherent path through them, letting each position’s guess account for the one before it. Its focus is coordination between guesses in the same block.
- **DSpark** also drafts in blocks, then adds a step-by-step refinement so each guess can factor in the previous one. According to the DFlly2 paper, DSpark’s own memory only covers a recent window of context to save space, which means the drafter can’t reach further back than that window.
- **DFlly2** also drafts in blocks, but its differentiator is that it builds no separate context memory at all. It reads the big model’s own sparse attention selections, including positions from much earlier in the conversation that a recency-limited window would miss.

Remy.

The tradeoff, again, is that DFlly2 depends on the base model being natively sparse, a constraint the other methods don’t share.

## What do the actual benchmark numbers show?

Tencent tested DFlly2 on HY4 Flash using four agent-based tests, one request at a time. Measuring only the speed of generating the answer (excluding prompt processing), DFlly2 reached 3.41x the baseline speed, compared to 2.63x for DSpark, roughly a 30% edge. But when the measurement includes the full request, meaning prompt processing plus generation, DFlly2’s advantage drops to 1.67x versus DSpark’s 1.55x. The lesson here is one worth remembering whenever a vendor touts a big speedup number: always check whether it covers just the output generation or the entire request lifecycle, because the two can tell very different stories.

Under server load, using DeepSeek V4.1 Flash with many simultaneous requests, the comparison shifts to total throughput at a fixed per-user generation speed. Here DFlly2 produced 28% more total output than DSpark on short text, 62% more on long code generation, and 81% more on a coding agent test. The pattern across all three is consistent: the longer and more complex the workload, the bigger DFlly2’s advantage over DSpark.

Tencent’s paper compares DFlly2 against its own DFlash and DSpark implementations, trained using the same recipe for fairness, but does not include head-to-head numbers against MTP, Eagle 3, or DFlash2.

## Is DFlly2 worth paying attention to?

For anyone building or deploying AI agents that generate long outputs, long code, or multi-step reasoning chains, DFlly2’s results suggest it’s worth tracking, especially the finding that longer workloads see bigger gains. That lines up with how agentic AI products are actually being used now: long contexts, long outputs, many sequential tool calls.

The catch is accessibility. Running these models requires serious hardware, think a multi-GPU cluster with at least eight GPUs carrying 80GB of VRAM each, to run the DeepSeek or HY4 variants Tencent released alongside a GLM model on Hugging Face. This isn’t something to spin up on a laptop or a single cloud GPU instance. It’s squarely infrastructure-tier research aimed at teams already running large-scale inference.

It’s also worth treating these benchmarks as Tencent’s own reported figures rather than independently verified numbers. The methodology looks reasonable and the comparisons against DFlash and DSpark are apples-to-apples since all three were trained the same way, but there’s no third-party replication yet, and no direct comparison against Eagle 3 or DFlash2 in the published results.

## Frequently Asked Questions

### What is speculative decoding in simple terms?

It’s a technique where a small, fast model guesses several upcoming tokens, and the large model verifies all of them in one pass instead of generating tokens one at a time. Correct guesses are kept, and generation restarts from the first wrong guess, which speeds up overall output.

### Why does DFlly2 need a “natively sparse” model?

DFlly2 works by reading the big model’s own sparse attention selections, the specific earlier positions the model already chose to focus on. If the base model doesn’t use sparse attention, there’s nothing for DFlly2 to borrow, so the technique doesn’t apply to standard dense transformers.

**›** Build a claims-review app for 400 adjusters.

*already included:*✓ HIPAA✓ access control✓ audit log✓ self-hosted

### Is DFlly2 actually 4.2x faster in all cases?

No. The 4.2x figure represents a best-case scenario under specific conditions. Measured results vary depending on whether you’re counting only token generation speed or the full request including prompt processing, and whether the system is handling one request or many concurrent ones under load.

### How is DFlly2 different from DFlash2?

Despite the similar names, they’re separate projects. DFlash2 focuses on making block-drafted guesses coordinate better with each other by keeping multiple candidates per position. DFlly2 focuses on eliminating the drafter’s separate memory entirely by reusing the big model’s sparse attention notes.

### Can I run DFlly2 on consumer hardware?

Not practically. Tencent’s released models, including DeepSeek and HY4 variants, require a multi-GPU setup with at least eight GPUs at 80GB VRAM each. This is infrastructure meant for large-scale inference deployments, not individual developers or hobbyist setups.
