Prompts Forms Resume Reports ★ Saved ★ Saved★ + Submit a tool
Techniques

ReAct Reasoning

About 3922 characters Updated Nov 30, 2026 22 views AI wiki

ReAct is a prompting and execution paradigm that lets a large model alternate between reasoning and acting, its full name being Reasoning and Acting. Proposed by Yao et al. in a 2022 paper, it weaves "thinking" and "doing" into a single trajectory and lets the model call external tools while reasoning; it is one of the most fundamental skeletons of agent architectures.

Core Principles

Traditional approaches fall into two kinds. One is pure chain of thought, where the model writes out the complete reasoning process at once and then gives the answer, closed-book throughout, unable to obtain external information and prone to going wrong all the way after a mid-course factual error. The other is pure action, where the model directly chooses tool calls, lacking explicit reasoning and planning, and easily gets lost on multi-step tasks.

ReAct combines the two in one alternating trajectory, typically in a three-part loop of Thought, Action and Observation. The model first writes its current thinking, stating which sub-problem to solve; then selects an action, such as searching, querying a database or calling a calculator; after execution the system writes the observation back into the context; the model continues thinking based on the new observation until it judges the information sufficient and outputs a Final Answer.

The key is that Observation is a real-world return, which constitutes a hard correction to the model's reasoning. If the model hallucinates a company name that does not exist, the search engine returns an empty result, and this empty result itself becomes a correction signal. At the same time, explicit Thought makes the decision process auditable, so when something goes wrong one can locate whether retrieval or reasoning was at fault.

A concrete example shows its value. The user asks "in what year was the founder of a certain company born": the model first thinks it needs to find out who the founder is, so it calls search and observes a person's name; then it thinks it still needs that person's birth year, calls search again and observes the year; finally it composes the answer. If the first search returns a result for a different person with the same name, the model observes the conflicting information in the next step and adjusts the query terms, and this self-correction is exactly what pure chain of thought cannot do.

The trajectory format also brings extra debugging convenience: every Thought is a readable record of a decision, and a failure case can be traced directly to a wrong tool choice at some step instead of facing an inexplicable block of output text.

The paper validated this structure on multi-hop question answering tasks such as HotpotQA, markedly reducing factual hallucination compared with pure chain of thought. Later paradigms such as Reflexion and Tree of Thoughts are built on ReAct's loop skeleton, only extending the feedback and search strategies.

Key Points

The action space must be small and clear. The more precise the tool descriptions, the lower the probability of choosing the wrong tool. Each tool should include its purpose, parameter format and a return example.

Set a maximum step limit. An unbounded loop burns a lot of tokens; usually 5 to 15 steps are set, forcing convergence to an answer when exceeded.

Observation results must be truncated. Stuffing a full web page back into the context quickly blows up the window; extract snippets by relevance and keep only the part related to the current sub-problem.

Failures must be passed back explicitly. Tool error messages should enter the Observation verbatim so the model can adjust parameters and retry itself, rather than being silently swallowed.

Thoughts need not all be exposed. Production environments usually show only a condensed summary, keeping the full trajectory in logs for debugging and evaluation.

Common Misconceptions

Treating ReAct as a universal solution and wrapping every task in a loop, so even simple question answering goes through three tool calls, doubling latency and cost. Another misconception is writing very long Thoughts with very little information, where the model consumes many tokens restating itself without advancing the task. Some ignore the quality of Observations, so retrieval returns a pile of irrelevant content and the model can only reason hard on top of it, effectively transferring hallucination from the model to retrieval.

Application Scenarios

Multi-hop question answering, queries needing real-time data, code debugging and execution, web information aggregation, natural language queries to databases, troubleshooting assistants, research material organization.