用模板引导强化学习,让大模型推理更高效稳定。
TemplateRL: Structured Template-Guided Reinforcement Learning for LLM Reasoning
- 用蒙特卡洛树搜索构建问题求解模板库,指导策略训练
- 在AIME上比GRPO提升99%,AMC上提升41%
- 模板可解释可编辑,支持训练和推理时动态更新
强化学习(RL)已成为提升模型推理能力的有效方法。然而,现有方法如GRPO通常依赖无结构的自我采样来拟合标量奖励,常导致低效的轨迹生成,难以捕捉可迁移的问题求解策略。为此,我们提出**TemplateRL**,一种结构化模板引导的强化学习框架,通过显式模板引导增强策略优化。首先,基于小规模种子集利用蒙特卡洛树搜索(MCTS)构建问题求解模板库,随后将这一高层结构化引导无缝融入强化学习训练中。通过引导轨迹生成与已验证模板结构对齐,TemplateRL显著提升高质量轨迹命中率,同时减少无效探索。该结构引导设计使策略朝向经过验证的战略模式演化,稳定训练动态并提升采样效率。值得注意的是,显式的模板库具备可解释性、可编辑性,并支持在线更新,可在训练和推理过程中持续迭代。大量实验表明,TemplateRL在AIME上相比GRPO提升99%,在AMC上提升41%,且在弱模型上表现更稳定,在跨领域任务中展现卓越泛化能力,凸显其在更广泛任务中的潜力。
原文摘要 · Abstract (English)
Reinforcement learning (RL) has emerged as an effective paradigm for enhancing model reasoning. However, existing RL methods like GRPO typically rely on unstructured self-sampling to fit scalar rewards, often producing inefficient rollouts that fail to capture transferable problem-solving strategies. To address this limitation, we propose **TemplateRL**, a structured template-guided RL framework that augments policy optimization with explicit template guidance. Our approach first constructs a problem-solving template library via MCTS on a small seed set, then seamlessly integrates this high-level structured guidance into RL training. By guiding rollout generation to align with proven template structures, TemplateRL significantly improves high-quality trajectory hit rates while reducing ineffective exploration. This structure-guided design steers the policy toward validated strategic patterns, stabilizing training dynamics, and enhancing RL sampling efficiency. Notably, the explicit template library is interpretable, editable, and supports online updates-enabling continuous updates during both training and inference. Extensive experiments demonstrate that TemplateRL outperforms GRPO by 99% on AIME and 41% on AMC, with superior stability on weak models and remarkable cross-domain generalization, highlighting its potential for broader tasks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。