ReAct

ReAct (short for “reasoning and acting”) is a method, published in 2022, in which a language model alternates between writing out its reasoning and taking actions – such as searching the web or calling a tool – and then reads the results before continuing. The resulting “thought, action, observation” loop became a basic pattern of AI agents.

The method

Shunyu Yao of Princeton and colleagues at Princeton and Google Research presented ReAct in October 2022; it appeared at the ICLR conference in 2023. Chain-of-thought prompting let models reason but left them reliant on what they had memorized, while earlier agent methods acted without explaining themselves. ReAct combines the two: in a few examples in the prompt, the model sees how to write a thought (“I need to find out where X was born”), choose an action (search for X), receive an observation (the search result) and plan the next step.

Results

On question-answering and fact-checking tasks, letting the model look things up in Wikipedia reduced made-up facts compared with reasoning alone (see Hallucination and Grounding), although on the HotpotQA question set ReAct alone was slightly less accurate than chain of thought and the best results came from combining the two. In a text-based household game (ALFWorld) and a simulated online shop (WebShop), ReAct with one or two examples beat imitation and reinforcement learning methods trained on far more data by 34 and 10 percentage points in success rate. The visible reasoning also made it easier for humans to see and correct where the model went wrong.

Influence and limits

Frameworks such as LangChain made the loop a standard building block, and today’s tool use interfaces, coding agents and browser agents follow the same pattern, now trained into models rather than taught by examples in the prompt. Its weaknesses remain familiar: agents can get stuck repeating actions, errors compound over long tasks, and text returned by tools can carry hidden instructions (see Prompt Injection).

Why it matters

ReAct showed that interleaving reasoning with actions and their observed results makes language models more reliable on knowledge and interactive tasks, and many agent systems since build on that loop (see Scaffolding and Agentic AI).

Written with Claude, made by Anthropic, whose Claude models work in such reasoning-and-acting loops in Claude Code and other agent products; most of the authors worked at Google, an Anthropic investor and competitor, whose PaLM model was used in the main experiments.

Related

AI Agent · Tool Use · Chain of Thought · Tree of Thoughts · Scaffolding · Agentic AI · Prompt Injection

Sources: Shunyu Yao et al.: ReAct – Synergizing Reasoning and Acting in Language Models (arXiv) (2022) · Google Research: ReAct – Synergizing Reasoning and Acting in Language Models (November 8, 2022)

Leave a Reply

Your email address will not be published. Required fields are marked *