TL;DR
DLoop introduces a "looped" approach to speculative decoding, allowing a single, costly target-model verification pass to cover multiple lightweight drafting stages. By combining a confidence-gated inference loop with loop-aware training, DLoop achieves a 5% to 41% wall-clock speedup across various state-of-the-art draft models while maintaining perfectly lossless output.
What Problem Does This Paper Address?
Speculative decoding is a popular technique to speed up Large Language Model (LLM) inference. It uses a small "draft" model to propose a sequence of tokens, which a large "target" model then verifies in a single forward pass. Traditionally, this follows a strict alternating pattern: draft one block, verify one block.
The authors identify a major inefficiency: as draft models become more capable, they frequently produce blocks that are 100% accepted by the target model. In these cases, the target model's verification pass—which is the primary computational bottleneck—is performed prematurely. We could have kept drafting!
While "adaptive draft length" methods exist for autoregressive drafters, they struggle with parallel draft models (which produce blocks in one go). These models require target-model hidden states to start the next block. Without them, the draft model must rely on its own "hallucinated" hidden states, a scenario for which standard draft models are not trained.
Methods
DLoop proposes two main components to break the draft-verify-draft cycle:
- Confidence-Gated Drafting Loop: During inference, DLoop calculates a confidence score for each drafted block by summing the log probabilities of the tokens. If this score exceeds a threshold ($g$), the system skips verification and immediately performs another drafting stage. This continues until confidence drops or a maximum depth is reached.
- Loop-Aware Training: To ensure the draft model remains accurate when it lacks target-model hidden states, the authors introduce a new training scheme. The draft model is "unrolled" over multiple stages during training, forcing it to learn how to condition on its own previously predicted features. This prepares the model for the "hidden state gap" it encounters during the inference loop.
Crucially, DLoop remains lossless. The final verification pass uses the exact same acceptance logic as standard speculative decoding, ensuring the output distribution is identical to the target model.
Datasets
- Training: The authors used 1.3 million user prompts from the PerfectBlend dataset, paired with responses generated by various target models (Qwen3-4B, Qwen3-8B, Qwen3.5-9B, and Gemma-4-12B).
- Evaluation: Performance was measured across eight benchmarks in three categories:
- Math: GSM8K, MATH-500, AIME25.
- Code: HumanEval, MBPP, LiveCodeBench (LCB).
- Chat: MT-Bench, Alpaca.
Key Insights and Ideas
- Full Acceptance is Common: The authors found that for certain tasks, particularly math, draft models often achieve a "full acceptance" rate of nearly 60%. This suggests that the standard "verify every block" approach is leaving significant speed on the table.
- Trading Cheap Passes for Expensive Ones: DLoop effectively spends a few extra "cheap" draft model forward passes to eliminate "expensive" target model passes. Since target model latency grows slowly with the number of tokens verified, verifying 14 tokens at once is nearly as fast as verifying 7.
- Synergy with Tree Verification: DLoop is complementary to tree-based speculative decoding (like DARTree or DDTree). While trees broaden the search at a single position, DLoop extends the search further into the future.
Key Results
DLoop was tested on a wide variety of draft models, including EAGLE-3, DFlash, Domino, DSpark, and Multi-Token Prediction (MTP) modules.
- Speedup: Across all settings, DLoop improved wall-clock speedup by 5% to 41%.
- Acceptance Length: The average number of tokens accepted per verification pass ($\tau$) increased by 12% to 102%.
- Model Agnostic: The method works for both autoregressive drafters (like EAGLE-3) and parallel drafters (like DSpark), which were previously difficult to adaptively lengthen.
Limitations and Future Work
- Batching Overhead: The authors note that DLoop's gains are most significant at low-to-moderate concurrency. In high-load, batch-bound scenarios, the "ragged" execution (where different samples in a batch require different numbers of loops) can introduce scheduling overhead that diminishes the speedup.
- Hyperparameter Sensitivity: While the authors found a threshold of $g = -0.5$ worked well across most benchmarks, optimal performance might require per-model tuning.
- Future Directions: The authors suggest that future work could involve developing specialized kernels and serving optimizations to better handle the sample-dependent execution paths inherent in adaptive looping.
Summary updated