Citation and evidence

DFly2

Report a problem with this article

Edit article
More

Use this article

Raw MarkdownExplore connections

Improve this page

Revision historyDiscuss this article

Topics

AI InferenceAI ModelsModel Architecture

Cite this article

DFly2 is a speculative decoding method from Tencent for language models that use native sparse attention. Its draft network proposes several tokens per step using the target model's existing KV cache and the positions selected by the target's attention indexer. The target checks the proposed tokens. On November 26, 2026, Tencent published training code in AngelSpec and drafter checkpoints for DeepSeek V4.1-Flash, GLM-5.3-Flash, and Hy4 flash.[1][2]

How the drafter reads the context

Three DFly2 drafting layers reuse cached keys and values from paired target-model layers.
DFly2 pairs each draft layer with a target-model layer. It reuses the target's cache at positions selected by the target's attention indexer. [8]

A sparse attention indexer scores earlier positions and selects a limited subset for attention. In DFly2, each draft layer pairs with a sparse attention layer of the target. It reads that layer's cached representations at the positions selected during the preceding verification step. The same selection serves all draft positions within the block. The selected positions can be anywhere in the existing context, with a maximum count set by the target's attention design.[1]

DFly2 keeps no separate prompt KV cache and performs no draft computation during prefill, when the target processes the initial prompt. The target still performs prefill and retains its own cache. The drafter computes queries and projects the selected cached representations with its own learned weights. Sharing the cache therefore removes a source of memory growth while retaining computation and memory for the draft network itself.[1][2]

The released B6 drafters use a block of one anchor token and five proposed tokens. A parallel pass produces the draft positions. A sequential correction then conditions a position on the token drafted at the preceding position. The target's subsequent verification determines how much of the proposal can be used. The report's mean accepted length counts the tokens advanced per step, including the one supplied by the target.[1][3][4][5]

Differences between target models

Tencent's paper pairs three mixture-of-experts draft layers with three target layers. Its position counts include the six rows of the draft block. DeepSeek's separate cache for recent positions accounts for the additional 128-token window.[1]

TargetPaired target layersSparse index selectionAdditional recent positionsPosition budget per layer and step[1]
DeepSeek V4.1-Flash28, 32, 36512 positions128646
GLM-5.3-Flash35, 39, 43512 groups of four positionsCovered by sparse selection2,054
Hy4 flash33, 37, 412,048 positionsCovered by sparse selection2,054

Expanded article table

Training and release

Tencent initialized the drafter's attention weights and a subset of its feed-forward experts from the corresponding target layers. It trained the drafter to approximate the target's token distributions while keeping the target fixed. Training recomputed the sparse selections with copies of the target's indexers. In serving, the drafter receives selections from the target's verification pass.[1]

AngelSpec added DFly2 training for Hy4 flash in version 0.2.0 on November 18, 2026. Its release notes dated November 26 include the three separately distributed B6 checkpoints. The three cards label their drafter weights Apache 2.0. Each target model has its own terms. AngelSpec's code uses Apache 2.0 with separate license notices for the third-party components listed in the repository.[2][3][4][5][6]

Tencent documents prebuilt vLLM and SGLang images for serving Hy4 flash with its bundled drafter. The cards for the three separately released B6 checkpoints describe vLLM deployment support as in progress. The preprint's experiments used an implementation in vLLM.[1][3][4][5][7]

Reported performance

Tencent compared DFly2 with DFlash, a window-limited DFlash configuration, and DSpark. The authors retrained these baselines with the same data and number of training steps. They used NVIDIA H20 GPUs and five proposed tokens per block. Their single-request speedup measurements used greedy decoding and compared each drafter with ordinary autoregressive generation on the same target. End-to-end speedup includes prefill.[1]

TargetGeneral-purpose decode speedup[1]General-purpose end-to-end speedup[1]Agentic decode speedup[1]Agentic end-to-end speedup[1]
DeepSeek V4.1-Flash3.14x2.97x3.10x1.50x
GLM-5.3-Flash2.50x2.36x2.61x1.22x
Hy4 flash3.34x3.19x3.41x1.67x

Expanded article table

On the long-context group, which included tests at 32K, 64K and 128K context, mean decode speedups over the target models alone were 2.87x for DeepSeek V4.1-Flash, 2.45x for GLM-5.3-Flash and 3.06x for Hy4 flash. When the measurement included prefill, the respective mean speedups were 2.11x, 1.64x and 2.12x. These are the paper's single-request, greedy-decoding results.[1]

A separate concurrency sweep on DeepSeek V4.1-Flash measured service-wide throughput at matched per-user decode speed against Tencent's DSpark baseline. DFly2 delivered 28% higher throughput on short text, 62% on CodeSpan at 64K context, and 81% on a 64K-context subset of LongSWE-Bench. The short-text deployment used one prefill instance per decode instance. The two 64K deployments used eight, with up to 32 requests in the sweep.[1][3]

The paper also tested which parts of the design affected acceptance. For DeepSeek V4.1-Flash, removing access to the target's sparse selection and retaining its recent window lowered mean accepted length from 3.62 to 2.76 on the long-context group. These figures were averaged across the paper's four sampling settings. The design depends on the target exposing its cache and sparse selections to the drafter, and the three released checkpoints are matched to their respective target models.[1][3][4][5]

Continue reading

More to read

Topics:AI InferenceAI ModelsModel Architecture

References

  1. ^1 ^2 ^3 ^4 ^5 ^6 ^7 ^8 ^9 ^10 ^11 ^12 ^13 ^14 ^15 ^16Liu, Hong, et al. DFly2: Turbocharging Long-Context Speculative Decoding by Sharing the Target's Sparsity. arXiv:2611.34776, November 25, 2026. Sections 2 and 4-5, Tables 4 and 8-10, Figure 7.
  2. ^1 ^2 ^3Tencent Hunyuan AI Infra. AngelSpec repository and release notes. Entries dated November 18-26, 2026.
  3. ^1 ^2 ^3 ^4 ^5AngelSlim. DS-V4.1-Flash-DFly2-B6 model card. Hugging Face. License, deployment, and high-concurrency throughput sections.
  4. ^1 ^2 ^3 ^4AngelSlim. GLM-5.3-Flash-DFly2-B6 model card. Hugging Face. License and deployment sections.
  5. ^1 ^2 ^3 ^4AngelSlim. Hy4-flash-DFly2-B6 model card. Hugging Face. License and deployment sections.
  6. ^Tencent. AngelSpec license and third-party notices. GitHub.
  7. ^Tencent Hy Team. Hy4 flash inference framework instructions. GitHub.
  8. ^Hong Liu et al. Original image source. CC BY 4.0. Figure reproduced from the source paper. Original SVG rasterized as PNG on white.

Improve this article

Add missing citations, update stale details, or write a clearer explanation. Anyone can edit: changes go live when you publish, and every edit is checked by an editor.

3 revisions · v3 · 1,030 words · full history

Fact-checks are independent of edits: a reviewer re-verifies the article against its sources and stamps the date. How we verify

Research and drafting on this wiki are AI-assisted, under named human editorial standards. How AI is used here

Cite this page: AI Wiki. "DFly2." aiwiki.ai, updated 29 Nov 2026. CC BY 4.0. https://aiwiki.ai/wiki/dfly2

Edit article

What links here