Tencent Open-Sources DFly2 Speculative Decoding on Sparse KV

Hamza KhaliqHamza Khaliq
16 views
Verified Primary SourcingEditorial PolicyCorrections PolicyMethodologyMasthead
Tencent Open-Sources DFly2 Speculative Decoding on Sparse KV
Editorial Desk Verified • Editorial Policy • Corrections Policy • Evaluation Methodology
30-Second Executive Verdict

Direct Answer: Tencent's Hunyuan AI Infrastructure group open-sourced DFly2 under the Apache-2.0 AngelSpec suite (arXiv:2611.34776), introducing a zero-KV-cache 0.85B block-parallel drafter that reuses target sparse-attention caches to deliver up to 3.19x single-stream speedups and 1.73x concurrency at 32K context.

  • →Zero-KV Drafter Architecture: A 0.85B-parameter 5-layer drafter omits its own KV cache entirely, borrowing target model sparse KV states and top-k indices (~2K keys/token) while skipping prefill.
  • →Supported Open Models: Ships production weights and AngelSpec kernels for DeepSeek-V4.1-Flash, GLM-5.3-Flash, Tencent Hy4, and Hy4-flash under Apache-2.0.
  • →Long-Context & Agentic Speedups: Boosts mean accepted length by 10.0% to 31.5% on long-context workloads and delivers +81% SWE 64K and +62% CodeSpan 64K throughput on DeepSeek-V4.1-Flash.
  • →Memory & Serving Gains: Keeps drafter KV memory flat across sequence length and unlocks 1.73x higher concurrency at 32K compared to speculative setups holding separate 3-layer caches.
DeepSeek Logo

DeepSeek

Supported Target Model

DeepSeek-V4.1-Flash is a primary verified target model accelerated by DFly2 up to 2.97x end-to-end speedup.

SHENZHEN, China — Tencent's Hunyuan AI Infrastructure team has open-sourced DFly2 inside its Apache-2.0 AngelSpec training and inference framework (technical report arXiv:2611.34776), solving a stubborn memory bottleneck blocking speculative decoding on modern sparse-attention Mixture-of-Experts models. By forcing a compact 0.85B-parameter drafter to reuse the frozen target model's sparse KV cache directly, DFly2 keeps serving memory flat while accelerating long-context coding and agentic reasoning on NVIDIA H20 clusters.

Traditional speculative drafters—such as DSpark and DFlash—maintain private multi-layer KV caches that expand linearly during 32K to 128K autonomous coding traces, eroding batch concurrency on memory-bound GPUs. Tencent's architecture eliminates that duplicate state cleanly and releases ready-to-serve drafter checkpoints on Hugging Face under AngelSlim for DeepSeek-V4.1-Flash, GLM-5.3-Flash, and Tencent Hy4 / Hy4-flash.

Drafter Parameters
0.85B (5 Layers)
Zero own KV cache stored
Hy4-flash Speedup
3.19x E2E
4.2x–4.55x peak decode
DeepSeek-V4.1 SWE 64K
+81% Tput
2.97x E2E (Mean len 4.12)
32K Batch Concurrency
1.73x Higher
vs. 3-layer separate KV
Tencent DFly2 architecture diagram illustrating Top-k Sparse KV share, Index Share, Gated Fusion, and Hidden-Correction across five transformer blocks
DFly2 system diagram showing zero-KV drafter block-parallel prediction reusing target DSA top-k sparse caches and last-layer hidden states. Source: Tencent/AngelSpec (Apache-2.0).

How Zero-KV Sparse Cache Reuse Eliminates Drafter Prefill

Instead of allocating independent attention projections and running a redundant prompt-prefill pass through the drafter, DFly2 hooks directly into target models equipped with DeepSeek Sparse Attention (DSA) or compatible top-k indexers. During drafting, DFly2 transfers just a single last-layer hidden state vector at the accepted token boundary, fuses it cleanly through a lightweight gated-fusion gate, and pulls the target's already-indexed sparse KV slices (~2,000 keys per drafted token) across five block-parallel transformer layers initialized from target model blocks.

