本文提出 SEM 强化学习框架,通过平衡数据集、结构化推理模板、GRPO 与搜索感知奖励,训练 LLM 判断何时检索,从而减少冗余搜索并保持或提升准确率。
摘要:
大语言模型(LLMs)的最新进展表明,它们不仅具备推理能力,还能够调用外部工具,尤其是搜索引擎。然而,教会模型判断何时应调用搜索、何时应依赖其内部知识,仍然是一项重大挑战。现有的强化学习方法往往导致冗余的搜索行为,从而造成效率低下和成本过高。本文提出 SEM,这是一种新颖的训练后强化学习框架,显式训练 LLMs 优化搜索使用。通过构建结合 MuSiQue 和 MMLU 的平衡数据集,我们创造了模型必须学会区分可直接回答的问题与需要外部检索的问题的场景。我们设计了结构化推理模板,并采用 Group Relative Policy Optimization(GRPO,组相对策略优化)对模型的搜索行为进行训练后优化。我们的奖励函数鼓励在不进行不必要搜索的情况下准确作答,同时在需要时促进有效检索。实验结果表明,我们的方法显著减少了冗余搜索操作,并在多个具有挑战性的基准上保持或提高了回答准确率。该框架提升了模型的推理效率,并扩展了其审慎利用外部知识的能力。
英文摘要:
Recent advancements in Large Language Models(LLMs) have demonstrated their capabilities not only in reasoning but also in invoking external tools, particularly search engines. However, teaching models to discern when to invoke search and when to rely on their internal knowledge remains a significant challenge. Existing reinforcement learning approaches often lead to redundant search behaviors, resulting in inefficiencies and over-cost. In this paper, we propose SEM, a novel post-training reinforcement learning framework that explicitly trains LLMs to optimize search usage. By constructing a balanced dataset combining MuSiQue and MMLU, we create scenarios where the model must learn to distinguish between questions it can answer directly and those requiring external retrieval. We design a structured reasoning template and employ Group Relative Policy Optimization(GRPO) to post-train the model's search behaviors. Our reward function encourages accurate answering without unnecessary search while promoting effective retrieval when needed. Experimental results demonstrate that our method significantly reduces redundant search operations while maintaining or improving answer accuracy across multiple challenging benchmarks. This framework advances the model's reasoning efficiency and extends its capability to judiciously leverage external knowledge.
ReSearch: Learning to Reason with Search for LLMs via Reinforcement Learning
Baichuan Inc.(北川公司);University of Chinese Academy of Sciences(中国科学院大学);Tongji University(同济大学);The University of Edinburgh(爱丁堡大学);Zhejiang University(浙江大学)
ReSearch 提出通过强化学习训练 LLMs 将搜索操作融入推理链,无需监督推理步骤,在 Qwen2.5 系列模型上训练后展现出跨基准的强泛化能力,并自然涌现反思与自我纠错能力。
Search-R1: Training LLMs to Reason and Leverage Search Engines with Reinforcement Learning
Department of Computer Science, University of Illinois at Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校计算机科学系);Center for Intelligent Information Retrieval, University of Massachusetts Amherst(马萨诸塞大学阿姆赫斯特分校智能信息检索中心);Google Cloud AI Research(谷歌云人工智能研究)
R-Search: Empowering LLM Reasoning with Search via Multi-Reward Reinforcement Learning
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络安全学院);Beijing Normal University(北京师范大学)
MARS$^2$: Scaling Multi-Agent Tree Search via Reinforcement Learning for Code Generation
Shanghai Artificial Intelligence Laboratory(上海人工智能实验室);Shanghai Innovation Institute(上海创新研究院);Harbin Institute of Technology(哈尔滨工业大学);Tsinghua University(清华大学)