Long-Context Speculative Decoding: Tencent Eliminates the Draft Model's KV Cache
Tencent Hunyuan AI Infra open-sources DFly2. Draft layers directly read the target model's sparse KV and top-k indices, with zero extra KV memory, and drafting cost stays flat at any context length. At 64K, DeepSeek-V4.1-Flash serving throughput improves by up to 81%, and Hy4 flash agentic tasks by up to 4.2x. Code, weights, and paper have all been released.
Tencent Hunyuan AI Infra team has open-sourced DFly2, releasing the code, weights, and technical report together. It is a speculative decoding drafter designed specifically for sparse attention models, and has been trained on DeepSeek-V4.1-Flash, GLM-5.3-Flash, and Tencent's own Hy4 flash.
First, some background. Large models generate token by token, and the slowness comes from serial execution. Speculative decoding lets a small draft model guess several tokens first, then the target model verifies them in one pass; if the guesses are correct, multiple forward passes are skipped. The problem arises in long contexts: if the draft model maintains its own KV cache, the longer the context, the more memory and compute overhead grows, eating into the speedup.
DFly2's approach is to have each draft layer directly read the target model's KV cache and top-k token selection, without requiring prefill. According to the project documentation, each draft token attends to at most about 2K keys, regardless of context length. The result is zero extra KV memory, and drafting cost stays flat at any context length. It also shares the KV of the target model's sparse attention layers and the indexer's top-k selection; from prefill to decode, only the last layer's hidden state is passed, making it suitable for disaggregated prefill and decode deployment.

The performance numbers can be viewed at two levels. Data given in Tencent's tweet: at 64K context, DFly2 improves DeepSeek-V4.1-Flash serving throughput by up to 81%. On Hy4 flash agentic tasks, it is up to 4.2x faster, about 30% faster than DSpark with the same recipe, and accepts 10.4% more draft tokens than open-source DSpark. In the project benchmark, across long-context and agentic sets on three target models, DFly2's average accepted length beats DFlash, DFlash†, and DSpark. In the speed table, Hy4 flash's average end-to-end speedup on agentic tasks is 1.67x, and the decoding phase is 3.41x. The 4.2x is an upper bound on specific tasks, not a guaranteed floor for all workloads.

The open-source release is more than an inference engine. AngelSpec is a torch-native training framework covering MTP and block-parallel speculative decoding. DFly2, DFly, DFlash, DFlare, Eagle3, DSpark, and MTP—seven draft architectures—are placed in one training pipeline, and switching architectures is just a configuration change. On the training side, it has TTT on-policy multi-depth rollout, long-context training up to 256k, support for MLA/DSA drafters, document-aware sequence packing, and online evaluation during training. The framework is based on TorchSpec, uses Mooncake for disaggregated hidden-state transfer, and runs inference and training on different GPU worker groups that scale independently.


Three DFly2 weights are released: Hy4-flash-DFly2-B6, DS-V4.1-Flash-DFly2-B6, and GLM-5.3-Flash-DFly2-B6. In addition to the dense drafter built into Hy4 flash, MoE drafters are also provided. To run it, the repository includes vLLM and SGLang backend configurations, with both a single-node Qwen3-8B example and a multi-node Hy4 example.
Links:
Code http://github.com/Tencent/AngelSpec
Weights http://huggingface.co/AngelSlim
Paper http://arxiv.org/abs/2611.34776
In the ledger of long-context inference, the draft model used to seem to carry its own cache: the longer the context, the heavier the luggage. DFly2 stores the luggage with the target model, pinning the cost at about 2K keys. Whether this direction can be reliably realized in real business workloads still depends on how each serving stack adapts. At least for now, the code and weights are out.
发布时间: 2026-11-27 15:34