让大模型分轮思考,突破上下文长度限制,提升解题准确率。
MOTIF: Modular Thinking via Reinforcement Fine-tuning in LLMs
- 通过强化学习训练模型分多轮生成推理步骤,突破上下文长度限制。
- 在MATH500和AIME2024上分别提升3.8%和3.3%准确率。
- 仅用15%样本即达效果,适合资源有限的模型优化场景。
大语言模型的推理能力近年显著提升,采用组相对策略优化(GRPO)进行强化学习训练可使模型使用更多推理令牌生成更优回答。然而,模型生成令牌数量受限于上下文长度,这成为其进行长序列推理的瓶颈。为突破此限制,模型需采用模块化思考策略,分多轮进行推理。本文提出MOTIF:一种基于强化微调的多轮模块化思考方法,有效扩展模型可用上下文。我们在GSM8K数据集上对开源模型Qwen2.5-3B-Instruct进行参数高效微调,并在MATH500和AIME2024基准上测试性能。实验显示,相比基线GRPO训练,准确率分别提升3.8%和3.3%。该改进仅需15%的训练样本,展现出良好样本效率。代码与模型已开源。
原文摘要 · Abstract (English)
Recent advancements in the reasoning capabilities of large language models (LLMs) show that employing group relative policy optimization (GRPO) algorithm for reinforcement learning (RL) training allows the models to use more thinking/reasoning tokens for generating better responses. However, LLMs can generate only a finite amount of tokens while maintaining attention to the previously generated tokens. This limit, also known as the context size of an LLM, is a bottleneck in LLM reasoning with arbitrarily large number of tokens. To think beyond the limit of context size, an LLM must employ a modular thinking strategy to reason over multiple rounds. In this work, we propose $\textbf{MOTIF: Modular Thinking via Reinforcement Finetuning}$ -- an RL training method for generating thinking tokens in multiple rounds, effectively allowing the model to think with additional context size. We trained the open-source model Qwen2.5-3B-Instruct on GSM8K dataset via parameter efficient fine-tuning and tested its accuracy on MATH500 and AIME2024 benchmarks. Our experiments show 3.8\% and 3.3\% improvements over vanilla GRPO based training in the respective benchmarks. Furthermore, this improvement was achieved with only 15\% of samples, thus demonstrating sample efficiency of MOTIF. Our code and models are available at https://github.com/purbeshmitra/MOTIF and https://huggingface.co/purbeshmitra/MOTIF, respectively.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。