AIFeed

Tencent Open-Sources DFly2: Speculative Decoding That Reuses the Target’s Sparse KV Cache

Summary

Tencent has open-sourced DFly2 , a speculative decoding drafter built for natively sparse LLMs. DFly2 speculative decoding targets models like DeepSeek-V4.1-Flash, GLM-5.3-Flash and Tencent’s own Hy4 flash . Its main approach is that the drafter keeps no KV cache of its own. This is important for long-context and agentic serving, where draft memory competes with concurrency. TL;DR Size: 0.85B-parameter, 5-layer drafter shipped with Hy4 flash. Runs on: Serving tests used NVIDIA H20 GPUs with vLLM, TP8 per instance. Hy4 flash’s vLLM recipe defaults to 8x H200. Performance: Higher draft acceptance than same-recipe DFlash and DSpark on all 3 targets and all general benchmarks. Best: Up to 81% more throughput on DeepSeek-V4.1-Flash (SWE 64K), at matched per-user speed. Worst: Smallest gain on Hy4 flash general tasks: only 3.9% over DSpark at temperature 0. What is DFly2? DFly2 is a block-parallel speculative decoding drafter from Tencent’s Hunyuan AI Infra team. It is described in the resea…

Original text(via MarkTechPost)

Tencent has open-sourced DFly2, a speculative decoding drafter built for natively sparse LLMs. DFly2 speculative decoding targets models like DeepSeek-V4.1-Flash, GLM-5.3-Flash and Tencent’s own Hy4 flash. Its main approach is that the drafter keeps no KV cache of its own. This is important for long-context and agentic serving, where draft memory competes with concurrency.

TL;DR

  • Size: 0.85B-parameter, 5-layer drafter shipped with Hy4 flash.
  • Runs on: Serving tests used NVIDIA H20 GPUs with vLLM, TP8 per instance. Hy4 flash’s vLLM recipe defaults to 8x H200.
  • Performance: Higher draft acceptance than same-recipe DFlash and DSpark on all 3 targets and all general benchmarks.
  • Best: Up to 81% more throughput on DeepSeek-V4.1-Flash (SWE 64K), at matched per-user speed.
  • Worst: Smallest gain on Hy4 flash general tasks: only 3.9% over DSpark at temperature 0.

What is DFly2?

DFly2 is a block-parallel speculative decoding drafter from Tencent’s Hunyuan AI Infra team. It is described in the research paper ‘DFly2: Turbocharging Long-Context Speculative Decoding by Sharing the Target’s Sparsity‘.

Speculative decoding uses a small drafter to propose tokens. The target verifies them in 1 pass, so output stays lossless. Long context makes this costly. A normal drafter attends over the whole prefix and stores its own KV cache.

How does DFly2 work?

DFly2 pairs each draft layer with one sparse attention layer in the target. It shares 2 things with that layer.

  • KV sharing: the draft layer reads the paired target layer’s latent KV cache.
  • Index sharing: it attends only to positions the target’s indexer already selected (top-k sparse KV).
  • Initialization: each draft layer starts from its paired target layer’s weights.
  • Hidden injection: the target’s last-layer hidden state is gated into the draft block.
  • Intra-block correction: the drafter rereads the shared context slot by slot within a block.

On DeepSeek-V4.1-Flash, a selection made 1 step early covers close to 90% of what later block tokens select. A same-size sliding window recovers less than 20%.

Per the AngelSpec GitHub page, each draft token attends to at most about 2K keys. So drafting cost stays roughly flat at any context length. DFly2 also skips prefill entirely. The prefill-to-decode transfer adds only 1 last-layer hidden state.

How much memory does a separate draft cache cost?

A conventional 3-layer drafter cache would add this much per token (bf16, paper Table 2):

TargetTarget KVDrafter cacheIncrease
DeepSeek-V4.1-Flash4.4 KiB3.4 KiB1.76x
GLM-5.3-Flash11.7 KiB3.0 KiB1.26x
Hy4 flash17.2 KiB3.4 KiB1.20x

At 32K, removing the drafter’s cache lets the same memory pool hold 1.73x as many requests.

DFly2 benchmarks: acceptance, speedup and throughput

All numbers below are self-reported by Tencent. Baselines are DFlash and DSpark retrained on the same recipe.

Average accepted length (τ), general workloads, temp 0 / temp 1:

