Abstract
Adapting large language models (LLMs) via reinforcement learning (RL) is often bottlenecked by the generation stage, which can consume over 75% of the training time. Speculative decoding (SD) accelerates autoregressive generation in serving systems, but its behavior under RL training remains largely unexplored. We identify three critical gaps that hinder the naive integration of SD into RL systems: diminishing speedups at large batch sizes, drafter staleness under continual actor updates, and drafter-induced policy degradation. To address these gaps, we present ReSpec, a system that adapts SD to RL through three complementary mechanisms: dynamically tuning SD configurations, evolving the drafter via knowledge distillation, and weighting updates by rollout rewards. On Qwen models (3B--14B), ReSpec achieves up to 4.5x speedup while preserving reward convergence and training stability, providing a practical solution for efficient RL-based LLM adaptation.
Introduction
Reinforcement Learning (RL) for Large Language Models is notoriously slow, with text generation consuming up to 86% of training time. While Speculative Decoding (SD)—using a small "drafter" model to predict tokens and a large "target" model to verify them—is a standard optimization for inference, it often fails when directly applied to RL training loops.
The Challenges of SD in RL
The authors identify three "critical gaps" that break standard SD in RL:
- Diminishing Returns: At the start of a generation batch, GPUs are often fully utilized. Adding the overhead of a drafter model can actually slow down the system. As shown in throughput analysis, speedup ratios drop significantly as batch sizes increase.
- Drafter Staleness: In RL, the target model (the actor) is updated frequently. A static drafter quickly becomes "stale," losing its ability to predict the evolving actor's outputs.
- Policy Degradation: A misaligned drafter might propose sequences that are plausible but low-quality. If the actor accepts these, they enter the training buffer, creating a feedback loop that leads to "reward collapse."
ReSpec: An Optimized Workflow
ReSpec introduces a system architecture designed to handle the dynamic nature of RL through three core components:
Adaptive SD Server
Instead of always using SD, ReSpec employs a Solver and a Scheduler to monitor the "active batch size" in real-time. It utilizes standard decoding when the batch is large and GPU load is high, then automatically switches to aggressive speculative decoding as sequences finish and GPU headroom becomes available.
Online Learner and Reward-Weighted KD
To solve drafter staleness, ReSpec trains the drafter during the RL process using Reward-Weighted Knowledge Distillation (KD). By weighting the distillation loss with actual rewards from the RL environment, the drafter is incentivized to specifically mimic the actor's high-reward behaviors. This process leverages "free supervision" from the SD validation step, repurposing diagnostic signals that would otherwise be discarded.
Async Update Overlap
To ensure drafter training doesn't become a new bottleneck, ReSpec runs updates asynchronously, hiding the training time behind the actor's generation and inference phases.
Key Results
Evaluated on the Qwen-2.5 family (3B, 7B, and 14B) using math and code datasets, ReSpec demonstrates:
- Significant Speedups: A peak end-to-end training speedup of 4.53× for Qwen-3B and 1.5× to 1.78× for larger 14B models.
- Preserved Stability: Unlike naive SD, which causes rewards to collapse, ReSpec's reward curves closely track the baseline non-accelerated training.
- Efficiency: The Reward-Weighted KD is critical for stability, while the Adaptive Server provides an additional ~12% gain by optimizing GPU utilization during the "long-tail" of generation.
Conclusion and Future Work
ReSpec successfully integrates speculative decoding into RL pipelines, overcoming the hurdles of staleness and policy bias. While the system currently relies on offline profiling for its solver rules, future iterations aim to automate this into a zero-shot online profiler and explore compatibility with diverse drafter architectures like Medusa or Lookahead.
Summary updated