ReAct

2 min read

ReAct (Yao et al., 2023) interleaves reasoning and acting, enabling LLMs to use external tools.

The loop:

  1. Thought — the model reasons about what to do next
  2. Action — the model calls a tool (search, calculator, API, code execution)
  3. Observation — the tool's output is appended to the context
  4. Repeat until the model has enough information to answer

Example:

Question: What is the population of the capital of France?
Thought: I need to find the capital of France, then look up its population.
Action: Search("capital of France")
Observation: Paris is the capital of France.
Thought: Now I need the population of Paris.
Action: Search("population of Paris")
Observation: The population of Paris is approximately 2.1 million.
Thought: I have the answer.
Answer: Approximately 2.1 million.

Why ReAct matters:

  • LLMs have stale knowledge, can't do math reliably, can't access real-time data
  • Tools extend capabilities: calculators, search engines, code interpreters, databases
  • The reasoning trace makes the process interpretable and debuggable
  • Foundation of modern AI agents (Claude, GPT with tools, etc.)

Relation to RL: ReAct is a policy over a hybrid action space (text generation + tool calls). The LLM-as-agent framing applies directly.

See also: Chain-of-Thought Prompting, LLMs as RL Agents, Test-Time Compute

Linked from