Paper Breakdowns  /  Reflexion
Paper 38~7 min readNortheastern / MIT · 2023
Paper Breakdown

Reflexion,
explained.

Reinforcement learning improves an agent by nudging millions of weights — slow, expensive, and impossible if the model is behind an API. Reflexion found a shortcut hiding in plain sight: when the agent fails, have it write down why, keep the note, and let it read its own advice before trying again. No gradients. No fine-tuning. The agent gets better the way people do — by remembering what went wrong.

Video breakdown
The animated walkthrough is in production.
Read the full breakdown below in the meantime ↓
01

Agents that make the same mistake twice

A ReAct-style agent can act, observe, and adapt within one attempt. But let it fail the whole task and try again, and something embarrassing happens: it repeats the same mistake. Nothing carried over. The standard fixes were both bad — fine-tune on failures (expensive, impossible via API, and one task's lessons overwrite another's) or hope a bigger context magically helps (it doesn't; raw failed trajectories are noise, not lessons).

What's missing is what humans do between attempts: compress the failure into a lesson. Not "here are the 4,000 tokens of my failed attempt" but "I forgot to handle the empty-list case."

02

Actor, Evaluator, Reflector

Reflexion splits the retry loop into three roles. The Actor attempts the task — writing code, navigating a household simulator, searching for answers. The Evaluator grades the attempt: unit tests for code, task success for environments, an LLM judge where nothing crisper exists. And the Self-Reflection model turns the graded failure into a short, specific verbal lesson.

The Reflexion loop — reinforcement through words
Actor attempts
Evaluator grades
tests · env · judge
Reflector writes
why it failed
Episodic memory
lessons persist
Retry with lessons
in context

The lessons accumulate in an episodic memory buffer that's prepended to every new attempt. Attempt three doesn't just know the task — it knows exactly how attempts one and two died.

03

Why words beat scalars

Classic RL compresses feedback into a single number — reward 0. Everything about why is discarded, and the algorithm spends thousands of episodes rediscovering it through trial and error. A verbal reflection keeps the why: which assumption was wrong, which edge case was missed, what to try instead. It's credit assignment in prose — precise, immediate, and executable by the very next attempt.

Test failed: merge_intervals([[1,4],[4,5]]) → expected [[1,5]]
Reflection: "I treated touching intervals as disjoint. Boundary equality must merge — use start <= prev_end, not <."
Attempt 2: passes.
The key idea

The model already contains the machinery to diagnose failures and follow advice — it's a language model. Reflexion routes the learning signal through that machinery instead of through the weights. Policy improvement becomes a context update.

04

The numbers

TaskResult
HumanEval (code, GPT-4)80% → 91% pass@1 — SOTA at publication
ALFWorld (household decision-making)+22 points absolute over ReAct baseline
HotPotQA (multi-hop reasoning)+20 points over strong baselines

The coding result carried the headline: with nothing but self-generated unit-test feedback and verbal retries, GPT-4 jumped eleven points on the benchmark everyone watched. The breadth mattered more — the same three-role loop worked on navigation, search and code, unchanged.

05

The limits

Reflexion learns nothing durable — lessons live in a context buffer, bounded by the window, gone when the episode ends (unless you persist them into real memory). It leans on the Evaluator: crisp signals like unit tests make it soar; fuzzy self-evaluation can reinforce confident nonsense. And reflection quality is capped by the model's own diagnostic ability — an agent that misunderstands why it failed writes itself bad advice and then dutifully follows it.

It's also, quietly, a test-time method: multiple attempts cost multiple rollouts. Like self-consistency and ToT, it buys capability with inference compute.

06

Why it still matters

Reflexion named and validated the pattern that now lives inside nearly every serious agent: try → check → diagnose in words → retry with the diagnosis. Every coding agent that reads its own test failures and patches, every harness with a critique-then-revise step, every eval loop that feeds errors back as guidance — that's the Reflexion loop, productionized.

Its deeper claim aged even better: a model's language channel is a legitimate substrate for learning. That idea threads through self-critique training, agent post-mortems written to memory, and the whole self-improvement research line. Weights are one place to store lessons; words, it turns out, are another.

Read next

The within-attempt loop it extends: ReAct. Where the lessons should live: MemGPT. The evaluator side: Agent Evals.

Frequently asked

Quick answers

What is Reflexion?

A framework where agents improve across attempts via verbal self-reflections stored in episodic memory — reinforcement through words, no weight updates.

How does the loop work?

Actor attempts, Evaluator grades (tests/environment/judge), Reflector writes why it failed, memory keeps the lesson, the retry reads it.

Headline result?

HumanEval with GPT-4: 80% → 91% pass@1, plus ~20-point gains on ALFWorld and HotPotQA.

Main limitation?

Nothing is learned durably — lessons are context, bounded by the window, and only as good as the model's own diagnosis.

Finished this one? 0 / 42 Paper Breakdowns done

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Paper Breakdowns