In one line: Interleaving free-form thoughts with environment actions in one prompted loop (PaLM-540B) beats acting-only everywhere and reasoning-only on FEVER (60.9 vs 56.3) but not HotpotQA (27.4 vs 29.4 EM), where switching to and from CoT-SC does best; ALFWorld 71% best of 6 prompts (57% on average) and WebShop +10 points of success over imitation and RL; the template most modern agent loops descend from.
How far to trust it: Believe the mechanism and the decision-making wins: the ALFWorld and WebShop gaps are three to six standard errors wide, from one or two exemplars. Treat the HotpotQA and FEVER orderings as inside the noise, and read ALFWorld's 71% as the best of six prompts picked on the test games (the average prompt scores 57%). The evidence, judged.
The idea in one sentence: let a few-shot-prompted language model write free-text thoughts between its tool actions, each thought appended to the context like an action that returns no observation; reasoning then plans the next action and the observations ground the reasoning, which cuts hallucination on question answering and lifts ALFWorld success from 45% (actions only) to 71% with one or two examples.
You need: few-shot prompting (GPT-3) and chain-of-thought. The agent loop as it is built today (native tool calls, stop conditions) is on Building a harness; multi-hop retrieval methods compared on Agentic retrieval; this page is the paper. New terms: thought (free text the model writes that does not touch the environment); Act (the ablation with thoughts deleted); dense and sparse thoughts (a thought before every action, or only where the model chooses); exact match (EM) (the answer string equals the label); CoT-SC (self-consistency: majority vote over sampled chains of thought); trajectory (one episode's full text).
Left: the whole method (§2): at each step the model writes either a thought, appended to its context with no feedback, or an action, which the environment answers with an observation. Right: the baselines are the same hand-written trajectories with thoughts, actions or both deleted, so each comparison isolates what was removed; the answers are those of Figure 1 on the Apple Remote question, the scores HotpotQA exact match from Table 1. Notice that ReAct is not the top scorer there (CoT is, within the noise); its clear wins are on FEVER and the decision tasks.
By late 2022 two lines of language model work had matured separately (§1).
The question: can free-form reasoning and environment actions be interleaved in one loop, each improving the other, with nothing but a few-shot prompt?
Take the usual agent setup. At step t the agent sees an observation ot and picks an action at from a policy π(at | ct), where the context ct = (o1, a1, …, ot−1, at−1, ot). Learning that policy is hard when the mapping from context to action is "highly implicit and requires extensive computation" (§2).
The model decides for itself when to think and when to act. The paper lists the kinds of thought it saw (§2):
The paper names the two directions of the synergy. Reason to act: thoughts create, maintain and adjust plans. Act to reason: actions bring outside information into the reasoning (§1). The stage beside this text is Figure 1's question, run four ways: Standard, CoT (reason only), Act (act only) and ReAct, one lane each, so you can watch where each one goes wrong. The Replay the traces tab steps through the same episode turn by turn with counters and the harness code, and has five more of the paper's episodes.
Figure 1 (1), transcribed; the right and wrong answers are the paper's. Each block is one entry of the trajectory, its height growing with the words as printed (observations cut with "..." where the paper cuts them); the glass tray under each lane is the context, growing as entries are appended. The exemplar stacks are the words of the paper's six HotpotQA prompts for each method, counted from Appendix C.1 by recompute.py. Words, not tokens.
Dense or sparse thoughts. On reasoning-heavy tasks every step is thought, action, observation ("dense" thought). On decision-making tasks a trajectory can run past 50 actions, and most steps need no deliberation. There the model places thoughts sparsely, where they help (§2).
All four come from the policy being one prompted language model (§2): easy to design (annotators type their thoughts on top of their actions; "No ad-hoc format choice, thought design, or example selection is used"), general (question answering, fact checking, a text game and web shopping with one recipe), performant and robust (one to six in-context examples, robust to which ones) and controllable (a person can read and edit a thought mid-run).
The loop is a few lines of code. The authors' released notebook generates "Thought i:" up to the next "Observation i:". It splits the text at "Action i:", runs the action against Wikipedia, appends all three to the prompt, and stops after a finish action or seven steps. When the split fails, it asks the model again for just the action and counts a "bad call" (hotpotqa.ipynb). Every agent framework since has wrapped that parse, act, append cycle (see Why it matters); how the loop is built now, with native tool calls instead of string splits, is on Building a harness.
Tasks. HotpotQA is multi-hop question answering over two or more Wikipedia passages. FEVER is fact verification: each claim is SUPPORTS, REFUTES or NOT ENOUGH INFO. Both run "question-only": the model gets no supporting paragraphs and must use its own knowledge or look things up (§3.1).
A deliberately weak tool. The Wikipedia API has three actions (§3.1):
search[entity] returns the first 5 sentences of the entity's page, or else the top-5 similar titles from Wikipedia search;lookup[string] returns the next sentence on the page that contains the string, like Ctrl+F;finish[answer] ends the task.The paper says this is "significantly weaker than state-of-the-art lexical or neural retrievers". The point is to imitate how a person browses and to force retrieval through explicit reasoning.
Prompts. The authors took 6 HotpotQA and 3 FEVER training questions at random and wrote ReAct trajectories for them by hand; more examples did not help (footnote 2).
Thoughts in them decompose the question ("I need to search x, find y, then find z"). They also extract facts ("x was started in 1844"), do commonsense or arithmetic ("1844 < 1989"), reformulate searches and synthesise the answer (§3.2, Appendix C).
Baselines by deletion. Every baseline prompt is the ReAct trajectories with parts removed, so a comparison isolates exactly what was deleted (§3.2):
Deleting text changes the prompt's length as well as its content. In words, the six ReAct exemplars run to , against for Standard, for CoT and for Act (counted from Appendix C.1).
Combining internal and external knowledge. ReAct turned out more factual, while CoT is better at structuring the reasoning but hallucinates. So the paper backs off from one to the other (§3.2):
More steps did not help: trajectories that needed exactly 7 or 5 steps were only 0.84% and 1.33% of the correct ones (footnote 3).
Fine-tuning. Writing reasoning traces by hand does not scale, so the paper bootstraps instead, as in STaR. It keeps 3,000 trajectories with correct answers generated by ReAct (and likewise by each baseline) and fine-tunes PaLM-8B and PaLM-62B on them.
Batch size is 64. ReAct and Act train for 4,000 steps; Standard and CoT for 2,000 (8B) or 1,000 (62B), because they "degrade soon after finetuning" (§3.2, Appendix B.1).
Every main result uses one frozen model, PaLM-540B, prompted. Appendix A.1 adds GPT-3 (text-davinci-002) runs (§2, Appendix A.1).
CoT, 29.4 exact match against 27.4 (Table 1). Grounding fixes hallucination but costs reasoning flexibility, and a weak search tool makes it worse.
ReAct beats Act on both tasks, 27.4 against 25.7 on HotpotQA and 60.9 against 58.9 on FEVER. That is the value of reasoning to guide acting, "especially for synthesizing the final answer" (§3.3). In Figure 1, Act found the right page and then answered "yes".
The failure analysis is the part most often cited. The authors sampled 50 correct and 50 incorrect trajectories from each of ReAct and CoT on HotpotQA, 200 in all, and labelled them by hand (Table 2, charted under Table 1):
ReAct plus CoT-SC is the best prompting method. On HotpotQA the best is ReAct → CoT-SC at 35.1; on FEVER, CoT-SC → ReAct at 64.6. Figure 2 plots both against the number of CoT-SC samples. The paper says the combinations beat CoT-SC at every sample count and reach CoT-SC's 21-sample score "using merely 3-5 samples" (§3.3, Figure 2). Recovered from the figure's vector paths, that holds at 5 samples on HotpotQA. On FEVER, CoT-SC → ReAct needs 7 (Figure 2 rebuilt).
All prompting stays far below fully supervised systems: 67.5 on HotpotQA and 89.5 on FEVER (Table 1). The authors read that gap as the case for fine-tuning.
Answer the question first. On FEVER, where claims can differ by a single detail, ReAct leads 60.9 to 56.3. Toggle the task:
Table 1, PaLM-540B. The whiskers are ±1 standard error assuming 500 questions: the paper never says how many questions Table 1 used, and the released code runs 500 random dev questions. At that size the ReAct and CoT gap on HotpotQA (2.0 points) is smaller than one standard error of the difference (); how such errors are computed in general is on Eval statistics (the central limit theorem gives the standard error).
ReAct, at about 5 exact match. A small model cannot learn to both reason and act from a handful of examples. Fine-tune it on 3,000 bootstrapped trajectories and it becomes the best of the four (the chart).
Fine-tuned, the ordering changes (Figure 3):
Note what "all 540B prompting methods" means. It is the four methods of Figure 3. The 62B fine-tuned ReAct's 32.7 does not beat 540B CoT-SC (33.4) or either combination (34.2 and 35.1) from Table 1.
Answer the question first, then toggle the panel.
Figure 3 rebuilt from the bar heights in the figure's vector graphics, measured against its own gridlines (to about 0.01 point). The paper prints no numbers for it. The 540B prompted bars match Table 1 to 0.05; no 540B model was fine-tuned.
ALFWorld is a text game aligned with the embodied ALFRED benchmark: 6 task types (pick, clean, heat, cool, look, pick two), goals such as "examine paper under desklamp", games with more than 50 locations that take an expert more than 50 steps, and a premium on knowing where household objects usually are (§4). Here thoughts are sparse: the model writes one only where it needs to plan or track progress. Evaluation: the 134 unseen games, against BUTLER, which imitates 105 expert trajectories per task type.
The authors wrote three trajectories per task type with sparse thoughts (decompose the goal, track subgoals, pick the next one, reason about where things are); every ordered pair of two makes a prompt, so 6 prompts per type, and Act uses the same trajectories without thoughts. A GPT-2 fine-tuned on 3,553 games did much better than BUTLER but trained across task types, so it is left out (footnote 7, Micheli and Fleuret).
WebShop is a shopping site with 1.18M real Amazon products, scored on 500 test instructions by success rate (SR, the share of episodes whose bought product meets every wanted attribute). ReAct gets one exemplar; the baselines are trained by imitation learning (IL) and IL plus RL.
12k human instructions ("a nightstand with drawers ... nickel finish, and priced lower than $140"); besides success rate, "score" is the average share of wanted attributes the bought product covers. IL trains on 1,012 human trajectories and IL+RL on a further 10,587 instructions (§4, Yao et al. 2022).
Yes: the worst ReAct trial scored 48% and the best Act trial 45%.
Results. On ALFWorld the best ReAct trial reaches 71% against 45% for the best Act trial and 37% for BUTLER; without thoughts, Act fails to break goals into subgoals or loses track of the state (Table 3). On WebShop one-shot Act already matches IL and IL+RL (30.1% against 29.1% and 28.7% success) and ReAct reaches 40.0%, "an absolute 10% improvement over the previous best success rate" (40.0 − 29.1 = 10.9; Table 4), its thoughts bridging noisy observations and actions ("the item has options '39x18x18inch' and 'blue' and seems good to buy"). Human experts reach 59.6% by exploring more and reformulating queries (§4). The abstract's "34% and 10%" are these two gaps: 71 − 37 and about 10.9.
Is it the reasoning, or just more feedback? Inner Monologue's monologue only restates the state and what remains to do; the paper argues it "does not truly comprise of inner thoughts", credits IM as the first closed loop, and calls ReAct the first to combine reasoning and acting with a language model in one (§4, §5). The ablation re-annotates the same trajectories with dense IM-style thoughts limited to the current goal and subgoal (ReAct-IM, Appendix B.2). ReAct wins 71% to 53% (best trials), ahead on five of six task types; ReAct-IM misses when a subgoal is done, what comes next and where items are likely to be (§4).
Editing thoughts steers the agent. In Figure 5 a ReAct run fails after a hallucinated thought. A person deletes one sentence and adds a hint to another, and the same model succeeds. Editing two thoughts replaces typing tens of actions. Act and reinforcement-learned policies offer nothing like this, since there is no thought to edit and changing a few actions does not change the rest (Appendix A.3). Replay it in the replay tab.
Another model. GPT-3 (text-davinci-002, greedy) does better than PaLM-540B: 30.8 against 29.4 on a 500-question HotpotQA subset and 78.4% against 70.9% on ALFWorld with PaLM's best prompt set (Table 5), possibly thanks to instruction tuning.
Limits the authors state. Tasks with large action spaces need more demonstrations than fit in a prompt; more high-quality human annotation is "the desiderata", and multi-task training plus reinforcement learning the next step (§6). The ethics statement flags the risk of giving a model real actions; here nothing can really be bought or edited.
Answer the question first. ReAct's advantage held in all six controlled trials, a relative gain of 33% to 90%, averaging 62% (§4). Success over all 134 games:
Table 3, the "All" column, plus the worst ReAct trial from the text. Whiskers: ±1 binomial standard error over 134 games. "Best of 6" picks the best prompt after seeing the test results, so the average ReAct prompt (57%) is the fairer single number. Act's average is not reported.
What holds up.
What to discount.
recompute.py finds no count up to 60 that rounds to it).think: line.Verdict. Believe the mechanism and the decision-making results. Interleaved thoughts make an acting agent better, grounding cuts hallucination, and the ALFWorld and WebShop gains are several standard errors wide from one or two examples. Treat the knowledge-task orderings (ReAct against CoT, the combinations against CoT-SC) as suggestive, not shown. Read 71% as a best case: the typical prompt scores 57%.
The method itself is now standard, so instead of "What it takes to use this", the Then and now tab follows what replaced each part of the 2022 recipe.
It is the template of the modern agent loop. Thought, tool call, observation, appended to the context and repeated until a finish action. The two directions the paper named, reason to act and act to reason, are still how agent design is discussed. The loop as harnesses build it today is on Agentic harnesses (where the loop and tool calling came from) and Building a harness.
Each piece of the 2022 recipe was later replaced by training. The original was brittle. Actions were free text parsed with string splits, every task needed hand-written exemplars, it got stuck in the loops the paper documents, and the prompt carried hundreds of words of exemplars. Structured function calling removed the parsing, native tool-use training removed the exemplars, and reasoning models turned the thought channel into trained reasoning between tool calls: ReAct's dense-thought mode, learned end to end (dated detail below; the Then and now tab steps through one turn in each format). The paper anticipated this arc. Its fine-tuning section shows the format works far better trained than prompted, and its conclusion calls for multi-task training and reinforcement learning (§6).
It reframed retrieval. Classic RAG retrieves once and then reads. In ReAct the model decides what to retrieve next from what it has already seen: iterative, agentic retrieval, now the norm for multi-hop and deep-research work. ReAct against Self-Ask, IRCoT and the rest, measured on one question set, is on Agentic retrieval (retrieval as a tool the model calls).
Its evaluation style stuck. Hand-labelled taxonomies of success and failure (hallucination against reasoning error against bad search), and the trade-off between factuality and flexibility, remain the standard vocabulary for debugging agent trajectories; failure taxonomies for agents today are on Agent and trajectory evaluation.
Direct follow-ups: Reflexion (verbal self-reflection between attempts) and Tree of Thoughts (search over thoughts, same first author), both 2023.
The loop in frameworks and harnesses:
What replaced each part of the recipe:
Six episodes from the paper, stepped through turn by turn, each one under every method the paper ran on it. Nothing here is generated: every thought, action and observation is the paper's own text. Figures 1, 4 and 5 are transcribed by hand from the figure images; Table 10 and Appendix D.1 are cut from the paper's text by mk_traces.py. The counters show what each method puts into the model's context and who wrote it, and the code panel lights the line of the harness that runs at each step.
The replay on the right is a tool, not an animation: pick an episode and a method, then step, scrub or press play; it opens on the episode's last step, so the outcome, the verdict and the full context bar come first. The caption under it explains each step.
Try: on the Apple Remote question, step Act and ReAct side by side and see that both reach the right page, but only ReAct has a step in which to read it. On the keychain episode, compare the run as generated with the one where a person edited two thoughts. On FEVER, every method is wrong, in three different ways.
think[...], which the environment answers with "OK." (the released alfworld.ipynb; the paper's figures omit those replies).They are the paper's showcase examples, chosen by the authors to illustrate each behaviour, so they say nothing about how often each outcome happens; the rates are in Table 2 and the tables tab. Observations are truncated where the paper truncates them. One episode is a failure for every method (FEVER, from Appendix D.1, randomly selected by the authors) and one is a success that exact match scores as a failure (the Mystere hotel, Figure 4).
Every table that carries the argument, transcribed from the arXiv HTML (v3) with the printed precision, and the two plots rebuilt from the vector paths of the paper's own figure files. Every derived number (gaps, standard errors, sums, the figure values) is computed by recompute.py, which also checks the figures against the tables.
Table 1. Standard error of a gap: √(p1(1−p1)/n + p2(1−p2)/n) with n = 500, an assumption: the paper gives no question count for Table 1; the released code runs 500 random dev questions for its GPT-3 numbers (out of 7,405 HotpotQA dev questions). Independent samples are conservative for methods run on the same questions; a paired test needs per-question results, which are not published. Wang et al. (2022b) report 27.1, 28.9 and 33.8 for Standard, CoT and CoT-SC on HotpotQA (the table's footnote 4).
Table 1 (main text), Table 5 (Appendix A.1, "a subset of 500 validation questions") and the code README ("PaLM-540B (paper)", 500 random dev examples) give different ReAct numbers for the same model. The likeliest reading is different question subsets; the paper does not say. This page uses Table 1 throughout, as the paper's own text does.
Figure 2, rebuilt: recompute.py reads each line's vertices from the figure's SVG (the arXiv HTML's cots_scale.svg and fever_cots_scale.svg) and converts them with the figure's own gridlines and printed tick values, to about 0.01 point; nothing is read by eye. The HotpotQA panel has no legend; its colours are the FEVER panel's. Samples were plotted at 1, 3, 5, ..., 21.
Two things the figure shows that the text does not say. At one sample, CoT-SC → ReAct on HotpotQA starts at CoT-SC's value (25.1), as the back-off rule implies (one sample is always a majority), while on FEVER it starts at ReAct's (60.9): the rule seems to have been applied differently on the two tasks. And on FEVER the dashed CoT line sits at 59.3 and CoT-SC ends at 61.0, where Table 1 prints 56.3 and 60.4.
Table 2: 50 correct and 50 incorrect trajectories from each method, 200 in all, labelled by hand (§3.3). Click a row for its example from Appendix E.1 (search results and non-representative steps omitted there, as here).
Figure 3, rebuilt from the bar heights in hotpot_finetune.svg against its gridlines (values to about 0.01 point; the paper prints none). Fine-tuning used 3,000 bootstrapped trajectories per method; no 540B model was fine-tuned.
Table 3: 134 unseen games; six prompts per method (avg and best of 6), BUTLER best of 8 from its own paper with beam search, everything else greedy. Each per-task "best" cell is the best prompt for that task alone, so a row's task cells average above its "All" (); compare methods on "All". Shading: success rate.
Table 4; IL and IL+RL taken from Yao et al. 2022. Score: average share of the instruction's attributes the bought product covers; success: all of them. Whiskers on success rate: ±1 binomial standard error over 500 instructions (about 2.2 points near 40%).
The loop survived; almost everything around it was replaced. On the right, one step of the paper's own Apple Remote episode (Thought 2, Act 2, Obs 2 of Figure 1) is written the way each generation of agent stack would carry it, from the 2022 prompt to a 2025 reasoning model thinking between tool calls. Step through it: what changes is who writes the thought, how the action reaches the tool, who parses it, and how the behaviour was learned.
| Part of the 2022 recipe | What replaced it | Source |
|---|---|---|
| Actions as free text, split on "Action i:" and parsed with string rules | Schema-constrained function or tool calls the model is trained to emit as JSON | OpenAI, June 2023 |
| Six hand-written exemplar trajectories per task | Tool descriptions in the request; tool use trained into the model | Toolformer; LangChain zero-shot agent |
| Thoughts imitated from human annotations | Reasoning tokens trained by reinforcement learning, emitted between tool calls | DeepSeek-R1; Claude 4; o3 |
| One attempt, no memory of failures | Reflection between attempts; persistent memory and context management in harnesses | Reflexion; Claude Code |
| A seven-step cap and a back-off to CoT-SC | Long-horizon loops that run until the model stops calling tools | OpenAI Agents SDK |
| Survived: the loop itself (reason, act, observe, append, repeat), the finish action, thoughts visible to the next step, a human able to read and steer them | Every harness above | Building effective agents |
Every link opens in a new tab. Reading time of the resources below: 3h 15m.
ICLR 2023, the paper itself; the HTML version has the anchors this page links to. abstract page, PDF.
(45 min)
the authors' GPT-3 prompting code (MIT licence): one notebook per task, the Wikipedia environment (wikienv.py) and every prompt. PaLM, the model behind the main results, was never released, so the repository reruns the method on text-davinci-002, which OpenAI shut down on 4 January 2024 (its deprecations page), so the notebooks need a current model swapped in. The project page, react-lm.github.io, links it. About 20 minutes for the README and the HotpotQA notebook.
(20 min)
Google Research blog (the authors), November 2022: the authors' own short-form summary with the key figures.
(10 min)
react-lm.github.io: the authors' page: abstract, the figures and links to the code and prompts.
(10 min)
DAIR.AI Prompt Engineering Guide: a concise walkthrough of the prompt format with worked HotpotQA examples and a LangChain reproduction.
(15 min)
Simon Willison, TIL, March 2023: the whole agent loop from scratch in about 40 lines; the fastest way to see that ReAct is just a parse, act, append loop around a prompt.
(10 min)
Lilian Weng, June 2023: places ReAct within the 2023 agent design space (planning, memory, tool use) alongside Reflexion and friends.
(45 min)
OpenReview: the reviewers' questions and the authors' replies; useful beside this page's evidence section.
(20 min)
Anthropic, December 2024: what the loop became: "LLMs using tools based on environmental feedback in a loop", and when a fixed workflow is the better choice.
(20 min)
2020-05: the few-shot in-context learning paradigm that ReAct pushes to interactive tasks; ReAct's released code runs on a GPT-3 model.
2020-05: fixed retrieve-then-generate; ReAct is the model-directed, iterative alternative that agentic RAG descends from.
2022-03: the RLHF machinery that later trained tool use into models natively, replacing ReAct-style prompting.
2025-01: reasoning tokens trained by reinforcement learning; interleaved thinking and tool calls are the trained descendant of ReAct's thought channel.
the frameworks (LangChain first) that turned this loop into a library.
the harnesses (Claude Code and the agent SDKs) whose inner loop is this one.
retrieval decided by the model step by step: agentic and iterative retrieval.
This page is one row of the Papers database; its properties (Paper, Takeaway, Topics, Year) live there.