Recent months have seen the emergence of a powerful new trend in which large language models (LLMs) are augmented to become autonomous language agents capable of performing objective oriented multi-step tasks on their own, rather than merely responding to queries from human users. Most existing language agents, however, are not optimized using environment-specific rewards. Although some agents enable iterative refinement through verbal feedback, they do not reason and plan in ways that are compatible with gradient-based learning from rewards. This paper introduces a principled framework for reinforcing large language agents by learning a retrospective model, which automatically tunes the language agent prompts from environment feedback through policy gradient. Specifically, our proposed agent architecture learns from rewards across multiple environments and tasks, for fine-tuning a pre-trained language model which refines the language agent prompt by summarizing the root cause of prior failed attempts and proposing action plans. Experimental results on various tasks demonstrate that the language agents improve over time and that our approach considerably outperforms baselines that do not properly leverage gradients from the environment. This demonstrates that using policy gradient optimization to improve language agents, for which we believe our work is one of the first, seems promising and can be applied to optimize other models in the agent architecture to enhance agent performances over time.
翻译:摘要:近几个月来,一个强大的新趋势悄然兴起:大型语言模型被增强为自主语言智能体,能够独立执行面向目标的多步骤任务,而不仅仅是响应用户的查询。然而,现有的大多数语言智能体并未利用环境特定奖励进行优化。尽管某些智能体可通过语言反馈实现迭代改进,但其推理与规划方式无法兼容基于奖励的梯度学习方法。本文提出了一种基于原则的框架,通过训练回顾模型来强化大型语言智能体——该模型利用策略梯度从环境反馈中自动调整语言智能体的提示。具体而言,我们提出的智能体架构通过跨多个环境和任务学习奖励,微调预训练语言模型,该模型通过总结先前失败尝试的根本原因并提出行动计划来优化语言智能体提示。在多种任务上的实验结果表明,语言智能体性能随时间逐步提升,且我们的方法显著优于未合理利用环境梯度的基线模型。这证明使用策略梯度优化改进语言智能体(我们认为这是该领域的首批工作之一)具有广阔前景,并可推广至智能体架构中其他模型的优化,以持续提升智能体性能。