TargetDFlashDSparkDFly2
DeepSeek-V4.1-Flash3.65 / 3.283.81 / 3.514.12 / 3.88
GLM-5.3-Flash3.43 / 3.073.68 / 3.353.96 / 3.69
Hy4 flash3.58 / 3.483.81 / 3.733.96 / 3.95

The margin over the stronger baseline is 3.9% to 10.5% on general workloads. It rises to 10.0% to 31.5% on long-context and agentic workloads up to 128K. On agentic sets, DFly2’s average stays within 4% of its general average. DSpark’s falls by 11% to 21%.

End-to-end speedup (greedy, concurrency 1): 2.97x on DeepSeek-V4.1-Flash, 2.36x on GLM-5.3-Flash, 3.19x on Hy4 flash.

Serving throughput on DeepSeek-V4.1-Flash, matched per-user decode speed vs DSpark:

  • +28% on short text
  • +62% on CodeSpan 64K
  • +81% on SWE 64K

At matched throughput, each user decodes 15% to 24% faster.

Tencent’s announcement adds 3 figures for Hy4 flash agentic tasks. It claims up to 4.2x faster decoding and about 30% over same-recipe DSpark. It also claims 10.4% more accepted tokens than open-source DSpark.

DFly2 vs DSpark vs DFlash

FeatureDFly2 (Tencent)DSpark (DeepSeek)DFlash (z-lab)
Drafting styleBlock-parallel, sparsity-sharing ( paper )Semi-autoregressive, confidence-scheduled verification ( paper )Block diffusion ( paper )
Own draft KV cacheNo ( README )Yes (per DFly2 paper )Yes (per DFly2 paper )
τ, DeepSeek-V4.1-Flash, temp 04.123.813.65
End-to-end speedup, DeepSeek-V4.1-Flash2.97x2.80x2.82x
Own headline claim+81% throughput at 64K ( paper )60% to 85% faster per user vs MTP-1 on V4-Flash ( The Batch )Over 6x lossless acceleration ( paper )
LicenseAngelSpec License; Hy4 flash under Tencent Hy LicenseMIT ( The Batch )Not disclosed

How do you deploy DFly2?

DFly2 ships inside tencent/Hy4-flash, a 220B-total, roughly 12B-active MoE with 1M context. vLLM serves it with the dfly speculative method via vllm/vllm-openai:hy4-flash. SGLang uses the DFLY algorithm via lmsysorg/sglang:hy4-flash. In the vLLM recipe, DFly speculative decoding is on by default.

To train DFly2 for your own sparse model, use AngelSpec. Its quick start expects 1 node with 8 GPUs (4 inference, 4 training).

Key Takeaways

  • DFly2 reuses the target’s sparse KV cache and indexer picks: zero extra draft KV memory.
  • Up to 81% more throughput on DeepSeek-V4.1-Flash at 64K, at matched per-user speed.
  • Beats same-recipe DSpark by 10.0% to 31.5% on long-context and agentic acceptance.
  • Smallest win: 3.9% on Hy4 flash general tasks.
  • Ships in Hy4 flash on vLLM and SGLang; train your own with AngelSpec.

Check out the the paper, grab the code, and get Hy4 flash weights. You can check the deployment options and specs here through our GPULeaderboard.com chrome extension.

Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.

Need to partner with us for promoting your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar etc.? Connect with us

Asif Razzaq is the CEO of Marktechpost AI Media Inc.. As a visionary entrepreneur and engineer, Asif is committed to harnessing the potential of Artificial Intelligence for social good. His most recent endeavor is the launch of an Artificial Intelligence Media Platform, Marktechpost, which stands out for its in-depth coverage of machine learning and deep learning news that is both technically sound and easily understandable by a wide audience. The platform boasts of over 2 million monthly views, illustrating its popularity among audiences.

  • Asif Razzaqnexos.ai AI Adoption Platform puts 200+ models behind one AI Gateway, with budget limits and governance built in
  • Asif RazzaqByteDance Researchers Open-Sources Laminar, an Async Reinforcement Learning RL Post-Training Framework
  • Asif RazzaqOpenAI and Cisco Releases Shirudo: An Open-Source Linux Runtime Allowing Agents to Defend Systems Without Downtime
  • Asif RazzaqAnthropic Launches Claude Ship for GitHub Pull Request Review and Fixes

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by MarkTechPost
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