An output-stage Hidden-Correction module aligns parallel draft logits cleanly against target residual distributions before verification, recovering multi-token draft accuracy even across complex multi-file diffs. Because the drafter never stores independent keys or values, skipping drafter prefill cuts prompt-processing overhead on ultra-long repositories while reserving almost all GPU HBM strictly for target KV batches—yielding 1.73x higher request concurrency at 32K context relative to separate 3-layer drafter caches. For inference clusters running multi-turn coding agents, higher effective batch concurrency lowers idle tensor-core stalls directly alongside faster per-token decode latency.

Target Model (H20 TP8, vLLM) Concurrency-1 E2E Speedup Mean Accepted Length / Gain Long-Context / Agentic Gain
Tencent Hy4-flash 3.19x (Peak 4.2x–4.55x) 3.66 short / 5.43 AgentLongBench 64K +68.5% acc. len & 4.20x speedup on AgentLongBench
DeepSeek-V4.1-Flash (T=0) 2.97x 4.12 (vs. DSpark 3.81, DFlash 3.65) +28% short, +62% CodeSpan 64K, +81% SWE 64K
GLM-5.3-Flash 2.36x +3.9%–10.5% general accepted len +10.0%–31.5% long-context & agentic accepted len

Verified Speedups on 64K Software Engineering Agents

Evaluations benchmarked on NVIDIA H20 TP8 clusters running vLLM confirm that DFly2's relative advantage widens sharply as context length grows. On standard short-text Temperature 0 prompts targeting DeepSeek-V4.1-Flash, DFly2 lifts mean accepted length to 4.12 tokens, edging past both DSpark (3.81) and DFlash (3.65) while adding 28% net throughput.

Shifting to multi-turn 64K agentic engineering traces unlocks substantially larger dividends. On DeepSeek-V4.1-Flash, DFly2 boosts serving throughput by +62% on CodeSpan 64K and +81% on SWE 64K, hitting 2.97x concurrency-1 end-to-end speedup. On Tencent's own Hy4-flash, DFly2 pushes concurrency-1 speedups to 3.19x overall, reaching 4.20x on AgentLongBench 64K and peaking between 4.2x and 4.55x decode acceleration.

Tencent/AngelSpec Repository & DFly2 Serving Workflow bash
# Clone Apache-2.0 AngelSpec suite for MTP & DFly2 block-parallel training/serving
git clone https://github.com/Tencent/AngelSpec.git
cd AngelSpec

# Download pre-trained DFly2 zero-KV drafter weights from Hugging Face:
# - AngelSlim/ (DeepSeek-V4.1-Flash, GLM-5.3-Flash, Tencent Hy4 / Hy4-flash)
# Technical Paper: arXiv:2611.34776 (vLLM sparse KV reuse runtime supported)

Deployment Trade-Offs for Serving Engineers

Because DFly2 relies directly on sparse-attention top-k KV indices (~2K keys per token), inference operators gain maximum benefit exclusively on compatible sparse-KV architectures such as DeepSeek-V4.1-Flash, GLM-5.3-Flash, and Hy4-family checkpoints rather than legacy dense-attention models lacking top-k indexers. Within supported stacks, however, eliminating drafter KV duplication solves one of the most expensive VRAM constraints limiting autonomous 64K–128K code-agent clusters, where conventional draft caches would otherwise force cluster operators to halve concurrent request limits whenever context lengths climb past 32K tokens.

Across GLM-5.3-Flash workloads specifically, DFly2 adds +3.9% to +10.5% in general mean accepted length and +10.0% to +31.5% on long-context and agentic evaluations while sustaining a 2.36x end-to-end speedup. Together, Apache-2.0 AngelSpec training pipelines and ready-to-run Hugging Face checkpoints give self-hosted inference teams a drop-in route to higher decoding efficiency without sacrificing lossless verification guarantees.

Production Benefits of Tencent DFly2

  • +Eliminates drafter KV cache memory completely, unlocking 1.73x concurrency at 32K over separate 3-layer drafters.
  • +Skips drafter prompt prefill by transferring only a single last-layer hidden vector per accepted boundary.
  • +Delivers +81% SWE 64K throughput on DeepSeek-V4.1-Flash and 3.19x E2E speedup on Tencent Hy4-flash.
  • +Open-sourced under Apache-2.0 in AngelSpec with production vLLM support and ready weights on Hugging Face.

