Skip to content
AI.info

AI agents

ReAct and the Action–Observation Loop

Use action–observation cycles to update a task from external feedback while preserving runtime controls.

By the end you can

Interleaving buys evidence; it does not expose real reasoning

ReAct-style systems interleave model reasoning with actions and observations. The pattern lets the agent gather evidence, revise assumptions, and handle exceptions instead of committing to a long plan based only on initial context.

The pattern is not a license to expose or trust private chain-of-thought. There is a measurement of what the printed rationale is worth. Rig the prompt, and the explanation follows the rigging. In one 2023 experiment the few-shot multiple-choice options were reordered so the answer was always “(A)”. In another the answer was simply suggested in the user turn. Then the explanations the models produced were read back. Turpin and colleagues state it plainly: “When we bias models toward incorrect answers, they frequently generate CoT explanations rationalizing those answers. This causes accuracy to drop by as much as 36% on a suite of 13 tasks from BIG-Bench Hard, when testing with GPT-3.5 from OpenAI and Claude 1.0 from Anthropic.”

The worst drop was 36.3 points. It came from the Suggested Answer bias with zero-shot CoT on GPT-3.5: 59.6% unbiased, 23.3% biased. The Answer-is-Always-A reordering cost less — 18.7 points for GPT-3.5 and 4.7 for Claude 1.0 in that setting. The chains of thought never referenced the bias. The one thing that had moved the answer was the one thing the reasoning left out.

Use concise action rationales, structured decisions and external state. Do not treat generated explanations as faithful internal reasoning.

The loop earns you a chance to revise on new evidence; the rationale it prints is logging, not a window into the decision.

Case

Two in-context examples, 34 absolute points, and a best trial of 71%

The pattern has a paper, a prompting budget and a measured gain. ReAct was published in 2022 by Yao and colleagues, and the abstract carries the headline result: “On two interactive decision making benchmarks (ALFWorld and WebShop), ReAct outperforms imitation and reinforcement learning methods by an absolute success rate of 34% and 10% respectively, while being prompted with only one or two in-context examples.”

The clause easiest to skim past is the last one. One or two in-context examples, against baselines that had been trained. BUTLER on ALFWorld was an imitation-learning agent trained on 10^5 expert trajectories for each task type. The WebShop baselines were imitation learning on 1,012 human-annotated trajectories, with imitation+RL trained on a further 10,587 training instructions. A handful of demonstrations against five orders of magnitude of supervision.

A margin is not a level. The margin alone never says how often the loop actually finished a task. ALFWorld was evaluated on 134 unseen games across six task types, six prompt permutations each. The paper reports the levels too: “On ALFWorld, the best ReAct trial achieves an average success rate of 71%, significantly outperforming the best Act (45%) and BUTLER (37%) trials.” Even the worst ReAct trial, at 48%, beat the best trial of both baselines. So the 34-point margin sits on a best case that still failed nearly three tasks in ten. That is why the rest of this lesson is about controls, not about the pattern's reputation.

Figure

The same loop, two environments: ReAct gained 34 absolute points of success rate on ALFWorld and 10 on WebShop — margins over the baselines, not scores.

Example

WebArena: 14.41% end to end, against 78.24% for humans

The plan is not the only thing that ages. For WebArena, Zhou and colleagues did not simulate a web environment for their agents; they built one. Fully functional e-commerce, forum, software-development and content-management sites. The tasks are long-horizon and scored by functional correctness — did the state of the world end up right — not by whether the agent's answer reads well. Its baselines already integrated “reasoning before acting”. So this is not a test of plan-first agents against interleaved ones. It is a test of interleaved agents against a real environment.

The headline is the gap: “our best GPT-4-based agent only achieves an end-to-end task success rate of 14.41%, significantly lower than the human performance of 78.24%.” Under one task in seven. The permissions, schemas and data of that environment are exactly the things an upfront plan assumes without checking. Interleaving is what lets the run notice that. It is not what makes the run succeed.

  • Decision at stake: whether each action is chosen from the observation that just arrived or from a plan written before the run began — and whether the runtime controls survive either way.
  • Hidden assumption: that ReAct requires exposing the model's full hidden chain of thought. What the loop needs is the observation re-entering the decision, not the private trace being published.
  • Primary control question: generated reasoning can sound coherent after the task has already drifted, and the distance between 14.41% and 78.24% on WebArena is not a distance in fluency.
  • Evidence to collect: functional correctness of the end state, WebArena's own measure, rather than the readability of the trajectory that produced it.

Visual

How ReAct-style control moves through the runtime

Observe, decide, act, update. Then the only question that matters: repeat or stop. The update and the repeat-or-stop decision keep their own owners and their own tests.

Read the task state and the latest trusted evidence. Select a bounded action or a terminal response. Execute through a validated tool boundary. Record result, progress, uncertainty and budget. Continue only when another action is justified. Nothing in that cycle is exotic. What makes it ReAct rather than a plan being replayed is that the fourth step is allowed to change the second, and that the fifth step can end the run. The same loop that produced the best ALFWorld trial's 71% also had to be stopped by something when it was not converging.

FigureProcess · 5 steps
  1. 1

    Observe

    Read the task state and the latest trusted evidence.

  2. 2

    Decide

    Select a bounded action or terminal response.

  3. 3

    Act

    Execute through a validated tool boundary.

  4. 4

    Update

    Record result, progress, uncertainty, and budget.

  5. 5

    Repeat or stop

    Continue only when another action is justified.

Comparison

What the interleaved loop actually buys, priced on WebShop

Three patterns: a reason-only response, a plan-then-execute run, and an interleaved action loop. What separates them is how late the system is still willing to learn something. Judge each by whether every action it takes is justified by the current state rather than an outdated initial plan. The case each one has to survive is the run where the generated reasoning still reads well after the task has already drifted.

WebShop puts a price on the difference. The environment holds 1.18M real products and 12k human instructions, and the test set is 500 instructions. ReAct scored 66.6, with a 40.0% success rate. The action-only baseline scored 62.3 and 30.1%. Imitation learning, trained on 1,012 human trajectories, scored 59.9 and 29.1%. Imitation+reinforcement learning, trained on a further 10,587 instructions, scored 62.4 and 28.7%. The paper's own summary: “On Webshop, one-shot Act prompting already performs on par with IL and IL+RL methods. With additional sparse reasoning, ReAct achieves significantly better performance, with an absolute 10% improvement over the previous best success rate.”

Read that 10 points carefully, because it is the number most often repeated without its baseline. It is measured against the previous best trained baseline — imitation learning at 29.1 — not against plan-free acting. Over Act, the sparse reasoning buys 9.9 points: 40.0 against 30.1. Human experts on the same task scored 82.1, with a 59.6% success rate, so the interleaved loop still left 19.6 points of success rate on the table. Adaptive is a real property with a real size. It is roughly ten points, not a change of category.

FigureComparison · 3 columns

Reason-only response

The model solves from static context without external action.

  • Low latency
  • No environment feedback
  • Suitable for bounded analysis

Plan then execute

A plan is created before actions begin.

  • Useful for coordination
  • Assumptions may age
  • Needs replanning

Interleaved action loop

Each observation can change the next step.

  • Adaptive
  • More model calls
  • Needs stop controls

Steps

Implement one bounded action–observation loop, then run it eight times

Implement a single action–observation loop with a hard bound on its steps, on a workflow that currently plans everything up front. Then compare the two runs. The plan-first version should show reasoning that still sounds confident once the task has moved away from the plan. The loop should leave a trace where each step ties back to what the last observation actually said. Define the state: user goal, verified facts, assumptions, actions, budgets. Constrain decisions to declared tools, clarification, escalation or completion. Execute one action rather than a speculative batch. Replace assumptions only with observed and attributed results. Then stop, replan or escalate when the state has not improved.

The grading half of that exercise has a published design to copy. τ-bench, from Yao and colleagues in 2024, scores an agent by comparing the database state at the end of a conversation with an annotated goal state. The world, not the transcript. It also introduced pass^k, the chance that all k i.i.d. trials of a task succeed, averaged across tasks. Its finding is the reason one run proves nothing: “Our experiments show that even state-of-the-art function calling agents (like gpt-4o) succeed on <50% of the tasks, and are quite inconsistent (pass^8 <25% in retail).”

The underlying numbers: the gpt-4o function-calling agent scored pass^1 of 61.2% on τ-retail and 35.2% on τ-airline. That averages 48.2%, which is where the abstract's “<50% of the tasks” comes from. On τ-retail the consistency then collapsed to roughly 25% once eight consecutive successes were required. So build the loop, define the goal state before you run it, diff the end state against it, and repeat the task until you have eight trials rather than one demonstration.

FigureProcess · 5 steps
  1. 1

    Define the state

    Separate user goal, verified facts, assumptions, actions, and budgets.

  2. 2

    Constrain decisions

    Allow only declared tools, clarification, escalation, or completion.

  3. 3

    Execute one action

    Avoid speculative batches when the first result can change the plan.

  4. 4

    Update from evidence

    Replace assumptions only with observed and attributed results.

  5. 5

    Evaluate progress

    Stop, replan, or escalate when the state has not improved.

Key idea

Generated reasoning can sound coherent after the task has already drifted

A model may rationalize repeated actions or reinterpret a failed result as progress. The runtime needs independent state and progress checks rather than accepting narrative continuity.

That failure was measured inside ReAct's own system, by its own authors. They hand-analysed 200 HotpotQA trajectories — 50 correct and 50 incorrect from each of ReAct and chain-of-thought. Interleaving cut hallucination as a failure mode from 56% for CoT to 0% for ReAct, and false positives from 14% to 6%. Meanwhile the reasoning-error rate rose from 16% to 47%. Grounding did not remove failure. It changed its shape.

One error pattern they name as frequent and specific to ReAct is the one this section is about: “the model repetitively generates the previous thoughts and actions, and we categorize it as part of “reasoning error” as the model fails to reason about what the proper next action to take and jump out of the loop”. The agent that cannot see it is going in circles will still narrate each lap.

Record compact decision rationales. But grade observable actions, evidence, and final state — and put the repetition check in the harness, where it does not depend on the agent noticing.

Grade the narrative and you reward an agent that has learned to describe failure as progress.

Check each step against the observation that preceded it

Use ReAct as a control pattern, not a mystical reasoning technique. Its value comes from grounding decisions in new observations. A reviewer reading the trace should not be reassured by prose that sounds coherent. Drift is exactly the condition under which the prose still sounds fine. What they are checking is narrower. Every step should have been chosen because of what the run had just observed, not because an early plan said so.

There is a number for how much a trace can be trusted to name its own cause. In April 2025 Anthropic's Alignment Science team planted six types of hint and checked whether the model's reasoning admitted using them: “On average across all the different hint types, Claude 3.7 Sonnet mentioned the hint 25% of the time, and DeepSeek R1 mentioned it 39% of the time.” They also report that outcome-based reinforcement learning improved faithfulness at first and then plateaued without saturating. Training the trace to be honest helps, and then stops helping.

A quarter to two-fifths. That is the rate at which a reasoning model names the thing that actually drove its answer. It is why the reviewable object is the observation the step followed, not the sentence the step wrote about itself.

Strip the fresh observation out of the loop and what remains is a model talking itself through a plan it never rechecked.

Key takeaways