ReAct (2023) logo

ReAct (2023)

Free

Reasoning + Acting interleaved — foundation of agent prompt design

FreeFree tier
Type
Open Source

About ReAct (2023)

ReAct is a novel prompting paradigm for large language models that synergizes reasoning and acting in an interleaved manner. Unlike traditional chain-of-thought prompting which focuses solely on reasoning, or action plan generation which focuses solely on acting, ReAct generates both reasoning traces and task-specific actions together. This allows the model to induce, track, and update action plans, handle exceptions, and interface with external knowledge bases or environments to gather additional information. The approach has been shown to overcome hallucination and error propagation issues in chain-of-thought reasoning on question answering and fact verification tasks, and outperforms imitation and reinforcement learning methods on interactive decision-making benchmarks like ALFWorld and WebShop by significant margins.

Key Features

Interleaved generation of reasoning traces and task-specific actions
Reduces hallucination and error propagation compared to chain-of-thought
Enables interface with external sources (e.g., Wikipedia API) for information gathering
Produces human-like, interpretable task-solving trajectories
Achieves high performance with only one or two in-context examples
Demonstrated on diverse tasks: QA, fact verification, interactive decision making

Pros & Cons

Pros
  • Overcomes hallucination and error propagation prevalent in chain-of-thought reasoning
  • More interpretable than methods without reasoning traces
  • Outperforms imitation and reinforcement learning methods by 34% and 10% on ALFWorld and WebShop respectively
  • Requires only one or two in-context examples for prompting
  • Generates human-like task-solving trajectories
Cons
  • Requires access to external tools or APIs (e.g., Wikipedia) for full effectiveness
  • Performance may depend on underlying LLM's capabilities
  • Not a standalone product; requires implementation in a prompt engineering pipeline

Best For

Question answering with external knowledge retrievalFact verification with evidence gatheringInteractive decision making in simulated environments (e.g., ALFWorld, WebShop)Building interpretable AI agents that combine reasoning and external tool use

FAQ

What makes ReAct different from chain-of-thought prompting?
Chain-of-thought prompting generates reasoning traces without actions, while ReAct interleaves reasoning traces with task-specific actions, allowing the model to interact with external sources and update its plans dynamically.
On which benchmarks has ReAct been tested?
ReAct has been tested on HotpotQA (question answering), Fever (fact verification), ALFWorld (text-based game), and WebShop (online shopping simulation).
Does ReAct require fine-tuning?
No, ReAct is a prompting method that works with pre-trained large language models using only one or two in-context examples.
Is ReAct open source?
Yes, the paper's code is open source and available on the project site linked from the arXiv page.