IN THIS BREAKDOWN · 10 SECTIONS
You can read 22% of this breakdown.
The paper in one minute
Language agents built on ReAct and similar methods act, observe and act again, but they do not learn from one attempt to the next. If an agent picks up the wrong pan on its first try, it is just as likely to do it on the second. The standard machine-learning answer, reinforcement learning, would update the model's weights from rewards, which takes many samples and a fine-tuning budget that was out of reach for GPT-3.5- and GPT-4-sized models.
Reflexion, from Noah Shinn and colleagues at Northeastern, MIT and Princeton (including ReAct's Shunyu Yao), does the learning in text instead. Three model roles work in a loop. An Actor attempts the task. An Evaluator scores the attempt: exact match against the answer, a hand-written heuristic, an LLM judgment, or unit tests the agent wrote itself. A Self-reflection model reads the failed attempt and its score and writes a short lesson in plain language, such as which action went wrong and what to do instead. The lesson goes into a memory of the last one to three lessons, which is added to the Actor's prompt on the next try. The loop repeats until the evaluator says pass or the trial budget runs out.
The results were strong for 2023. On HumanEval, GPT-4 with Reflexion reached 91% pass@1, against 80.1% for GPT-4 alone. On ALFWorld, text-based household tasks, the agent solved 130 of 134 within 12 trials. On 100 HotPotQA questions, success rose by about 20 points over the trials.
The paper also showed where it fails. On MBPP Python, the agent's self-written tests let wrong code through 16.3% of the time, and Reflexion scored 77.1%, below GPT-4's 80.1% without it.
Research notes: the problem, approach and results
HumanEval pass@1 with GPT-4 and Reflexion, against 80.1% for GPT-4 alone
ALFWorld household tasks solved over 12 trials with a simple failure heuristic
of passing self-written MBPP tests let wrong code through, which made Reflexion worse there
Agents repeat the same mistakes across attempts, and the usual fix, reinforcement learning on the model's weights, needs many samples and expensive fine-tuning.
Turn each failure signal into a short written lesson, keep the last few lessons in memory, and put them in the prompt for the next attempt. The model's weights never change.
GPT-4 with Reflexion reached 91% pass@1 on HumanEval against 80% without it, solved 130 of 134 ALFWorld tasks, and gained 20 points on 100 HotPotQA questions given feedback between trials.
Why it matters to an FDE
The pattern in this paper, try, check, write down what went wrong, try again, is now everywhere: coding agents that run tests and fix failures, extraction pipelines that validate output and re-prompt, support agents that retry a failed API call with a corrected argument. Reflexion is the clearest early statement of it, and of its one hard dependency.
The check decides everything. The loop stops when the evaluator says pass. If the evaluator passes wrong answers, the agent ships them confidently; if it fails right answers, the agent may edit working code into broken code. In the paper, the same model and loop gained 11 points on one benchmark and lost 3 on another because of test quality. Before you add a reflection loop, measure how often your check is wrong.
Some reported gains used the answer key. On HotPotQA, the evaluator between trials was exact match against the gold answer, so the agent was told when it was wrong. In ALFWorld, the environment reported success. In production you rarely have either. The programming results are the ones that hold without an answer key, because there the agent used only tests it wrote itself.
It costs attempts. Every reflection is another model call and another attempt. The 2024 paper AI Agents That Matter found that Reflexion cost over 50% more than a simple retry baseline with rising temperature on HumanEval, at similar accuracy. Price the loop before you promise it.
The lessons are readable. Unlike weight updates, a reflection is text a person can audit, which helps debugging and review.
Understand the mechanism. Try it on a real problem.
Unlock this breakdown and 49 more papers.
Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.
6 months · One payment · No auto-renewal
- ◇1 architecture diagram
- </>1 runnable code experiment
- ▦3 results tables
- ?5 interview questions with answers
- 03Key takeaways
The three roles, what the results show, the ablation and the misreadings to avoid
Free account - 04How it works
The algorithm, each benchmark's setup, and the programming test pipeline
Premium - 05The numbers that matter
Every result in one place, including the one where Reflexion lost
Premium - 06Try it yourself
Simulate a test-and-retry loop and watch the quality of its own check cap the result
Premium - 07Where it breaks
The limits the paper names, and the ones later work found
Premium - 08Using it on a deployment
Where a reflection loop earns its cost, and how to build one safely
Premium - 09Interview angles
Five questions this paper prepares you for, with answer hints
Premium - 10Read next
Where to go from here on this site
Premium
