Papers / LLMs
ReAct (2022)
ReAct: Synergizing Reasoning and Acting in Language Models
Prompt a language model to alternate thoughts with actions, read what each action returns, and keep going until the task is done.
Why it matters
The loop of thinking, calling a tool and reading the result is how almost every LLM agent still works, from search assistants to coding agents. Tool calling in today's model APIs is the same pattern built into the model.
- Year
- 2022
- Authors
- Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, Yuan Cao
- Venue
- ICLR 2023
- Data
- HotpotQA
The idea
Chain-of-thought reasons only from what the model already knows, so it can invent facts. ReAct lets the model write a thought, then an action, such as searching Wikipedia or looking up a word in a page, then reads the result as an observation and writes the next thought. A few hand-written examples of such thought–action–observation traces are enough to prompt the pattern.
The result
With PaLM-540B and a three-command Wikipedia tool, ReAct was more grounded than chain-of-thought on HotpotQA: 6% of its correct answers rested on hallucinated facts, against 14% for chain-of-thought, and combining the two gave the best exact match (35.1). In the ALFWorld text game and the WebShop shopping site, one or two examples beat imitation and reinforcement-learning agents trained on thousands of tasks, by 34 and 10 points of success rate.
The data
Builds on
- Chain of thought (2022): Show the model worked examples that reason step by step, and it starts reasoning step by step too.
Led to
- SWE-agent (2024): An agent that fixes GitHub issues by navigating, editing and testing a repository through commands designed for language models rather than people.
