Reflection and Error Correction
Reflection evaluates feasibility, plans, and outcomes; error correction acts on that insight by regenerating plans or retries until the goal is met.
Reflection is not mandatory for an LLM agent to run, but it is often required for it to succeed. It can fire after receiving a query (is this feasible?), after plan generation (does the plan make sense?), after each step (are we on track?), and after full execution (is the goal met?).
Reflection generates insight; error correction acts on it — regenerate a plan, retry a tool call, or stop. They are paired but distinct. The same agent can self-critique via prompting, or a separate scorer can evaluate. Patterns such as ReAct interleave reasoning and action — thoughts are internal context updates that do not touch the environment, while acts do — and Reflexion splits evaluation and self-reflection into modules under verbal reinforcement learning, persisting lessons in episodic reflection memory.
Tradeoff: reflection is relatively easy to implement and can yield large gains, but thoughts, observations, and retries consume tokens and raise latency — especially on long trajectories already vulnerable to compound mistake amplification. Few-shot format examples for structured reflection further tax the context budget.
Sources
- AI Engineering (Chip Huyen), ch. 6
- Reflexion (Shinn et al.), pp. 1–19
- ReAct (Yao et al.), pp. 1–15