Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

DFly2 Open-Sourced: 81% Higher 64K Throughput, Zero Extra KV Memory — But Only for Sparse Models

Tencent open-sources DFly2, a draft model for speculative decoding that shares KV cache and sparse indices with native sparse-attention models (DeepSeek-V4.1-Flash, GLM-5.3-Flash, Hy4 flash), delivering 81% higher throughput at 64K context with zero extra KV memory, though end-to-end speedup is only 1.35× due to prefill overhead.

Core Claim: 81% Throughput Gain Under Specific Conditions

On November 26, Tencent Hunyuan fully open-sourced DFly2 — weights, training code, and a 20-page technical report (arXiv:2611.34776) under Apache-2.0. The widely circulated figure is an 81% throughput increase for DeepSeek-V4.1-Flash at 64K context. The paper states that under high concurrency, matching single-user decoding speed, throughput on two 64K datasets (CodeSpan 64K and SWE 64K) is 62% and 81% higher than the baseline DSpark (a stronger sliding-window baseline trained with the same recipe). Three conditions are mandatory: (1) matching single-user speed — not fixed concurrency, but measuring how many requests fit while each user feels the same speed; (2) 8P1D deployment — 8 prefill instances per 1 decode instance on H20 GPUs with vLLM, DP8×TP1 with EP8, greedy decoding; (3) throughput measured for the whole deployment, not per-card per-request token/s. In short, the 81% figure is for production serving teams: at the same latency budget, you can rent fewer GPUs. It does not mean a single 64K request runs 81% faster locally.

Problem: Traditional Draft Models Become a Bottleneck as Main Models Get More Efficient

Speculative decoding uses a small draft model to guess multiple tokens (e.g., 5) which the main model verifies in one forward pass — output is strictly lossless, saving serial main-model steps. Long contexts should benefit most, but traditional draft models must maintain their own KV cache. The paper breaks down the overhead for three models (bf16, three-layer draft):

DeepSeek-V4.1-Flash uses YOCO cross-layer sharing to compress main-model KV to 4.4 KiB/token; a three-layer draft adds 3.4 KiB/token, raising total KV to 1.76× the original.

GLM-5.3-Flash : 1.26× total KV.

Hy4 flash : 1.20× total KV.

Extra KV memory is only the first cost. Three hidden costs follow:

Concurrency squeezed : Fixed GPU memory, 76% more KV per request → concurrency must drop. Removing draft KV lets DS-V4.1-Flash fit 1.73× more requests at 32K length.

First-token latency (TTFT) hurt : In prefill-decode (PD) separation, the draft must build its own cache, requiring re-projection in prefill nodes. The prior DFlash solution on DS-V4.1-Flash agent benchmarks achieved only 0.90× end-to-end — slower than no acceleration.

Prefix cache damaged : Multi-turn agent dialogues rely on prefix cache hits. Prefix caches don't store main-model intermediate hidden states, so draft caches either consume >40% of DS-V4.1-Flash's prefix pool or force recomputation on hit.

Sliding-window baselines (e.g., DSpark only attends to the latest 128 tokens) save memory but lose context: at 32K context they see only 0.4% of tokens, dropping long-context acceptance length by 3%–12%.

DFly2's Approach: Reuse What the Main Model Already Computed

Native sparse models (DSA family) already have trained lightweight indexers per sparse-attention layer that select a fixed budget of top-k key positions per generated token. DFly2 exploits this: the main model already paid for the cache and the scoring.

KV Share : Three draft layers pair with three main-model sparse-attention layers, reading the already-compressed KV directly; the draft stores zero context cache.

Index Share : The draft reads exactly the positions the paired main-model layer selected — no indexer, no scoring. Positions read per step are fixed regardless of context length: DS-V4.1-Flash reads 646 positions (512 top-k + 128 local window + 6 intra-block), GLM-5.3-Flash and Hy4 flash each read 2054 positions.

Layer pairing is critical. DS-V4.1-Flash must pair with its layers 28, 32, 36 (which have independent indexers). Swapping to adjacent layers 37–39 (same view three times) drops acceptance length by 4.6% .

Key validation: Can the index selected one step ahead serve the next few tokens? Tencent measured 158,638 long-context blocks on DS-V4.1-Flash. The top-512 list chosen one step early covers 87.3%–88.0% of the positions the next slots actually attend to; even the deepest layer (36) at the 5th slot retains 81.1% coverage. A sliding window with equal compute budget covers only 14.7%–17.5% and degrades as context grows from 16K to 128K, while the shared list stays flat. The paper attributes this to indexer query vectors concentrating energy in low-frequency RoPE components — shifting a few positions doesn't change ranking; focus drifts slowly rather than jumping.

Two additional pieces: (1) gated injection of the main model's final-layer hidden state at block start (in PD separation, only one extra vector per request); (2) per-slot correction inside the block by re-reading shared context (this serial step is <1% of TP8 single-step decode; removing it costs 2.8% acceptance length).

Results: Three Models, Short Text Warm-up, Long Context Shows Real Gains

Using identical training recipes and three-layer MoE scale, Tencent compared DFlash, DSpark, and DFly2 on three architecturally different sparse models: DS-V4.1-Flash, GLM-5.3-Flash, Hy4 flash.

Decoding and end-to-end speedup across three models
Decoding and end-to-end speedup across three models

Acceptance length advantage over the stronger baseline (DSpark):

General short text: 3.9%–10.5%

Long context (32K–128K): 10.0%–31.5%

Agentic: 10.0%–31.5%

Decoding speedup advantage:

General short text: 2%–6%

Long context: 6%–18%

Agentic: 12%–30%

On AgentLongBench 64K, average acceptance lengths reach 5.10 (DS), 5.49 (GLM), 5.41 (Hy4) — block size is only 6, nearly hitting the theoretical ceiling. DFly2's agent acceptance length stays within 4% of general short text; DSpark drops 11%–21% from general to agent.

But the advertised "up to 4.2×" must be split into two accounts. Paper Table 9 shows Hy4 flash with DFly2 on AgentLongBench: decoding segment 4.55×, end-to-end 1.35× . SWE 64K: 3.46× / 1.96×. CodeSpan 64K: decoding >4×, end-to-end 2.51×. This isn't shrinkage; long-input short-output tasks spend most time in prefill, which speculative decoding does not compress proportionally. If your workload is "drop a 64K manual and get two sentences back", end-to-end gain will be far below the marketing number.

Four Boundaries You Must Know

Only works with native sparse models. DFly2 depends on the target model's existing sparse KV, trained indexers, and top-k selection. Dense attention models (most open-source LLMs) lack these assets. Released weights cover only three models: DS-V4.1-Flash, GLM-5.3-Flash, Hy4 flash; others require training via AngelSpec (supports 7 draft architectures).

All numbers are Tencent self-reported; no third-party reproduction seen. 62%, 81%, 3.9%–10.5%, 10.0%–31.5% come from the official technical report and release notes. The abstract omitted batch size and GPU details (body adds H20 + vLLM). Treat these as directional, not SLAs.

Single-user experience barely changes. The 81% is high-concurrency throughput; short-text same metric is only 28%; general tasks beat DSpark by 3.9%–10.5%. Running one local conversation yields far less dramatic benefit.

Engine support still in progress. The model card notes vLLM's speculative decoding support is ongoing. For production, benchmark with your own traffic and log TTFT separately — the drafter skips prefill, so average speed mixes both phases.

A practical heuristic: watch "acceptance length" (tokens accepted per verification). If it falls below 2, your traffic distribution diverges from the training distribution; forcing DFly2 yields no gain.

Decision Guide: Should You Adopt DFly2?

DFly2 adoption decision flowchart
DFly2 adoption decision flowchart

Self-hosted inference + model in the list + long-context or agent traffic : Try this week. Saved GPU-hours are real, and unchanged output means no re-evaluation needed.

PD separation deployment : Most complete benefit. Drafter skips prefill; P-to-D passes only one final-layer hidden state. Colocated deployment misses this advantage.

Using cloud vendor APIs : No action needed. This happens at the inference framework layer; no console toggle exists.

Short chat, small context : Not urgent. 3.9%–10.5% general-task lift may not justify a deployment churn.

Dense models or models not exposing indexers : Not applicable yet. But watch for when vLLM/SGLang integrate this by default — then most users benefit without code changes.

The most important takeaway isn't 81%, but the cost-structure shift: the draft model no longer pays for "looking at context"; it reuses the computation the main model already paid for. The dividends of main-model sparsification are finally passed to speculative decoding.

Data sourced from DFly2 technical report (arXiv:2611.34776) and Tencent Hunyuan official release — all self-reported, no third-party replication observed. Code, weights, and full benchmarks available at the original link.

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

speculative decodingsparse attentionGLM-5.3-FlashDeepSeek-V4.1-FlashLLM inference optimizationKV cache sharingHy4 flashDFly2high-concurrency throughputzero extra memory

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion