Thinking is an action too — one that edits the agent, not the world.
By 2022, language models could do two impressive things in separate rooms. Prompted to reason (“let's think step by step”), they worked through problems — but with the book closed, free to invent facts no one could check. Prompted to act, they operated tools and browsed — but without an inner voice to plan, digest results, or notice they were stuck.
This paper's move is almost disappointingly small: put both in one text stream. Let the model alternate between thoughts and actions, where a thought is just an action that changes nothing in the world — it only writes a sentence into the model's own context, where the very next decision will read it. Reasoning steers the acting; what the acting fetches feeds the reasoning. The loop got a name, ReAct, and then it quietly became the default shape of an “AI agent”.
A thought changes nothing out there. It changes what the model sees when it decides what to do next.
One question, three failures
The quiz item the whole paper hangs on — and why half-solutions drop it
Step 1 · The question
Two hops of trivia — easy to state, hard to answer from memory.
Everything on this page revolves around a single quiz question. It comes from HotpotQA, a benchmark of questions that need two Wikipedia facts chained together, and it's the exact question the paper uses in its Figure 1. Try it yourself — no searching:
Feel what it asks of you. Hop one: which program was the Apple Remote originally built for? (Not obvious — it's a 2005 piece of Apple software.) Hop two: what else controls that program? Unless you were an Apple power user twenty years ago, your memory has the first fact at best, and the question is really about the second.
A language model prompted the ordinary way — question in, answer
out — is in the same spot, only more confident. The paper calls
this baseline Standard, and on this question it
replies: “iPod.” Wrong, instantly, with no visible working
to even argue with.
Question and the “iPod” failure: Figure 1(1a) of the paper. Ground truth: keyboard function keys. HotpotQA (Yang et al., 2018) is built so that single-fact recall isn't enough — every question needs a reasoning chain across two passages.
Step 2 · Two half-solutions
Thinking without looking invents facts; looking without thinking can't finish.
A plain prompt walked into our two-hop question and said “iPod”. The two obvious upgrades — let the model think first, or let it search — both existed by 2022, and on this same question both go down. Watch closely: they fail for opposite reasons.
Upgrade one is chain-of-thought (CoT): ask the model to reason in writing before answering. If you've read our GPT-2 page, this is prompting at its purest — no tools, just the model talking to itself. Here is its entire output on our question, from the paper's Figure 1, with the invented part underlined in dashes:
CoT — reason only · Figure 1(1b)
Thought: Let's think step by step. Apple Remote was originally designed to interact with Apple TV. Apple TV can be controlled by iPhone, iPad, and iPod Touch. So the answer is iPhone, iPad, and iPod Touch.
Answer: iPhone, iPad, iPod Touch ✗
Fluent, structured, wrong twice. The Apple Remote was built for Front Row, not Apple TV — but with no way to look, a plausible memory and a real one feel identical from the inside. The paper's word for this is hallucination.
Act-only — no thoughts · Figure 1(1c)
Act 1: Search[Apple Remote]
Obs 1: The Apple Remote is a remote control …
Act 2: Search[Front Row]
Obs 2: Could not find [Front Row]. Similar: …
Act 3: Search[Front Row (software)]
Obs 3: Front Row is a discontinued media center software …
Act 4: Finish[yes] ✗
Same model, now given a Wikipedia API but told to output only actions. It clicks through respectably — then answers a what-device question with “yes”. All the facts were on screen; nothing assembled them.
The paper's diagnosis of that last line (§2): choosing the final action requires reasoning over everything seen so far — question, three searches, three results — and an action-only format gives the model nowhere to do that reasoning. CoT had the reasoning and no facts; Act-only had the facts and no reasoning. Two half-agents, each missing exactly what the other has.
Grounding and reasoning were living in separate prompts. Nobody had let one model do both in the same trajectory, taking turns, each feeding the other — and checked whether that beats either alone.
Both transcripts: Figure 1 of the paper, lightly abbreviated where the paper itself uses “…”. CoT: Wei et al., 2022. The act-only agent resembles WebGPT in spirit but uses no reinforcement learning — just prompting.
Step 3 · Sit in the agent's seat
At the hard moment, what's missing isn't a better action — it's a sentence.
CoT invented facts because it couldn't look; Act-only looked but couldn't digest what came back. Before we show the fix, take the acting agent's seat at its most instructive moment — the search that fails.
You've searched Apple Remote and learned it was built
for something called Front Row. You search Front Row.
The environment replies:
Your move — what should the agent do next?
What ReAct wrote at this exact moment · Figure 1(1d)
Thought 3: Front Row is not found. I need to search Front Row (software).
Act 3: Search[Front Row (software)]
One plain sentence between observation and action: name what went wrong, name the recovery. That sentence is the whole invention.
If you picked the software page — notice what you did in your head first. Something like: “the exact title doesn't exist, but the suggestion list has a software entry, and Front Row is software.” You reasoned, silently, and then acted. The paper's entire proposal is to make that silent step a written step — because a language model can only reliably “think” in text it actually generates, and because text it generates can be read back, checked, and even corrected later.
To be fair to the act-only agent: on this particular fork it stumbled through by imitating patterns in its prompt. Where it actually died was the final answer, three observations later — the place where the most reasoning had piled up undone.
The three actions available here — search[entity], lookup[string], finish[answer] — are the paper's whole Wikipedia API (§3.1), deliberately weaker than a real retriever: it only returns the first 5 sentences of an exact-titled page, or suggestions. The point was to force reasoning to carry the load, the way a human uses wikipedia.org.
Thought as action
The loop in full, the baselines as deletions, and the one-line formalism
Step 4 · Read one full trajectory
Four rounds of think–act–observe solve what all three baselines dropped.
You just felt the missing ingredient: a written thought between observation and action. Here's what that looks like sustained for a whole task — the paper's Figure 1(1d), on our question, complete. Read it slowly; every later section refers back to these twelve lines.
Look at where the amber lines sit and what each one does. T1 plans before anything is searched. T2 pulls the one fact that matters out of O1 and turns it into the next goal. T3 is the recovery you authored in step 3. T4 does the thing Act-only never could: it reads O3 and assembles the final answer in words before committing to it. Four thoughts, four different jobs — and none of them touched the environment.
Nothing else changed. Same model, same Wikipedia API, same question. The only difference from the act-only transcript is the amber lines — and they turn a wrong “yes” into the exact right answer.
Figure 1(1d), verbatim except the paper's own “…” abbreviations. The thought-job labels in the margin are ours; the paper lists the same job types in §3.2: decompose questions, extract from observations, guide search reformulation, synthesize the final answer.
Step 5 · The mechanism, stated properly
A thought is an action whose only effect is a new line in the context.
Four thoughts, four actions, four observations — one solved question. Now the tidy part: every baseline that failed in step 2 is this same trajectory with something deleted, and seeing that makes the formal definition almost obvious.
Delete the thoughts → Act-only
Keeps hands, loses the inner voice. Died at the final synthesis.
Delete actions & observations → CoT
Keeps the voice, loses the world. Free to hallucinate, and did.
Delete everything → Standard
Question in, guess out. This is where we started.
This isn't just a nice picture — it's literally how the paper built its baselines (§3.2): take the hand-written ReAct trajectories and ablate parts out. So every comparison later on is controlled: same questions, same exemplars, pieces removed.
Now the definition. An agent normally picks actions from some set
A — search, click, move. ReAct enlarges the set:
 = A ∪ L
A = actions that touch the world · L = the space of language — “thoughts”
An action picked from L — a thought — has a property
that's easy to read past, and honestly we skimmed it on our first
read too, so slow down here: a thought gets no observation
back. The environment never learns it happened. Its entire
effect is cₜ₊₁ = (cₜ, âₜ) — the sentence is appended
to the context, and the policy π(aₜ | cₜ) that picks
every later move reads that context. The model is, quite literally,
leaving notes for its next step.
Deciding an action from a long messy context is hard to learn implicitly. A thought lets the model compute an intermediate result in the open — a plan, an extracted fact, a diagnosis — and hand it to its next step in the one medium it's fluent in: text.
§2 of the paper. Because L is unlimited, learning where to think would be hard from scratch — which is why the paper uses few-shot prompting with a frozen PaLM-540B: humans write a handful of example trajectories, and the format generalizes from as little as one example per task type.
Step 6 · Dense, sparse, and who writes the examples
The whole method fits in a handful of hand-written trajectories.
So a thought is an action that only writes to context. Two practical questions are left: how often should the model think, and where does it learn the format? The answers are “it depends” and “from you, in about an afternoon”.
For knowledge questions like ours, thoughts and actions alternate every step — the paper calls this dense reasoning. For long games with many mundane moves, thinking after every step would be noise; there, thoughts appear sparsely, only at decision points, and the model itself decides when. Here's a sparse one from the paper's household game (ALFWorld), where the task is “put some pepper shaker on a drawer”:
Sparse thoughts · ALFWorld · Figure 1(2b), abridged
Act 1: Think[First I need to find a pepper shaker… more likely to appear in cabinets (1–6), countertops (1–3), …]
Act 2: Go to cabinet 1 · Obs 2: On the cabinet 1, you see a vase 2.
(five quiet moves later)
Obs 6: On the countertop 3, you see a apple 1, a bread 1, … a pepper shaker 1, and a vase 3.
Act 7: Take pepper shaker 1 from countertop 3
Act 8: Think[Now I find a pepper shaker 1. Next, I need to put it in/on drawer 1.] … ✓
Two thoughts in an eleven-move game: one to plan the search, one to mark the subgoal switch. Between them, plain acting. The same commonsense that guessed “cabinets and countertops” is what the act-only version lacked — it wandered until it hallucinated taking a shaker from a sinkbasin that didn't hold one.
What a few-shot exemplar actually looks like · Appendix C, first rounds
Question: What is the elevation range for the area that the eastern sector of the Colorado orogeny extends into?
Thought 1: I need to search Colorado orogeny, find the area that the eastern sector of the Colorado orogeny extends into, then find the elevation range of the area.
Action 1: Search[Colorado orogeny]
Observation 1: The Colorado orogeny was an episode of mountain building (an orogeny) in Colorado and surrounding areas.
Thought 2: It does not mention the eastern sector. So I need to look up eastern sector. …
This is real prompt text from the paper's appendix. Six question-length examples like this are the entire “training” for HotpotQA; ALFWorld uses two per task type. No gradient ever moves.
The paper's authors “just type down their thoughts in language on top of their actions taken” (§2). That's the pitch: no format engineering, no reward function, no fine-tuning — annotate a few trajectories the way you'd explain your own screen-share.
Dense vs. sparse: §2. Prompt counts: 6 exemplars for HotpotQA, 3 for Fever (§3.2); 2 per task type for ALFWorld, 1 for WebShop (§4). The Think[…] syntax in ALFWorld is a thought dressed as an action — the game engine replies “OK.” and changes nothing.
The evidence — and its rough edges
Knowledge tasks · an honest failure breakdown · games · and editing an agent's mind
Step 7 · The knowledge-task scoreboard
ReAct alone isn't the winner — ReAct combined with CoT is.
The recipe is a handful of hand-written trajectories and a weak Wikipedia API. Time to grade it — and the scoreboard holds a surprise the abstract doesn't advertise.
Two benchmarks: our HotpotQA (exact-match on the answer), and Fever, where the model must call a claim SUPPORTED, REFUTED or unverifiable. One more baseline joins: CoT-SC, or self-consistency — run CoT 21 times at some randomness and take the majority answer, a standard way to squeeze more out of pure reasoning. All methods, one table:
| Prompting method | HotpotQA (EM) | Fever (Acc) |
|---|---|---|
| Standard | 28.7 | 57.1 |
| CoT — reason only | 29.4 | 56.3 |
| CoT-SC — 21 samples, majority | 33.4 | 60.4 |
| Act — act only | 25.7 | 58.9 |
| ReAct | 27.4 | 60.9 |
| CoT-SC → ReAct | 34.2 | 64.6 |
| ReAct → CoT-SC | 35.1 | 62.0 |
| Supervised, task-specific SoTA | 67.5 | 89.5 |
Read the middle rows first and let the awkward fact land: on HotpotQA, ReAct (27.4) loses to plain CoT (29.4). The search engine didn't pay for itself. We'll dissect why in the next step. But the two arrow rows win on both benchmarks — those are simple hand-offs: run ReAct, and if it can't finish within 7 steps, fall back to CoT-SC (and the reverse rule for the other row). The paper's reading: the model's internal knowledge and the retrieved external knowledge are complementary, and the win comes from using both.
The hand-off pays in efficiency too. Drag the sampling budget below — the paper's Figure 2 — and watch how many CoT-SC samples it takes to match what the combination gets almost immediately:
Drag the sampling budget n — how many CoT chains you pay for
Find where the cinnabar curve crosses the thin dashed gridline. That gridline is pure CoT-SC's final score with all 21 samples (33.4) — the combination reaches it around n = 3. The endpoints and the two dashed baselines are exact numbers from Table 1; the shape between anchor points is read off the paper's Figure 2 and drawn to trend, not to the decimal.
Table 1 and Figure 2, PaLM-540B. Hand-off rules (§3.2): ReAct→CoT-SC backs off when ReAct hasn't finished in 7 steps (5 for Fever); CoT-SC→ReAct backs off when fewer than half the 21 sampled answers agree. On Fever the winning order flips — claims there hinge on tiny differences, so up-to-date retrieval matters more (64.6).
Step 8 · What actually went wrong
Grounding kills hallucination completely — and costs some flexibility.
ReAct alone losing to CoT alone, on a knowledge benchmark, with a search engine in hand — if that surprised you, it surprised us too; it's worth slowing down for. The authors did the slow thing: they read 200 trajectories by hand and labeled what actually happened.
Fifty successes and fifty failures from each method, sorted into causes. This one table explains the whole trade-off:
| Failure / success mode | ReAct | CoT | |
|---|---|---|---|
| success | True positive — right answer, right reasons | 94% | 86% |
| success | False positive — right answer, hallucinated reasons | 6% | 14% |
| failure | Hallucination | 0% | 56% |
| failure | Reasoning error (incl. stuck in loops) | 47% | 16% |
| failure | Search returned nothing useful | 23% | — |
| failure | Label ambiguity (answer fine, grading strict) | 29% | 28% |
Read the two bold columns against each other. Among CoT's failures, over half are hallucination; among ReAct's, hallucination is zero — every fact in a ReAct trace came from an actual observation, which is also why even its successes are more trustworthy (6% vs 14% lucky guesses). That's the win.
The cost is the other bold cell. Being forced to alternate thought–action–observation is a straitjacket for reasoning: 47% of ReAct's failures are reasoning errors, including a signature one where the model repeats its previous thought and action forever, unable to jump out of the loop. And when search returns junk (23% of failures), the derailed reasoning struggles to recover. Grounding traded flexibility for factuality — which is exactly why step 7's hand-off strategies, using each method where it's strong, beat both.
Inspecting trajectories also caught the dataset being wrong: one question's official answer was years out of date, and only ReAct returned the current fact — a hotel that had grown to 3,104 rooms (2,884 rooms + 220 suites) since the label was written (Appendix, Figure 4). Grounded agents age better than frozen labels.
Table 2 of the paper: 50 correct + 50 incorrect trajectories per method, hand-labeled. “EM” grading is strict string match, hence the ~29% label-ambiguity bucket on both sides.
Step 9 · Where the world pushes back
In interactive environments, a few thoughts beat 100,000 training trajectories.
On knowledge tasks, grounding bought trust. The paper's second half moves to environments that change state as you act — a text-based household game and a shopping site — where planning and tracking progress matter more than facts.
ALFWorld gives goals like our pepper-shaker task from step 6 — with over 50 locations and solutions over 50 steps long. The baseline BUTLER is an imitation-learning agent trained on 100,000 expert trajectories per task type. ReAct gets two hand-annotated examples per task type. Success rates across 134 unseen games:
ALFWorld · success rate, 134 unseen tasks (Table 3)
ReAct · best of 6 prompt sets
ReAct · worst of the 6
Act — same prompts, thoughts deleted
BUTLER — trained on 10⁵ demos
One ablation here deserves a sentence, because it sharpens what “thought” means. The authors rebuilt the prompts in the style of Inner Monologue — a prior method whose “thoughts” only restate the current observation and goal. That version (ReAct-IM) scores 53%, eighteen points below ReAct. Restating what you see is not the same as deciding what it means and what to do about it.
Tables 3–4, §4. ALFWorld thoughts are the sparse kind: decompose the goal, guess where objects are likely to be (commonsense the game rewards), mark subgoal transitions. WebShop uses one-shot prompts; scores are over 500 test instructions.
Step 10 · Edit the agent's mind
Because thoughts are just text, a human can fix a failing agent by rewriting one.
Every thought so far was the model's own. But a thought is only a line of text in the context — and text can be edited by anyone, mid-run. The paper's appendix turns that into the most forward-looking demo in the whole thing.
An ALFWorld run goes wrong: holding the first of two keychains, the model writes a thought that hallucinates where the second one is, and the trajectory decays into “Nothing happens.” A human steps in and — without touching the model, the game, or any parameter — rewrites two thought lines:
The failing thought · Figure 5(a)
Act 17: Think[Now I find the first keychain (3). Next, I need to take it. I can find the second keychain (2) later in drawer 4.]
… Act 26: take keychain 2 from drawer 4 · Obs 26: Nothing happens. ✗
One hallucinated clause — “later in drawer 4” — and every step downstream inherits the error.
The human edit · Figure 5(b)
Act 17: Think[… I need to take it. I can find the second keychain (2), which is more likely to appear in dresser (1), garbagecan (1), safe (1), sidetable (1), sofa (1), shelf (1–12).]
… Obs 24: On the dresser 1, you see … a keychain 2 … → put keychain 2 in/on safe 1 ✓
Same model, same game, two sentences swapped — the agent recovers and completes the task.
The paper's framing is worth quoting in spirit: for a human, fixing this agent went from typing tens of actions to editing a couple of thoughts. You can't do that to a policy network's weights, and you can't do it to an agent that never writes its reasoning down. Interpretability here isn't a dashboard bolted on afterwards — the reasoning is the interface.
Two honest boundary notes to close the evidence. First, ReAct needs a big model: with PaLM-8B and 62B, ReAct is the worst of the four prompting methods — the format only clicks at 540B. (Fine-tuned on just 3,000 bootstrapped trajectories, the ranking flips: finetuned ReAct at 62B beats every prompting method at 540B.) Second, it's not PaLM-specific — on GPT-3 the same prompts score better still: 30.8 EM on HotpotQA, 78.4% on ALFWorld.
Numbers from 2022 aged; this property didn't. An agent whose plan is readable text can be inspected, debugged, steered and audited by whoever is watching it run. Every agent framework since has kept that shape.
Human-in-the-loop: Appendix A.3, Figure 5. Scaling: Figure 3 (PaLM-8/62/540B, prompting vs. finetuning on 3,000 ReAct-generated trajectories). GPT-3 comparison: Appendix A.1, Table 5 (text-davinci-002, greedy).
Step 11 · Walk out with the loop
Six questions, then where the loop went next.
One question, one loop, a family of deletions, an honest failure breakdown, two games, and a mind edited mid-run. Before the epilogue, test whether the loop comes back to you on demand — each answer is two sentences, each names its step.
What exactly does a thought change, and what does it never change? (step 5)
It appends one sentence to the model's own context — cₜ₊₁ = (cₜ, âₜ) — so every later decision reads it. It never touches the environment and gets no observation back; the world can't even tell it happened.
How do you get all three baselines out of one ReAct trajectory? (step 5)
Delete the thoughts and you have Act-only; delete the actions and observations and you have chain-of-thought; delete everything and you have standard prompting. The paper built its baselines exactly this way, so the comparisons are controlled.
Why did ReAct alone lose to CoT alone on HotpotQA? (steps 7–8)
The interleaved format constrains reasoning: 47% of ReAct's failures are reasoning errors (including unrecoverable repetition loops) and 23% are searches that returned nothing useful. CoT reasons more freely — at the price of hallucinating in 56% of its failures.
What's the case for combining ReAct with CoT-SC? (step 7)
Internal and external knowledge are complementary: the hand-offs win both benchmarks (35.1 HotpotQA, 64.6 Fever), and they match pure CoT-SC's 21-sample score with only 3–5 samples.
What did two examples beat, and where? (step 9)
On ALFWorld, two hand-annotated trajectories per task type took ReAct to 71% success — versus 45% for the same prompts with thoughts deleted, and 37% for BUTLER, trained on 100,000 expert demos per task type. Even ReAct's worst prompt set (48%) beat both.
Why does thought-editing matter beyond the demo? (step 10)
It shows the reasoning trace is a live control surface: a human fixed a failing agent by rewriting two sentences, no retraining. Readable plans make agents inspectable, steerable and debuggable — the property that carried into every later agent framework.
What happened next — the first author kept pulling the thread: Reflexion added self-critique thoughts after failures, Tree of Thoughts made the reasoning branch and backtrack, and the think-act-observe loop became the default scaffold in LangChain, AutoGPT and the tool-calling APIs of every major model provider. When today's assistant pauses, calls a tool, reads the result and adjusts course — you're watching this paper's four amber lines, industrialized.
“…reasoning traces help the model induce, track, and update action plans as well as handle exceptions, while actions allow it to interface with external sources, such as knowledge bases or environments, to gather additional information.” — Yao, Zhao, Yu, Du, Shafran, Narasimhan & Cao, 2022
The loop that every agent now runs.
ReAct's benchmark numbers were passed within months. Its shape wasn't: think in text, act through tools, read the world's reply, think again — with the whole trace open to human eyes.
The agent loop
LangChain's original agents, AutoGPT, and the tool-use loops behind modern assistants all run thought → action → observation. The paper named the pattern; the industry adopted the name.
Readable reasoning
Traces you can inspect and edit became a safety and debugging norm — from visible chains of thought to audit logs of agent tool calls.
Reflexion · Tree of Thoughts
The same group's follow-ups let agents critique their own failed trajectories and search over branching thoughts — richer uses of the space L that this paper opened.
Four amber sentences on a quiz question in 2022 — and the shape of how machines now get things done.