ReAct

From llmref.wiki
ReAct — A prompting pattern that interleaves explicit reasoning traces with discrete tool actions and their observations to solve multi-step tasks.

Overview

ReAct (Reasoning + Acting) is a prompting and agent architecture in which a language model alternates between generating reasoning traces (Thought) and taking tool actions (Act), observing the result of each action (Obs), and repeating the cycle until it reaches an answer or completes a task. The pattern was introduced by Yao et al. (2022).[1]

ReAct extends Chain-of-thought prompting into agentic settings by grounding reasoning in real-world feedback from tool calls. Without the Act–Obs loop, chain-of-thought reasoning can hallucinate intermediate facts; ReAct replaces those speculative steps with actual observations from tools (search engines, code executors, APIs).

The ReAct loop

A ReAct trajectory for a factual query has the form:

Thought: I need to find the founding year of X.
Act: Search["X founding year"]
Obs: X was founded in 1984 according to its Wikipedia article.
Thought: I have the answer.
Act: Finish["1984"]

This Thought → Act → Obs → Thought cycle repeats until the task is resolved or a step limit is reached.

Distinction from related patterns

Pattern Key characteristic
Chain-of-thought Reasoning-only; no external tool calls; hallucination-prone on factual subtasks
ReAct Reasoning interleaved with tool calls; observations ground subsequent reasoning
Agentic workflow Broader term; ReAct is one implementation pattern within agentic workflows
Plan-and-Execute Separates planning (one pass) from execution (multiple tool calls); no interleaved re-reasoning

ReAct is not an architecture specification — it is a prompting pattern. In practice, modern agentic frameworks (LangChain, LangGraph, Anthropic tool-use) implement ReAct-style loops as default agent behavior, often without explicitly labeling it.

Limitations

  • ReAct agents can enter loops or fail to terminate if tool observations do not resolve uncertainty.
  • Long trajectories consume significant context window tokens.
  • The pattern requires reliable tool responses; noisy or wrong observations propagate into subsequent reasoning.

See also

References

  1. Yao, Shunyu et al. "ReAct: Synergizing Reasoning and Acting in Language Models." ICLR 2023. https://arxiv.org/abs/2210.03629