Reflect before Act: Proactive Error Correction in Language Models

Qiuhai Zeng, Sarvesh Rajkumar, Di Wang, Narendra Gyanchandani, Wenbo YanarXiv 2025 · DOI

Introduction

Large Language Model (LLM) agents are increasingly deployed for interactive decision-making tasks, such as navigating e-commerce websites or managing virtual environments. However, these agents often suffer from "error accumulation." A minor mistake early in a trajectory—such as selecting an incorrect product category—can lead to a cascade of failures because the agent typically lacks a mechanism to self-correct based on environmental feedback. Existing frameworks like ReAct often attempt to proceed from a corrupted state, leading to a "death spiral" of failed actions.

The REBACT Framework

REBACT (Reflect before Act) addresses this gap by introducing proactive, mid-stream error correction. Unlike retrospective methods that only analyze failures after a task concludes, REBACT integrates a mandatory reflection step before every new action.

The core of REBACT is a three-step logic executed within a single LLM invocation:

  1. Review: The model examines the previous action and the resulting observation from the environment.
  2. Reflect: It determines if the previous action was correct or erroneous.
  3. Act: If the action was wrong, the model generates a modified version of that action. If correct, it proceeds to the next logical step.
Comparison of ReAct, ADAPT, and REBACT trajectories in WebShop.

This approach ensures the agent's internal state remains synchronized with the environment without the latency overhead of multi-step reasoning frameworks. By treating reflection as immediate "correction tape," the model can pivot the moment feedback contradicts its plan.

Experimental Evaluation

The authors evaluated REBACT using Claude 3.5 Sonnet across three diverse interactive environments:

  • WebShop: A simulated e-commerce platform with over 1 million products requiring complex search and purchase logic.
  • ALFWorld: A text-based environment for household tasks (e.g., cleaning and placing objects).
  • TextCraft: A Minecraft-inspired crafting world requiring multi-step compositional logic.

Key Results and Insights

REBACT consistently outperformed established baselines like ReAct and ADAPT across all benchmarks, achieving near-perfect scores in text-based environments like TextCraft (99.5% success rate).

Superior Performance on WebShop

On the WebShop benchmark, REBACT achieved a success rate of 61%, significantly higher than ReAct (29%) and ADAPT (37%). Notably, this performance surpasses both average human performance (50%) and human expert performance (59.6%), suggesting that systematic self-correction can exceed human consistency in complex search tasks.

Success rates and scores on the WebShop benchmark.

Efficiency and Accuracy

A common concern with adding reasoning steps is increased computational cost. However, REBACT actually reduced the total number of LLM calls—by 57% in WebShop and 26% in ALFWorld. By correcting errors immediately, the agent avoids long, unproductive failure loops, completing tasks in fewer total steps.

Analysis of the agent's behavior revealed that it only needed to modify its actions between 8.7% and 22.8% of the time. This "light touch" correction is sufficient to stabilize the entire action path and prevent error accumulation.

Conclusion and Future Work

REBACT demonstrates that proactive error correction is a powerful tool for enhancing LLM agent reliability. By reflecting on environmental feedback before committing to the next step, agents can pivot away from failures in real-time.

Future research will need to address the challenge of irreversibility. In digital sandboxes, actions can often be "undone" or modified, but in real-world scenarios (like financial transactions), some errors are final. Developing "modifiability awareness" and damage control strategies for irreversible actions remains a critical next step for deploying robust LLM agents in the wild.

Summary updated

BibTeX
@misc{zeng2025reflect,
  author = {Qiuhai Zeng and Sarvesh Rajkumar and Di Wang and Narendra Gyanchandani and Wenbo Yan},
  title = {{Reflect before Act: Proactive Error Correction in Language Models}},
  year = {2025},
  eprint = {2509.18607},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.18607},
}
Figure