Papers › Reflexion: Language Agents with Verbal Reinforcement Learning

Reflexion: Language Agents with Verbal Reinforcement Learning

20 Mar 2023NeurIPS 2023 11arXiv:2303.11366archive 2025-07-28

Noah Shinn, Federico Cassano, Edward Berman, Ashwin Gopinath, Karthik Narasimhan, Shunyu Yao

Large language models (LLMs) have been increasingly used to interact with external environments (e.g., games, compilers, APIs) as goal-driven agents. However, it remains challenging for these language agents to quickly and efficiently learn from trial-and-error as traditional reinforcement learning methods require extensive training samples and expensive model fine-tuning. We propose Reflexion, a novel framework to reinforce language agents not by updating weights, but instead through linguistic feedback. Concretely, Reflexion agents verbally reflect on task feedback signals, then maintain their own reflective text in an episodic memory buffer to induce better decision-making in subsequent trials. Reflexion is flexible enough to incorporate various types (scalar values or free-form language) and sources (external or internally simulated) of feedback signals, and obtains significant improvements over a baseline agent across diverse tasks (sequential decision-making, coding, language reasoning). For example, Reflexion achieves a 91% pass@1 accuracy on the HumanEval coding benchmark, surpassing the previous state-of-the-art GPT-4 that achieves 80%. We also conduct ablation and analysis studies using different feedback signals, feedback incorporation methods, and agent types, and provide insights into how they affect performance.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2303.11366")

Code

Syntology Ran 2 of 9 code samples harvested from 1 repository linked to this paper; 7 have no recorded run. Of those that ran: 2 ran · our draft was wrong.

By repository: community (archive-listed): 9 samples from 1 repository, 2 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

noahshinn024/reflexion officialmentioned in papermentioned on GitHubnot reachable when probed 2026-09-17 — repositories for recent papers often appear after camera-ready report
gammatauai/leetcode-hard-gym mentioned on GitHub report
imagination-research/lbt mentioned on GitHubMIT report
noahshinn/reflexion mentioned on GitHubMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

9 samples harvested; 2 ran; 0 honoured the contract we drafted; 7 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · our draft was wrong
7unverified

Licence: 0 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from noahshinn/reflexion. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

format_step noahshinn/reflexion/hotpotqa_runs/agents.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · 84d28fbaf38b0a59 · report
normalize_answer noahshinn/reflexion/hotpotqa_runs/environment.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · dae7ab386661a4f4 · report
EM noahshinn/reflexion/hotpotqa_runs/environment.py community (archive-listed) unverified MIT (permissive) · 6f79fe1ce6d553fa · report
get_completion noahshinn/reflexion/alfworld_runs/utils.py community (archive-listed) unverified MIT (permissive) · a7a0cc9d35a647f1 · report
parse_action noahshinn/reflexion/hotpotqa_runs/agents.py community (archive-listed) unverified MIT (permissive) · 0cd0094dec049291 · report
parse_action noahshinn/reflexion/hotpotqa_runs/environment.py community (archive-listed) unverified MIT (permissive) · 23aab7577a21a4cf · report
process_ob noahshinn/reflexion/alfworld_runs/alfworld_trial.py community (archive-listed) unverified MIT (permissive) · dfb17eb3e6eaed35 · report
reactLLMMock noahshinn/reflexion/hotpotqa_runs/mocks.py community (archive-listed) unverified MIT (permissive) · d228da106025a025 · report
reflectLLMMock noahshinn/reflexion/hotpotqa_runs/mocks.py community (archive-listed) unverified MIT (permissive) · 48168012e82e413b · report

Tasks

Decision MakingHumanEvalReinforcement LearningSequential Decision Makingreinforcement-learning

Datasets

Introduced by this paper, per the archive.

LeetCode-Hard

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutGPT-4Label SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections