ReAct: Synergizing Reasoning and Acting in Language Models
About
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 insights
What problem does ReAct solve?
ReAct interleaves reasoning traces with task-specific actions in large language models, so internal reasoning guides external tool use and retrieved observations ground subsequent reasoning, reducing hallucination versus reasoning alone.
How does ReAct differ from prior approaches?
Unlike chain-of-thought (reasoning only) or action-only methods, ReAct combines both. On ALFWorld it reached 71% success versus BUTLER's 37%; on WebShop it achieved 40% success rate versus IL+RL's 28.7%, using only one-to-three prompt examples.
What are the practical benefits?
ReAct's interleaved traces let humans inspect and edit reasoning steps, enabling human-in-the-loop correction. It also retrieves up-to-date external knowledge, which helps answer questions whose dataset labels are outdated.
What limitations do the authors note?
ReAct's structured reasoning reduces flexibility, causing repetitive loops and reasoning errors. Prompting remains far below supervised baselines, and complex tasks with large action spaces exceed in-context learning length limits, motivating finetuning with more human annotations.