Tencent Holdings has officially announced the release of AngelSpec, an open-source, torch-native training framework designed specifically for the development of speculative-decoding draft models. As the computational demands of Large Language Models (LLMs) continue to escalate, the industry has pivoted toward speculative decoding as a primary method for accelerating inference without compromising the integrity of the output. However, the efficacy of this method has historically been limited by the use of "universal" draft models that struggle to maintain high acceptance rates across diverse task types. AngelSpec addresses this bottleneck by treating workload heterogeneity as a fundamental design constraint, offering a specialized suite of tools that optimize draft model structure, training data, and verification depth based on the specific nature of the input, whether it be creative dialogue, complex mathematics, or software engineering.
The Evolution of Speculative Decoding and the Challenge of Latency
To understand the significance of AngelSpec, one must look at the trajectory of LLM inference optimization over the last two years. Speculative decoding, first popularized in late 2022 and early 2023 through research by DeepMind and Google, is a "lossless" acceleration technique. It functions by using a smaller, computationally inexpensive "drafter" model to predict several subsequent tokens in a sequence. A larger, more powerful "target" model then verifies these predictions in a single forward pass. If the target model accepts the draft, multiple tokens are generated simultaneously; if not, the system reverts to standard autoregressive generation for the rejected portion.
While theoretically sound, the practical application of speculative decoding has faced a recurring obstacle: the "drafter" often lacks the nuance of the target model, leading to low acceptance rates. When a draft is rejected, the computational overhead of generating that draft becomes a net loss, potentially slowing down the system rather than accelerating it. Most existing frameworks have attempted to solve this by creating a single, balanced drafter. Tencent’s research indicates that this "one-size-fits-all" approach is inherently flawed because different AI tasks exhibit different levels of entropy and predictability.
A Strategic Pivot Toward Workload Heterogeneity
The core philosophy behind AngelSpec is the recognition that serving traffic in real-world environments is not a monolithic mixture. In high-entropy environments, such as open-ended creative writing or general conversation, the number of semantically valid continuations for any given prompt is vast. In these scenarios, long-range predictions are likely to be rejected by the target model because the "correct" path is subjective. Conversely, in low-entropy environments like mathematics and programming, the constraints of syntax and logic mean there is often only one or two correct next steps.
Tencent’s data shows that for conversational tasks, shorter, autoregressive Multi-Token Prediction (MTP) models are more efficient. For coding and reasoning, "block-parallel" drafting—where the model predicts a chunk of tokens at once—is superior because the predictable nature of the content allows for longer, successful "leaps" forward. AngelSpec provides two distinct paths to handle these differences: the MTP path for diverse conversation and the DFly path (an evolution of the DFlash family) for structured reasoning.
Technical Deep Dive: The MTP Path and Training-Time Testing
One of the most significant technical hurdles in training drafter models is the "train-inference mismatch." Standard MTP models are often trained to predict the next token based on ground-truth data, but during actual inference, they must predict tokens based on their own previous (and potentially erroneous) predictions. This leads to error accumulation, where the accuracy of the third or fourth predicted token in a draft sequence drops precipitously.
AngelSpec implements a "shared-parameter, multi-depth" scheme to mitigate this. Drawing inspiration from the "Training-Time Test" (TTT) principles seen in architectures like EAGLE-3, AngelSpec’s MTP block is autoregressively unrolled for several steps during training. Instead of receiving the perfect ground-truth token for every step, the model is fed its own most likely prediction from the previous step. This forces the drafter to learn how to recover from its own minor deviations, significantly boosting the acceptance rate of deeper token positions.
Furthermore, Tencent has opted to keep the target model’s backbone and language-model head completely frozen during this process. By detaching the MTP inputs from the backbone, the drafter improves its proposal distribution without interfering with the target model’s established logic. The use of "target-model rollout"—where the training data consists of responses generated by the target model itself rather than a static reference corpus—ensures that the drafter learns the exact "personality" and uncertainty patterns of the model it is meant to assist.

