NgramRL: Accelerating RL Post-Training for Structured Generation via Rollout-Aware N-gram Speculative Decoding
Organizations: University of California San Diego La Jolla, CA, USA · West Virginia University Morgantown, WV, USA
Abstract
Reinforcement learning (RL) post-training improves the reasoning capabilities of large language models, but its cost is dominated by autoregressive rollout generation, which can exceed 70% of training time. Existing speculative-decoding methods are poorly suited to this setting: model-based drafters consume scarce GPU memory and may become misaligned as the policy evolves, while existing model-free methods do not explicitly exploit repetition across training epochs. We observe that recent rollouts of the same prompt provide a high-quality, self-updating draft source. Based on this insight, we propose NgramRL, a per-prompt n-gram drafter constructed from bounded recent rollout history. NgramRL requires no auxiliary model, drafter training, or persistent GPU-resident drafter state, while target-model verification preserves the rollout distribution. To hide CPU cache lookup and scheduling, we further introduce an adaptive fan-out prefetcher that predicts likely verification outcomes (j, b), consisting of the accepted draft length j and target-emitted continuation token b. A causal budget allocator concentrates prefetches on high-probability outcomes, while uncovered outcomes fall back to sequential lookup without changing committed tokens. Across two model families and three reasoning and structured-generation workloads, NgramRL commits 3.60-7.77 tokens per target-model forward in the warm-cache regime, up to 1.99x more than SuffixDecoding and 7.0x more than prompt-lookup decoding. On Spider, the prefetcher covers 96.6% of Qwen3-8B outcomes at a candidate budget of 16 and improves measured rollout throughput by 1.38x over synchronous NgramRL, approaching its 1.40x overlap ceiling.
Figures & tables
| Method | GSM8K | Spider | CodeCont. |
|---|---|---|---|
| Qwen3-8B | |||
| PLD ( Saxena, 2023 ) | 1.31 / 1.31 | 1.10 / 1.11 | 1.28 / 1.30 |
| REST ( He et al., 2024 ) | 1.32 / 1.31 | 1.02 / 1.02 | 1.07 / 1.07 |
| SuffixDec. ( Oliaro et al., 2026 ) | 2.42 / 2.32 | 4.01 / 4.15 | 2.50 / 2.96 |
| NgramRL | 4.00 / 4.36 | 5.94 / 7.77 | 2.70 / 3.60 |
| DeepSeek-7B | |||
| Configuration | Cold epoch | Plateau |
|---|---|---|
| Ours, global bucket | 1.55 | 2.41 |
| Ours, per-prompt keys | 1.00 | 3.05 |
| SuffixDecoding ( Oliaro et al., 2026 ) | 1.90 | 2.43 |
| Accepted / step (cache MB) | ||||
| Task | ||||
| Qwen3-8B | ||||
| GSM8K | 1.87 (841) | 2.81 (1878) | 3.38 (3181) | 3.34 (3634) |
| Spider | 3.39 (236) | 5.13 (255) | 5.82 (309) | 5.82 (309) |
| CodeCont. | 1.72 (249) | 2.64 (591) | 2.89 (1742) | 2.91 (1744) |
| DeepSeek-7B | ||||
Speculative Decoding
Speculative decoding accelerates generation by drafting multiple tokens and verifying them in parallel with a larger target model.
See all 309 papers