Direct answer: Tencent Hunyuan open-sourced its speculative decoding scheme DFly2 on November 26, 2026. That “4.2×” comes from one specific test: the pure decode speed of Hy4 Flash A12B on AgentLongBench 64K. The comparison baseline is the same model generating token by token with speculative decoding turned off, under greedy decoding with thinking disabled. DFly2 works by having a small draft model guess 5 tokens at a time, which the main model then verifies in a single pass. The draft model doesn’t maintain its own long-context cache — it directly reuses the historical positions and KV that the main model’s sparse attention has already selected. That’s why its advantage over older approaches grows as the input gets longer. One caveat: 4.20× is the single highest value in the launch chart. It does not mean everything runs 4.2× faster, and it does not mean user wait time shrinks to a quarter of what it was.
What you’ll take away from this article:
- The conditions under which 4.2× holds, what the numerator and denominator actually are, and how it differs from the 4.55× and 1.35× reported in the paper
- DFly2’s “guess first, verify later” flow, and how its draft cache design differs from DFlash and DSpark
- How to tell apart three metrics: pure decode speed, end-to-end speed, and total server-side throughput
- What resources are available right now if you want to self-host or evaluate it on the API side, and how to measure decode speed yourself
Index: “To Know” and “Impact at a Glance” start by explaining the necessary terms and laying out the impact by audience. “Objective Facts” then walks through the timeline, the launch numbers, the paper’s experiments, the technical principles, and the deployment status, with every figure labeled by source and definition. “Analysis” discusses what 4.2× actually means for long context and self-hosting. “Quick Start” provides a script for measuring streaming decode speed, and the FAQ at the end answers common questions.

