What is the Reflexion mechanism and how does it avoid fine-tuning?
Reflexion replaces gradient updates with verbal self-critiques: after a failed trial the agent writes what went wrong, stores it in memory, and prepends it to the next attempt.
Imagine a student who keeps failing the same kind of exam question. They never get smarter on the spot, but after each try they scribble a sticky note: 'I forgot to check the units last time.' Before the next attempt they read all their sticky notes, so they avoid repeating those mistakes. The student's brain has not changed at all. Their notes have. Reflexion works like this for an agent. The model itself is frozen, so its weights never move. After a failed attempt it writes a short note in plain language explaining the slip-up. That note is saved, then pasted into the prompt for the next attempt. The agent improves trial after trial purely because it now reads its own past lessons, not because it was retrained.
Detailed answer & concept explanation~8 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
State that weights stay frozen, name the actor, evaluator, and self-reflection roles, explain how critiques land in episodic memory and get prepended to the next trial, then close with the limits: bounded context memory, dependence on evaluator quality, and fast saturation across trials.
Real products, models, and research that use this idea.
- Coding agents like Cursor and Aider follow a Reflexion-style retry loop: run the test suite, read the failure, write a note on the bug, and edit again with that note in context.
- A frontier model such as Claude Opus 4.7 or GPT-5.5 driving a SWE-bench agent can retry a failed patch after reflecting on the failing test output, without any weight change.
- Self-correcting RAG pipelines reflect on a wrong answer, note which retrieval was irrelevant, and rerun the query step with that critique prepended.
- LangGraph and the Anthropic SDK let teams wire an evaluator node plus a memory buffer, implementing verbal-reinforcement retries on top of a frozen model endpoint.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow does Reflexion differ from a policy gradient method like PPO at the level of the update?
QWhat happens to performance as the number of trials grows large, and why?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Saying Reflexion fine-tunes the model on its mistakes. It never touches weights. The self-critique lives in the prompt as in-context feedback, not in a gradient step.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.