How does Reflexion enable an agent to learn from failed attempts without fine-tuning the model?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Describe the Reflexion mechanism (Shinn et al. 2023). How does it allow an agent to improve on retries without gradient updates, and what is the key data structure it relies on?
Reflexion turns a failed attempt into a written self-critique, stores it in episodic memory, and prepends it to the next try, so the agent learns in-context with no weight update.
Imagine a student who fails a practice exam. Instead of being reprogrammed, they write a short note to themselves: 'I lost marks because I rushed the algebra and skipped checking units.' Before the next attempt they read that note. They have not gotten smarter in any permanent way, but with the note in front of them they avoid the same mistakes and do better. Reflexion works like this for an agent. After a failed run, the agent writes a plain-language critique of what went wrong. That note is saved in a little notebook called episodic memory. On the retry, the note is pasted at the top of the prompt so the model reads its own advice before trying again. Nothing inside the model changes. The only thing that changed is what it now remembers about its last mistake.
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.
Define Reflexion as verbal self-critique stored in episodic memory and prepended to the next prompt, frame the buffer as an in-context learning signal that substitutes for a gradient step, then close with the limits: it needs a reward signal, learns nothing permanent, and can reinforce a wrong lesson.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Claiming Reflexion fine-tunes the model. It never touches the weights. The lesson lives in the prompt, so improvement comes from in-context learning, not 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.