To Know: Key Concepts Behind DFly2 Speculative Decoding
| Concept | Brief explanation |
|---|---|
| Speculative decoding | A small model first guesses several upcoming tokens, then the large model verifies them all in a single forward pass. Accepted tokens are kept as-is, reducing the number of token-by-token computations the large model has to do. |
| Draft model | The lightweight model that does the “guessing.” DFly2 is a draft-model design, not a new primary model. |
| Anchor | The last position already confirmed by the primary model. The draft model guesses forward from here. |
| Average acceptance length | The average number of tokens advanced per verification round, including the 1 extra token the primary model contributes. It is not the same as the speedup factor. |
| Pure decoding speed | Per-user tok/s measured only during the generation phase, excluding prompt-reading time. |
| End-to-end speed | Overall speed including prefill, which is closer to the actual latency of a single request. |
| Prefill | The phase where the primary model reads in and processes the entire input at once. The longer the input, the heavier this phase. |
| KV cache | The historical keys and values stored during attention computation, which must be read repeatedly during decoding. |
| Sparse attention / top-k position selection | The primary model selects only a subset of historical positions to participate in attention computation at each step, rather than reading the entire history. |
| Rejection sampling | A verification rule used during stochastic sampling to ensure the output distribution matches the primary model’s. |
| Prefill/decode disaggregation | A deployment approach that runs prefill and decoding on separate machine groups. |
| TP8 | 8-GPU tensor parallelism, splitting one model across 8 GPUs. |
DFly2: Impact at a Glance
- Teams self-hosting Hy4 Flash: the main repo already includes the draft model, and both vLLM and SGLang have official images, so you get acceleration directly in the generation phase. Long-context and agentic workloads benefit most; the gains on short text are comparatively limited.
- Developers working on inference frameworks or speculative decoding research: AngelSpec has released its training code, configs, and three independent sets of B6 draft weights. The idea that “the draft reuses the main model’s sparse KV” can be reproduced and compared against directly.
- Users who only call models through an API: speculative decoding runs server-side, so the way you call the model doesn’t change. How much faster it gets, though, depends on whether the provider enables it and whether your requests are prefill-heavy or decode-heavy. You can use the script later in this article to measure generation speed yourself on an OpenAI-compatible endpoint such as APIYI apiyi.com.
- People doing evaluation and model selection: be clear about the three different measures — pure decode, end-to-end, and total throughput — and avoid treating a single peak number as a conclusion about the product experience.
DFly2 Open-Source Facts: Timeline and Release Details
Timeline of Tencent’s DFly2 Open-Source Release
DFly2 involves several distinct events, and the dates need to be considered separately:
- November 16: The Hy4 Flash target model was released, and the main repository included a draft model.
- November 25 (UTC): DFly2 paper v1 was submitted to arXiv.
- November 26: Tencent Hunyuan’s official WeChat account announced the DFly2 open-source release, with the headline tying the 4.2× figure to Hy4 Flash. The official X account also highlighted Hy4 Flash’s long-context and agent workloads.
This dedicated open-source release was published through the AngelSpec repository. It made the training code and configurations public and provided three independent sets of B6 draft weights, for Hy4 Flash, DeepSeek V4.1 Flash, and GLM-5.3 Flash respectively. In other words, “Hy4 Flash comes with a usable draft model” and “the November 26 DFly2 dedicated open-source release” are two different things and shouldn’t be conflated.
Test Conditions Behind Hy4 Flash’s 4.2× Decoding Speedup
The original launch graphic from Tencent reports that Hy4 Flash A12B reaches 4.20× on AgentLongBench 64K. The denominator is the autoregressive speed of the same target model with speculative decoding disabled; the numerator is the pure decoding speed after enabling the draft model. The caption states the conditions as T=0 greedy decoding, thinking disabled, and 5 candidates per round.
| Launch test item (Hy4 Flash) | Pure decoding speedup (vs. autoregressive baseline) | Notes |
|---|---|---|
| AgentLongBench 64K | 4.20× | Highest single result, average accepted length 5.43 |
| SWE-bench 64K | 3.47× | Agent group |
| LongSWE 128K | 3.25× | Long context |
| CodeSpan 64K | 3.19× | Long context |
| BFCL-v3 | 3.09× | Agent group |
| MemoryAgentBench | 2.29× | Agent group |
| Equal-weighted average of four agent tasks | ~3.26× | Calculated from launch data |
| Aggregate of twelve short-text tasks | 2.88× | Only 2.3% faster than a stronger draft with the same training recipe |
The launch graphic also uses another comparison basis: against a stronger DFlash/DSpark draft trained on the same data for the same number of steps, the AgentLongBench 64K result has 68.5% higher average accepted length and 65.2% faster decoding. The standard Hy4 A49B also reaches 4.20× on the same test; this article only covers Hy4 Flash.
Table 9 in the Paper: 4.55× and 1.35× from Another Set of Experiments
Table 9 in the paper comes from an independent set of experiments. The setup is a single NVIDIA H20 TP8 instance, concurrency 1, greedy decoding, thinking disabled, and a maximum output of 2,048 tokens. The comparison baseline is the same model generating one token at a time. This is not the same measurement as the launch graphic, so the numbers aren’t interchangeable.
| Paper Table 9 (Hy4 Flash) | Pure decoding | End-to-end (including prefill) |
|---|---|---|
| AgentLongBench | 4.55× | 1.35× |
| CodeSpan 64K | 3.48× | 2.51× |
| LongSWE-Bench 128K | 3.22× | 1.68× |
| Average of three long-context tasks | 3.06× | 2.12× |
| Average of four agent tasks | 3.41× | 1.67× |
The most striking thing about this table is the gap between pure decoding and end-to-end. AgentLongBench reaches 4.55× in pure decoding but only 1.35× end-to-end, because in these tasks, prefill for long inputs takes up most of the time, and speculative decoding can only speed up the generation phase.
How DFly2’s Speculative Decoding Works: Guess First, Verify Later
In ordinary autoregressive generation, every token the model outputs requires a full forward pass through the main model. DFly2’s process goes like this: the draft model starts from the last confirmed anchor and guesses 5 positions in parallel; the main model does a single forward pass to verify those 5 candidates; whatever passes verification consecutively from the start is kept in full; then the main model contributes 1 more token on its own. If all 5 candidates pass, this round advances 6 tokens.

On correctness: with greedy decoding, the output matches exactly what the main model itself would have chosen; with random sampling, verification plus rejection sampling guarantees that the output distribution matches the main model’s. So speculative decoding itself doesn’t change the quality of the model’s answers. The hard part is that two requirements have to be met at once: the draft model has to be cheap enough, otherwise the draft overhead cancels out the time you saved; and the hit rate has to be high enough, otherwise a single verification only moves you forward one or two tokens.
One caveat: an average acceptance length of 5.43 doesn’t mean it’s 5.43× faster. Verification has its own cost, and so does drafting, so the actual speedup has to be measured separately.
Draft Cache Differences Between DFly2, DFlash, and DSpark
In long-context scenarios, the main cost for a draft model is “reading history.” The three approaches handle this differently:
| Approach | How the draft reads long context | Cost under long input |
|---|---|---|
| DFlash | Builds a separate draft cache for the entire context | Read volume grows with input length |
| DSpark | Uses a sliding window to limit the read range | Cost stays bounded, but farther history is harder to access directly |
| DFly2 | Binds each layer to one sparse layer of the main model, reusing that layer’s KV and the position indices left by the previous verification round | Each layer has a read cap (Hy4 Flash: up to 2,048 positions, which can be scattered anywhere in the full text) |

