NgramRL 用 n-gram 投机解码加速 RL 后训练的 rollout 生成
NgramRL: Accelerating RL Post-Training for Structured Generation via Rollout-Aware N-gram Speculative Decoding
RL 训练里 rollout 生成最耗时,这篇论文把它提速到原来的近 2 倍,还不用额外模型,做训练的可以看看实现思路。
RL 后训练的成本主要由自回归 rollout 生成占据,可超过训练时间的 70%。论文提出 NgramRL,用同一 prompt 的近期 rollout 历史构建逐 prompt 的 n-gram 起草器,不需要辅助模型或常驻 GPU 状态,同时由目标模型验证保证 rollout 分布不变。论文还引入自适应 fan-out 预取器,在 Spider 数据集上对 Qwen3-8B 的覆盖率达 96.6%,rollout 吞吐相对同步版提升 1.38x。在暖缓存条件下,NgramRL 每次目标模型前向提交 3.60-7.77 个 token,比 SuffixDecoding 最高多 1.99x,比 prompt-lookup decoding 多 7.0x。
NgramRL: Accelerating RL Post-Training for Structured Generation via Rollout-Aware N-gram Speculative Decoding
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.