arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.11425cs.AI
收藏

Agent-R:通过迭代自训练训练语言模型智能体进行反思

Agent-R: Training Language Model Agents to Reflect via Iterative Self-Training

Fudan University(复旦大学);ByteDance Seed(抖音集团种子研发部门)

Siyu Yuan, Zehui Chen, Zhiheng Xi, Junjie Ye, Zhengyin Du, Jiecao Chen

AI总结:

针对现有LLM智能体难从错误中恢复、步骤级批评数据获取成本高的问题,提出迭代自训练框架Agent-R,通过MCTS和模型引导的批评构建机制实现及时反思纠错,在三个交互环境中性能较基线提升5.59%。

摘要:

大语言模型(LLMs)智能体在交互式环境中处理复杂任务的作用日益关键。现有研究主要通过从更强的专家处进行行为克隆来提升性能,但这类方法在实际应用中常表现不佳,主要原因是无法从错误中恢复。然而,步骤级的批评数据收集难度大、成本高。因此,自动化且动态地构建自我批评数据集,对于赋予模型智能体能力至关重要。\n在本研究中,我们提出了一种迭代自训练框架Agent-R,它能够让语言智能体在运行过程中进行反思。与传统方法基于动作的正确性给予奖励或惩罚不同,Agent-R利用蒙特卡洛树搜索(MCTS)构建训练数据,从错误轨迹中恢复出正确轨迹。智能体反思的一个关键挑战在于需要及时修正,而非等到推演结束。为解决这一问题,我们提出了一种模型引导的批评构建机制:行动者模型在失败轨迹中识别出(在其当前能力范围内的)第一个错误步骤。从该步骤开始,我们将其与树中共享同一父节点的相邻正确路径拼接。这一策略使模型能够基于其当前策略学习反思,从而获得更高的学习效率。\n为进一步探索这种自我改进范式的可扩展性,我们研究了纠错能力与数据集构建的迭代优化。研究结果表明,Agent-R持续提升了模型的错误恢复能力,并实现了及时纠错。在三个交互式环境上的实验显示,Agent-R能有效让智能体纠正错误动作同时避免循环,相比基线方法取得了更优的性能(提升5.59%)。

英文摘要:

Large Language Models (LLMs) agents are increasingly pivotal for addressing complex tasks in interactive environments. Existing work mainly focuses on enhancing performance through behavior cloning from stronger experts, yet such approaches often falter in real-world applications, mainly due to the inability to recover from errors. However, step-level critique data is difficult and expensive to collect. Automating and dynamically constructing self-critique datasets is thus crucial to empowering models with intelligent agent capabilities. In this work, we propose an iterative self-training framework, Agent-R, that enables language Agent to Reflect on the fly. Unlike traditional methods that reward or penalize actions based on correctness, Agent-R leverages MCTS to construct training data that recover correct trajectories from erroneous ones. A key challenge of agent reflection lies in the necessity for timely revision rather than waiting until the end of a rollout. To address this, we introduce a model-guided critique construction mechanism: the actor model identifies the first error step (within its current capability) in a failed trajectory. Starting from it, we splice it with the adjacent correct path, which shares the same parent node in the tree. This strategy enables the model to learn reflection based on its current policy, therefore yielding better learning efficiency. To further explore the scalability of this self-improvement paradigm, we investigate iterative refinement of both error correction capabilities and dataset construction. Our findings demonstrate that Agent-R continuously improves the model's ability to recover from errors and enables timely error correction. Experiments on three interactive environments show that Agent-R effectively equips agents to correct erroneous actions while avoiding loops, achieving superior performance compared to baseline methods (+5.59%).

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