ReAct:在语言模型中协同推理与行动

ReAct: Synergizing Reasoning and Acting in Language Models

姚顺雨 Shunyu Yao · Princeton University / Google · 2022-10-06 · arXiv:2210.03629 ↗ · 被引 7645

打开互动全文版(逐段中英对照 + 图/公式 + 论文问答)→

摘要 · Abstract

虽然大型语言模型(LLM)在语言理解和交互式决策任务中展现了令人印象深刻的能力,但其推理(如思维链提示)和行动(如行动计划生成)能力主要被作为独立主题研究。在本文中,我们探索了以交错方式使用 LLM 生成推理轨迹和任务特定行动,从而允许两者之间更大的协同作用:推理轨迹帮助模型诱导、跟踪和更新行动计划以及处理异常,而行动则允许模型与外部来源(如知识库或环境)交互以收集额外信息。我们将我们的方法命名为 ReAct,并将其应用于多种语言和决策任务,证明了其相对于最先进基线的有效性,以及相对于没有推理或行动组件的方法,提高了人类可解释性和可信度。具体来说,在问答(HotpotQA)和事实验证(Fever)任务中,ReAct 通过与简单的 Wikipedia API 交互,克服了思维链推理中常见的幻觉和错误传播问题,并生成了比没有推理轨迹的基线更可解释的类人任务解决轨迹。在两个交互式决策基准(ALFWorld 和 WebShop)上,ReAct 仅通过一个或两个上下文示例进行提示,就分别以 34%和 10%的绝对成功率优于模仿学习和强化学习方法。项目网站及代码:https://react-lm.github.io

While large language models (LLMs) have demonstrated impressive capabilities across tasks in language understanding and interactive decision making, their abilities for reasoning (e.g. chain-of-thought prompting) and acting (e.g. action plan generation) have primarily been studied as separate topics. In this paper, we explore the use of LLMs to generate both reasoning traces and task-specific actions in an interleaved manner, allowing for greater synergy between the two: reasoning traces help the model induce, track, and update action plans as well as handle exceptions, while actions allow it to interface with external sources, such as knowledge bases or environments, to gather additional information. We apply our approach, named ReAct, to a diverse set of language and decision making tasks and demonstrate its effectiveness over state-of-the-art baselines, as well as improved human interpretability and trustworthiness over methods without reasoning or acting components. Concretely, on question answering (HotpotQA) and fact verification (Fever), ReAct overcomes issues of hallucination and error propagation prevalent in chain-of-thought reasoning by interacting with a simple Wikipedia API, and generates human-like task-solving trajectories that are more interpretable than baselines without reasoning traces. On two interactive decision making benchmarks (ALFWorld and WebShop), ReAct outperforms imitation and reinforcement learning methods by an absolute success rate of 34% and 10% respectively, while being prompted with only one or two in-context examples. Project site with code: https://react-lm.github.io

核心贡献 · Key contributions

局限 · Limitations

论文章节 · Sections(共 10)

阅读逐段中英对照全文 →