Accelerate RL rollouts by up to 50% with distribution-aware speculative decoding
Distribution-aware speculative decoding (DAS) speeds up the rollout phase of LLM RL post-training, which can consume ~70% of training time due to long-tail straggler generations, while keeping outputs identical to standard decoding. It combines a training-free suffix tree drafter built from a sliding window of recent rollouts with length-aware scheduling. The drafter adapts to the evolving policy by inserting newly verified tokens back into the tree. The scheduler interleaves long requests across GPUs and gives long requests aggressive speculation budgets from the start, medium requests moderate budgets, and short ones none. Reported results are over 50% rollout time reduction on math RL with DeepSeek-R1-Distill-Qwen-7B and ~25% on code RL with Qwen3-8B, with matching reward curves across 8k–16k sequence lengths and batch sizes of 16–32.
Related posts
- Achieve state-of-the-art inference latencies with speculative decoding
Modal hardMaster
Speculative decoding is the dominant lever for low-latency LLM serving because decode steps dominate latency and speculation yields multiplicative speedups roughly linear in acceptance length. Working with Decagon's voice agents, Modal combined regional serving, SGLang host-overhead fixes, and open-source kernels with DFlash draft models that reuse target-model KV projections and draft tokens in parallel. Fine-tuning ("mid-training") the speculator on synthetic data generated by the target model from public prompts in the task's output grammar avoids exposing user data. The custom speculator cut about 100ms from a ~290ms p50 baseline, roughly 40% of server-side decode latency, and beat proprietary providers by over 60ms. Out-of-distribution evaluation was used to guard against overfitting.
- Speculation Is All You Need
Modal hardMaster
Speculative decoding delivers integral-factor (2-3x+) LLM decode speedups, far beyond the few-percent gains from kernel or host-side optimization, and its benefit scales roughly linearly with acceptance length. Modal and Z Lab release DFlash speculators for several Qwen 3.5/3.6 models that add 5-20% over existing DFlash baselines, reaching over 1000 tok/s for Qwen 3.5 122B-A10B at concurrency 1 on a B200 node. Mocking acceptance in SGLang via SGLANG_SIMULATE_ACC_LEN shows Qwen 3.5 27B speeding up 5.62x at acceptance length 8, and a toy model plus a roofline model explain why speedup tracks acceptance length and where drafting overhead erodes it. Training custom speculators on application data is framed as easy-mode ML: fine-tuning has lifted acceptance length from 3 to over 9.
- Faster Assisted Generation with Dynamic Speculation
Hugging Face mediumAdeptDynamic speculative decoding stops the draft model's token generation as soon as its softmax confidence falls below a threshold (assistant_confidence_threshold), rather than always drafting a fixed or heuristically adjusted number of tokens before verification by the target model. An oracle analysis shows optimal speculation lookahead varies widely across iterations, so static values waste forward passes. On an RTX 4090 the dynamic schedule beat the heuristic in every tested model pair, reaching 2.71x on OPT-6.7B summarization and 1.52x for Llama-3.1-8B with Llama-3.2-1B where the heuristic gave no speedup. It is the default for assisted generation in Transformers 4.45.0 and can be tuned or reverted through generation_config parameters.
- Faster Text Generation with Self-Speculative Decoding
Hugging Face hardMasterSelf-speculative decoding from the LayerSkip paper drafts tokens by exiting early from a model's own intermediate layers and verifies them with the remaining layers. Because no separate draft model is needed, weights, KV cache and compute for the first layers can be shared. It only speeds things up on checkpoints trained with the LayerSkip recipe (layer dropout plus early-exit loss), and Hugging Face transformers exposes it through the `assistant_early_exit` argument to `generate()`. On A100 benchmarks it reaches up to about 1.8x over autoregressive decoding and beats two-model speculative decoding for most Llama sizes except Llama2 70B. The best exit layer is a per-model tradeoff between draft accuracy and drafting cost.
- Aurora
Together AI hardMasterAurora is an open-source framework that trains speculative decoding draft models online from live inference traces, framing drafting as asynchronous reinforcement learning: the drafter is the policy, the target verifier is the environment, and accepted and rejected tokens serve as positive and counterfactual rewards. An inference server built on SGLang or vLLM streams accepted and rejected tokens plus hidden states to a buffer. A separate training server updates a copy of the drafter using tree attention over speculative branches and hot-swaps the new weights in without interrupting serving. On shifting multi-domain traffic it recovers acceptance length within about 10k requests and adds a 1.25x speedup over a well-trained static EAGLE-3 speculator. Trained from scratch on mixed traffic, it reached an acceptance length of 3.08 versus 2.63 for the static baseline.