DFly: Advancing Block-Diffusion for Reasoning Tasks
For the more structured domains of mathematics and code, Tencent introduced DFly, a block-diffusion architecture that improves upon the existing DFlash model. DFly introduces two critical structural innovations:
- Hybrid Target-Conditioning Backbone: Previous models like DFlash typically used a single context feature derived from the target model’s hidden states. This limited the ability of different layers in the drafter to specialize. DFly employs a system where each draft layer receives its own unique "view" of the target model’s hierarchy. This is achieved through per-layer fusion weights applied as a residual refinement, allowing for more granular and accurate predictions without adding significant computational weight.
- Predecessor-Conditioned Autoregressive Head: A common failure in parallel drafting is "suffix decay," where the model predicts the end of a block accurately but fails to connect it logically to the beginning. DFly addresses this by adding a small, sequential head after the main parallel backbone. This head converts the independent predictions into a prefix-conditioned distribution, ensuring that every token in the draft block is logically consistent with the ones preceding it.
Empirical Performance and Benchmarking
The performance gains reported by Tencent during the AngelSpec rollout are substantial. When tested on the Qwen3-8B model, the DFly architecture achieved an average mean accepted length (MAL) of 5.41. This is a marked improvement over earlier methods like DFlash (4.57) and standard MTP (3.24). In practical terms, a MAL of 5.41 suggests that for every single forward pass of the expensive target model, more than five tokens are being generated on average, effectively quintupling the theoretical throughput in optimal conditions.
The results on the larger Hy3-A21B model were even more pronounced. DFly reached a MAL of 4.79, representing a 29.8% gain over DFlash and a nearly 60% gain over basic MTP. The specialized focus on data also paid dividends; by expanding the training set with 700,000 specialized prompts—including 500,000 from OpenCodeInstruct and 200,000 from Big-Math—Tencent was able to push the acceptance rate on the GSM8K math benchmark from 0.290 to 0.706 at the third draft position.
Infrastructure and Disaggregated Training
Beyond the architectural improvements, AngelSpec is notable for its underlying infrastructure. Built on the TorchSpec foundation, it utilizes a "disaggregated" training approach. In this setup, inference engines (running the frozen target model) and distributed training workers (training the drafter) are separated. They communicate via a Mooncake-backed RDMA (Remote Direct Memory Access) store.
This allows for high-speed streaming of hidden states directly from vLLM worker processes to the training nodes without the need to fork the engine or create massive, static datasets on disk. By using public vLLM APIs for hidden-state extraction, Tencent has made AngelSpec highly compatible with existing production environments. The framework currently treats vLLM as a first-class backend, with support for SGLang and Hugging Face Transformers available at the community tier.
Industry Implications and Future Outlook
The release of AngelSpec comes at a time when the "inference tax"—the high cost of running large models—is a primary concern for AI companies. By open-sourcing a framework that allows for the creation of highly efficient, task-specific drafters, Tencent is lowering the barrier to entry for high-performance AI serving.
Industry analysts suggest that this move could signal a shift away from the pursuit of a "master drafter" toward a more modular approach to AI infrastructure. If developers can easily swap drafters based on the incoming request type (e.g., using an MTP-drafter for a customer service bot but a DFly-drafter for an integrated development environment), the overall cost-to-serve for AI applications could drop significantly.
Furthermore, the decision to release the code under an open-source license on GitHub, alongside collections on Hugging Face and ModelScope, positions Tencent as a key contributor to the "plumbing" of the modern AI stack. As models continue to grow in size, the "draft-and-verify" paradigm remains one of the few viable paths to maintaining the real-time responsiveness that users expect from generative AI. AngelSpec provides the first comprehensive, torch-native toolkit to make that paradigm efficient across the entire spectrum of human knowledge and machine logic.
