r/machinelearningnews • • 5d ago

Research Tencent open-sources DFly2, a speculative decoder that reuses the target model's sparse KV cache (+81% throughput at 64K on DeepSeek-V4.1-Flash)

Post image

Tencent released DFly2, a block-parallel speculative decoding drafter for natively sparse LLMs (DeepSeek-V4.1-Flash, GLM-5.3-Flash, Hy4 flash). Instead of keeping its own KV cache, each draft layer reads the KV cache of a paired target sparse layer and attends only to the positions that layer's indexer already selected.

What it does

  • Pairs each draft layer with a target sparse attention layer and shares its latent KV plus top-k index selection
  • Adds no draft KV memory and does not take part in prefill
  • Each draft token reads at most about 2K keys, so drafting cost is roughly flat with context length
  • Block size 5 in the paper; verification by the target keeps output lossless

Key numbers (self-reported, baselines retrained by Tencent on the same recipe)

  • Avg accepted length, DeepSeek-V4.1-Flash, temp 0: DFly2 4.12, DSpark 3.81, DFlash 3.65
  • Acceptance margin over the stronger baseline: 3.9% to 10.5% general, 10.0% to 31.5% long-context/agentic
  • Throughput vs DSpark at matched per-user speed on DeepSeek-V4.1-Flash: +28% short text, +62% CodeSpan 64K, +81% SWE 64K (NVIDIA H20, vLLM)
  • End-to-end speedup at concurrency 1: 2.97x (DeepSeek-V4.1-Flash), 2.36x (GLM-5.3-Flash), 3.19x (Hy4 flash)

Full analysis: https://www.marktechpost.com/2026/11/26/tencent-dfly2-speculative-decoding-sparse-models/

Paper: arxiv.org/abs/2611.34776

Repo: github.com/Tencent/AngelSpec

Model: huggingface.co/tencent/Hy4-flash

145 Upvotes

11 comments sorted by

4

u/mr_AnybodyRealistic3 5d ago

Piggybacking on the target's own sparse index is such an obvious move in hindsight, zero extra KV cache is wild.

8

u/Relevant-Magic-Card 5d ago

the hype seems real. just did a quick test:

I tried DFly2 on Hy4 Flash NVFP4 with Basalt 0.5.7, an RTX PRO 5000 48 GB, and a 5060 Ti 16 GB in peer mode. Same prompts and settings, two runs each with drafting off and on:

  • Short chat: 62.6 → 95.8 tok/s (+53%)
  • Structured JSON: 64.6 → 177.5 tok/s (+175%)
  • Prose after a 64K prompt: 56.2 → 68.6 tok/s (+22%)

The JSON result is the cleanest. Every run generated exactly 6,461 tokens, and nearly every draft token was accepted. The 64K answers ended at different lengths, so I’d put less weight on that number. Prefill still took around 50 seconds.

This was a single-user Hy4 test. My DeepSeek 1017 IQ2 setup still uses DSpark. I’d be curious to see a DFly2 vs. DSpark comparison on the same DeepSeek quant once a local engine supports both.

2

u/Material-Database-24 5d ago

Umm.. what do I miss?

KV cache reuse by drafter won't add much speed but will lower memory needs? And it would need support from inference engine that it doesn't make own KV cache for the drafter? And the speed you see comes simply from it being exceptionally good drafter for those specific models?

2

u/twack3r 4d ago

It’s literally in the first few lines of the abstract:

To avoid the quadratic cost of dense attention over long contexts, models such as DeepSeek-V4 and Hy4 have turned natively sparse, and speculative decoding, which matters most where decoding is slowest, increasingly runs on them. Their drafters, however, still keep a context cache of their own, over the whole prompt or a sliding window. Beyond memory, such a cache costs prefill time, prefix-cache hits and decode concurrency. Drafters that read the target's cache avoid one of their own, but settle only which cache, not which positions, and still read everything or a recent window. Neither rule is made for the query at hand, and computing a selection per query in the drafter would cost more as the context grows. Yet a natively sparse target already picks positions for each query, over a cache it keeps anyway. Both of the drafter's choices are therefore already made, and paid for, by the target: its cache and its selection.

1

u/Material-Database-24 4d ago

That literally answers about 0 of my questions.

1

u/twack3r 4d ago

in that case it's a reading comprehension issue.

Good model no want big cost with many context need big kvcache. So good model use sparse attention and have small kvcache. Speculative decoder much faster than good model with sparse attention alone. But much fast decoder even bigger faster when not big cost with many context. Now speculative decoder can also use sparse attention like good model, and even better, doesn't need its own. It uses good model fast sparse attention's own kvcache.

1

u/Material-Database-24 4d ago

I think we both have same issue.

Does it speed up because it reuses main model kv cache, or reduces just memory use? Apparently your paste says it doesn't reuse main model kv cache, just has its own instead of simple context, but this doesn't quite align with the topic of OP that says target model kv cache reuse?

Doesn't it need support from inference engine, because it reuses main model kv cache? Not answered.

And is the speed addition only because it is tailor trained for these specific models? Not answered.

1

u/twack3r 4d ago

What exactly do you think the abstract is referring to when saying ‘… the drafter’s choices are therefore already made, and paid for, by the target: its cache and its selection’.

Memory and compute.

1

u/tomByrer 4d ago

Anyone get this working on Qwen Flash Next or Inkling 2 Mini?

1

u/Lower-Ad-6293 3d ago

Pretty nice sure but that line "baselines retrained by Tencent on the same recipe" bugs me. I wanna see independent runs against native MTP or EAGLE at least not just against DSpark and DFlash retrained by the authors