The key to DFly2 is that the sparse-attention main model already has to select important historical positions, and it already stores the corresponding KV. The draft model reuses those results directly, with 5 candidates sharing the same set of positions. That means no re-selection and no separate cache. The “fixed cost” the paper emphasizes means the draft attention has an upper bound on reads per layer; the main model’s prefill cost when processing long input still exists.
This design also brings two deployment benefits. First, there’s no extra draft KV resident per request, so you can keep using the main model’s prefix cache. Second, in prefill/decode disaggregated deployments, the draft model sits on the decode side, and across stages each request only needs to transfer the last layer’s hidden vector. Sparse position selection can miss local dependencies; anchor hidden vectors and light in-block corrections make up for that.
DFly2 Training Method and Ablation Results
During training, only the draft model is trained; the main model stays frozen, and its frozen indexer recomputes the position selections in the training samples. The training data consists of about 990,000 conversations and 7.42 billion tokens, with a sequence length of 32K; evaluation extends to 64K and 128K. Ablation experiments show that the Hy4 Flash agent group had an average acceptance length of 3.76; after removing top-k position selection and keeping only neighboring positions, it dropped to 3.13. This shows that being able to see key positions scattered across the full text really does improve the hit rate. The paper’s combined average covers multiple workloads and four sampling settings.
Current Deployment Status of Hy4 Flash and DFly2
Based on available information, here’s what we can currently confirm about deployment:
- The main Hy4 Flash repository ships with a five-layer, roughly 850M-parameter draft model. vLLM and SGLang have official images, along with examples for Hy4 Flash FP8 and TP8. For exact commands, refer to the inference-frameworks section in the main repo.
- The standalone B6 draft released by AngelSpec has a three-layer MoE architecture. The vLLM integration for all three weight sets is marked in progress.
- Products such as TokenHub and WorkBuddy have already launched Hy4 Flash. The official claim of “over 150 tok/s” is the combined result of megakernel, 4-bit quantization, DFly, and other techniques—not a contribution from DFly2 alone. Catalog API pricing is 0.5 yuan per million input tokens, 2 yuan per million output tokens, and 0.02 yuan for cache hits.
- In a comparison across 1,000 real WorkBuddy tasks (with thinking disabled), Hy4 Flash + DFly2 had an average acceptance length of 4.47 under greedy decoding, while DeepSeek V4.1 Flash + DSpark had 4.37; with temperature 0.9 and rejection sampling, the numbers were 4.31 and 4.21, respectively. These figures compare the per-round acceptance length of two “main model + draft” combinations; they are not a conclusion about speed. Some reposted versions of the original chart show 10.4%; that figure is a random sampling result for standard Hy4 on an agent benchmark and is unrelated to these 1,000 tasks.
DFly2 Analysis: What 4.2× Means for Long Context and Self-Deployment
Why 4.2× doesn’t mean it feels 4.2× faster
| Metric definition | What it covers | The part DFly2 can affect |
|---|---|---|
| Per-user pure decode speed | tok/s during the generation phase | Directly accelerated — the 4.20× figure is measured this way |
| End-to-end speed | Prefill + decode | Only the decode portion is accelerated; with long inputs the gain gets diluted by prefill |
| Real-world product latency | End-to-end + queueing, tool calls, network | Even less impact, and it also depends on how serving is orchestrated |
| Server-side total throughput | Output volume the whole service handles per second | Depends on concurrency and resource allocation; needs to be measured separately |
These four lenses determine how you should read the 4.2×. The 4.20× pure-decode number shows that at 64K context, the draft model’s cost has been pushed low enough and its hit rate is high enough. But for a request that reads in 64K of context and emits only a few hundred tokens, the speedup users actually feel will be noticeably smaller than that number — the paper’s 1.35× end-to-end result is the proof. Conversely, the longer the output and the longer the chain of thought, the closer a task gets to the pure-decode lens.
Figure 7 in the paper adds a server-side perspective, though it compares DeepSeek V4.1 Flash against DSpark, not the 4.2× on Hy4. At the same per-user speed, total throughput rises by 28%, 62%, and 81% for short text, CodeSpan 64K, and SWE 64K respectively; at the same total throughput, per-user speed rises by 15%, 23%, and 24%. Two of the 64K tests used a configuration of eight prefill groups to one decode group, with concurrency from 1 to 32. At the very least, this shows that DFly2’s design pays off in batched serving too — not just on single-request benchmarks.
Why DFly2 matters for long context and self-deployment
The most valuable thing about DFly2, in our view, is that it shifts the core tension in speculative decoding from “does the draft need to read the whole thing?” to “can the draft reuse the position selection the main model has already done?” That idea comes with a prerequisite: the main model itself has to use sparse attention and expose a hierarchical position index. So it’s not a generic plug-in you can bolt onto any model.
For self-hosting teams, the most direct path today is Hy4 Flash, where the draft ships in the main repo and there are official vLLM and SGLang images. The standalone B6 draft isn’t integrated into vLLM yet; teams planning to use it with DeepSeek V4.1 Flash or GLM-5.3 Flash will need to wait, or do the integration themselves.
The short-text numbers deserve an objective look too: 2.88× across the twelve benchmarks, only 2.3% faster than the strongest same-recipe draft. If your workload is mostly short conversations, DFly2 adds very little over existing speculative decoding schemes; its advantage is concentrated in long context beyond 64K and in agentic workflows.
What to watch next (the following are forward-looking judgments)
- Once the standalone B6 draft lands in vLLM, can third-party models reproduce the speedups reported in the paper?
- Real measurements with longer outputs and thinking mode turned on. Nearly all public numbers so far were measured with thinking disabled.
- Whether API providers enable drafts like this by default on Hy4 Flash-class models, and whether they state which speed metric they’re quoting.
DFly2 Quick Evaluation: Measuring Your Decoding Speed
Whether or not the server uses speculative decoding, you can separate “first-token latency” from “generation-phase speed” by measuring streaming output — the same idea as distinguishing pure decoding from end-to-end timing in the previous section. One caveat: there’s no information suggesting that APIYI has integrated Hy4 Flash or DFly2 yet. The script below works with any OpenAI-compatible endpoint; just replace YOUR_MODEL with a model name available in your console.
import time, openai
client = openai.OpenAI(api_key="YOUR_API_KEY", base_url="https://api.apiyi.com/v1")
t0, first, usage = time.perf_counter(), None, None
stream = client.chat.completions.create(
model="YOUR_MODEL", temperature=0, stream=True,
stream_options={"include_usage": True},
messages=[{"role": "user", "content": "用 300 字解释投机解码"}],
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content and first is None:
first = time.perf_counter()
if chunk.usage:
usage = chunk.usage
end, n = time.perf_counter(), usage.completion_tokens
print(f"首字延迟 {first - t0:.2f}s | 生成速度 {(n - 1) / (end - first):.1f} tok/s | 端到端 {end - t0:.2f}s")
View the full code: comparing short-input vs. long-input speed
import time
import statistics
import openai
client = openai.OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.apiyi.com/v1", # APIYI OpenAI-compatible endpoint
)
MODEL = "YOUR_MODEL"
def measure(prompt: str, max_tokens: int = 1024) -> dict:
"""Measure one streaming request: first-token latency (roughly prefill + queueing + network) and generation-phase speed"""
t0, first, usage = time.perf_counter(), None, None
stream = client.chat.completions.create(
model=MODEL,
temperature=0, # Greedy sampling, close to the setup used in DFly2 tests
max_tokens=max_tokens,
stream=True,
stream_options={"include_usage": True},
messages=[{"role": "user", "content": prompt}],
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content and first is None:
first = time.perf_counter()
if chunk.usage:
usage = chunk.usage
end = time.perf_counter()
n = usage.completion_tokens if usage else 0
decode = (n - 1) / (end - first) if first and n > 1 else 0.0
return {"ttft": first - t0 if first else None, "decode_tps": decode,
"e2e": end - t0, "in_tok": usage.prompt_tokens if usage else 0, "out_tok": n}
def bench(name: str, prompt: str, runs: int = 3):
rows = [measure(prompt) for _ in range(runs)]
print(f"[{name}] 输入≈{rows[0]['in_tok']} tok, 输出≈{rows[0]['out_tok']} tok")
print(f" 首字延迟中位数 {statistics.median(r['ttft'] for r in rows):.2f}s")
print(f" 生成速度中位数 {statistics.median(r['decode_tps'] for r in rows):.1f} tok/s")
print(f" 端到端中位数 {statistics.median(r['e2e'] for r in rows):.2f}s")
short_prompt = "写一段 500 字的 Python 异步编程教程。"
long_context = "\n".join(f"第{i}行日志:服务 A 调用服务 B 返回 200。" for i in range(3000))
long_prompt = long_context + "\n\n请总结以上日志并写一段 500 字的分析。"
bench("短输入", short_prompt)
bench("长输入", long_prompt)
When you run it, watch for two things: first-token latency grows noticeably with long input, which is exactly the prefill cost that speculative decoding can’t eliminate; generation speed mainly reflects how well the server has optimized the decoding phase. Client-side numbers include network and queueing time, so treat them as relative references only — don’t compare them directly with the H20 single-instance figures from the paper.
🚀 Getting Started Tip: When evaluating model speed, run the same prompt several times in the same time window and take the median. With APIYI apiyi.com, you can switch between multiple mainstream models using a single key, making it easy to compare generation speed and time to first token side by side; new users get free testing credits, so you can start by validating with a small sample.
Frequently Asked Questions (FAQ)
Q1: What is DFly2?
DFly2 is Tencent Hunyuan’s open-source speculative decoding draft-model approach. The draft model guesses 5 tokens in parallel each round, and the main model verifies them in a single pass. Its key feature is that the draft directly reuses the historical positions and KV selected by the main model’s sparse attention, so in long-context scenarios the draft’s read cost stays within a fixed upper bound.
Q2: What’s the difference between Hy4 Flash’s 4.2× and the paper’s 4.55×?
They come from different experiments. The 4.20× comes from Tencent’s launch graphic and measures pure decoding speed on AgentLongBench 64K. The 4.55× comes from Table 9 of the paper, under the conditions of H20, TP8 single instance, concurrency 1; the end-to-end speedup for the same item is only 1.35×. The two sets of numbers shouldn’t be cited interchangeably.
Q3: When was DFly2 open-sourced? Was Hy4 Flash released on the same day?
No, not the same day. Hy4 Flash was released on November 16, with the draft model built into the main repository. The DFly2 paper v1 was submitted on November 25 (UTC), and the dedicated open-source announcement was published by the Tencent Hunyuan WeChat account on November 26.
Q4: Does speculative decoding reduce answer quality?
By design, no. With greedy decoding, the output matches the main model’s own choice; with random sampling, verification and rejection sampling preserve the main model’s output distribution. If the draft guesses wrong, it only means fewer tokens are advanced in that round; it affects speed, not quality.
Q5: Can I get DFly2 acceleration directly through API calls?
That depends on whether the provider has enabled DFly2 on the server side; the caller’s code doesn’t need any changes. Currently, there’s no information showing that APIYI has DFly2 available. If you want to compare the actual generation speed of different models, you can use the script in this article on APIYI apiyi.com to measure time to first token and tok/s yourself.
Q6: What are DFly2’s limitations?
– The speedup applies only to the decoding phase; the prefill cost for long inputs remains, so the end-to-end improvement is noticeably smaller than the pure decoding multiplier.
– In short-text scenarios, the relatively strong same-recipe draft is only 2.3% faster.
– It relies on the main model’s sparse attention and position indices, so it can’t be applied to just any model.
– vLLM integration for the standalone B6 draft is still in progress; the public data was mostly measured with thinking disabled.
If you’re choosing a model for long-context or agent tasks next, a more useful approach than looking at the 4.2× alone is to measure time to first token and generation speed separately with your own real prompts. On APIYI apiyi.com, the same script can quickly give you comparable data.
📚 References
-
Tencent Hunyuan WeChat account: DFly2 open-source release
- Link:
mp.weixin.qq.com/s/d1HMHrSEChCJiBRZ0tNOyg - Description: The November 26 launch post and the 4.2x original image
- Link:
-
DFly2 paper (arXiv)
- Link:
arxiv.org/abs/2611.34776 - Description: The principles, experimental conditions in Table 9, ablations, and the throughput analysis in Figure 7
- Link:
-
AngelSpec repository
- Link:
github.com/Tencent/AngelSpec - Description: Training code, configs, and entry points for the three sets of B6 draft weights
- Link:
-
Hy4 Flash main repository: inference framework documentation
- Link:
github.com/Tencent-Hunyuan/Hy4-flash - Description: Built-in draft model, official vLLM/SGLang images, and FP8 TP8 examples
- Link:
-
Hy4 Flash DFly2 B6 draft weights
- Link:
huggingface.co/AngelSlim/Hy4-flash-DFly2-B6 - Description: A standalone three-layer MoE draft; vLLM integration is in progress
- Link:
-
Tencent Cloud Hy4 Flash API documentation
- Link:
cloud.tencent.com/document/product/1823/130055 - Description: API catalog and billing information
- Link:
Author: APIYI Technical Team
Technical discussion: Want to talk about inference acceleration or model selection? Reach out to us via the APIYI apiyi.com homepage.
