What is self-reflection in AI agents?
Self-reflection in AI agents is a technique in which an agent reviews its own output or failed attempt, writes a critique in natural language, and uses that critique to revise the work or guide its next attempt.
Two papers from March 2023 made the idea popular. Reflexion (Shinn and colleagues) had agents reflect in words on feedback from a failed attempt, store the reflection in an episodic memory, and read it before the next try, learning from trial and error without updating model weights. Self-Refine (Madaan and colleagues) used one model as generator, critic and reviser in a loop, with no extra training.
Both reported large gains on their own benchmarks. Reflexion reached 91% pass@1 on the HumanEval coding benchmark against 80% for GPT-4 in the paper's comparison, and Self-Refine reported an average improvement of about 20 percentage points across seven tasks.
Where it works and where it does not
The gains depend heavily on what the reflection is based on. "Large Language Models Cannot Self-Correct Reasoning Yet" by Huang and colleagues (October 2023, ICLR 2024) tested intrinsic self-correction, where a model revises its answer using only its own judgement. On reasoning tasks the models struggled to fix their answers without outside feedback, and performance sometimes got worse after the revision.
Reflexion's coding results drew on a concrete signal to reflect on: the outcome of running tests against the generated code. Anthropic's post on harness design for long-running apps (March 2026) adds a practical warning from agent work: agents asked to judge their own output tend to praise it, even when it is mediocre.
What makes reflection useful
Ground it in a signal
Test results, compiler errors, tool errors or a failed check give the reflection something true to work with.
Make it specific
A critique that names the failing step and the fix carries over to the next attempt. A general "try harder" note does not.
Store it
Reflexion kept reflections in memory across attempts. In a long-running agent, a progress or notes file plays the same role.
Cap the attempts
Reflection loops need a maximum number of tries, or a task that cannot pass keeps costing money.
What it is often confused with
Generator-critic loop
A separate model or prompt grades the work. Self-reflection uses the same agent to critique itself.
Chain-of-thought
Reasoning written before an answer. Self-reflection happens after an attempt, about that attempt.
The think tool
A pause for reasoning in the middle of a tool sequence, not a review of a finished attempt.
How Motiontic's engineers apply it
Motiontic's engineers use self-reflection where the agent has an outside signal to reflect on, such as tests, validators or tool errors, and switch to a separate critic where quality is subjective. Every reflection loop has a cap, and evals compare it against a single attempt, because reflection without new information often just adds cost.
Intrinsic self-correction compared with feedback-grounded reflection
| Intrinsic self-correction | Feedback-grounded reflection | |
|---|---|---|
| What the critique is based on | The model's own judgement only | An outside signal such as tests or tool errors |
| Evidence | Huang et al. found it often fails on reasoning, sometimes making answers worse | Reflexion's coding gains drew on test results from running the code |
| Cost | One or more extra model calls per attempt | Extra calls plus the cost of producing the signal |
| Fits | Style and clarity edits | Code, data checks and anything with a verifier |
Common questions
What is Reflexion in AI?
Reflexion is a 2023 method by Shinn and colleagues in which an agent writes a verbal reflection on why an attempt failed, stores it in memory, and uses it on the next attempt, instead of retraining the model.
Can LLMs correct their own mistakes?
With outside feedback, often yes. Without it, much less reliably: Huang and colleagues found models struggled to self-correct reasoning on their own and sometimes made answers worse.
What is the difference between self-reflection and a critic agent?
In self-reflection the agent critiques its own work. A critic agent is a separate model or prompt that grades the work, which Anthropic found easier to tune toward scepticism.
Related
Generator-critic loop
One model drafts, another grades, and the loop runs until the grade passes.
Think tool
A tool that does nothing, so the model has somewhere to stop and think between actions.
Chain-of-thought prompting
Asking the model to show its working, now mostly built into the model itself.
Eval
Repeatable, scored tests that tell a team whether an AI change made things better or worse.
AI agent development
Agents that do real work for users, with the evals, traces and guardrails to keep them in production.
Sources
- Shinn et al., Reflexion: Language Agents with Verbal Reinforcement Learning (arXiv 2023-03-20)
- Madaan et al., Self-Refine: Iterative Refinement with Self-Feedback (arXiv 2023-03-30)
- Huang et al., Large Language Models Cannot Self-Correct Reasoning Yet (arXiv 2023-10-03, ICLR 2024)
- Anthropic, Harness design for long-running application development (2026-03-24)
Running agents that have to hold up?
Describe the agent, the systems it touches and what it must never get wrong. The first call is with a lab engineer, who will say plainly whether it is ready for production, and whether Motiontic is the right team.