Architectural Constraints to Consider

  • −Requires target models featuring compatible sparse-attention top-k KV indexers rather than universal dense KV models.
  • −Block-parallel hidden-correction requires paired target checkpoints rather than drop-in universal unaligned drafters.
  • −Published peak metrics (2.97x–3.19x) reflect concurrency-1 H20 TP8 benchmarks; heavy batching narrows relative gains.
  • −Still uses 0.85B active drafter weights across five transformer layers, adding modest compute overhead per draft step.
Primary Source & Documentation
Tencent / AngelSpec GitHub & arXiv:2611.34776

Inspect Apache-2.0 training scripts, DFly2 zero-KV kernels, and AngelSlim Hugging Face drafter checkpoints.

Explore GitHub Repo →

Frequently Asked Questions

How does Tencent DFly2 eliminate drafter KV cache overhead? +

DFly2 is a 0.85B-parameter, 5-layer block-parallel drafter with zero private KV cache; it reuses the paired target model's sparse KV cache and top-k sparse indices (~2K keys per token) and skips drafter prefill.

Which frontier models are supported by DFly2 out of the box? +

Tencent provides Apache-2.0 weights and AngelSpec tooling targeting DeepSeek-V4.1-Flash, GLM-5.3-Flash, Tencent Hy4, and Tencent Hy4-flash.

What real-world speedups does DFly2 achieve on long-context coding benchmarks? +

On NVIDIA H20 TP8 vLLM tests, DFly2 delivers 2.97x concurrency-1 speedup and +81% throughput on SWE 64K for DeepSeek-V4.1-Flash, and 3.19x E2E speedup (peaking at 4.2x–4.55x decode) on Hy4-flash.

What license governs Tencent's AngelSpec and DFly2 release? +

Both the AngelSpec framework on GitHub and the accompanying DFly2 tooling are open-sourced under the permissive Apache-2.0 license.

⚡ AI Central Intelligence

Explore AI Models & Autonomous Tools

Benchmark, compare, and discover verified tools powering the new wave of frontier reasoning and autonomous software engineering.

Hamza Khaliq

AUTHORED BY

Hamza Khaliq

Student, Author, Learner, Developer and Researcher

Covering the latest AI developments and industry news.

More news you might like

Alibaba Qwen 4 Launch: Release Date, 27B Weights & Specs [Guide]
Frontier Models & LLMsOpen-Source AI & Hardware
Nov 6, 2026•6 min read

Alibaba Qwen 4 Launch: Release Date, 27B Weights & Specs [Guide]

Alibaba's Qwen 4 model family is launching in mid-November 2026. Following the official 'The becoming begins' teaser, Alibaba confirmed open weights for Qwen4-27B alongside flagship cloud endpoints.

DeepSeek V5 & Huawei Ascend 950: Architecture & Specs
Frontier Models & LLMsOpen-Source AI & Hardware
Nov 5, 2026•6 min read

DeepSeek V5 & Huawei Ascend 950: Architecture & Specs

Supply-chain telemetry confirms DeepSeek V5 is architected around Huawei Ascend 950 silicon for a 2027 release, navigating domestic training clusters.

Vercel Open-Sources Agent Desktop: Accessibility Trees vs Vision
AI Agents & Autonomous Coding
Nov 2, 2026•6 min read

Vercel Open-Sources Agent Desktop: Accessibility Trees vs Vision

Vercel Labs has open-sourced agent-desktop, a high-speed Rust tool allowing autonomous AI agents to interact with desktop apps via OS accessibility trees instead of heavy vision screenshots.

Anthropic Cuts AMD GPU Migration to 3 Days With Agents
Frontier Models & LLMsOpen-Source AI & Hardware
Nov 11, 2026•6 min read

Anthropic Cuts AMD GPU Migration to 3 Days With Agents

Anthropic reveals it bypassed Nvidia's CUDA lock-in by deploying its own frontier AI models to write custom GPU kernels, reducing AMD chip migration from months to three days.