A coding AI improved by training only on its own explanations
Shockingly Simple Self-retrospection Improves Agentic Models Without RL
TL;DR On real software repair tasks, a small AI trained only to explain its past attempts solved 49.2%, against 48.0% for standard reward training. The edge is small and comes from one score per method, but the method used no rewards during training.
Words to know
- reinforcement learning
- Training that rewards an AI for good outcomes, so it repeats the actions that led to them.
- SWE-bench Verified
- A collection of real Python software problems used to grade AI, where a fix counts only if its checks pass.
- training round
- One step in which an AI’s internal settings get adjusted using a fresh batch of examples.
- error bars
- Marks that show how much a score might shift by chance if the experiment were repeated.
The problem
One effective way to improve a coding AI is reinforcement learning. The AI tries a task and runs the tests. Training then makes the moves from passing attempts more likely. But a single pass or fail does not say which assumption was wrong or which step mattered. One version, called GRPO, learns by comparing several tries at the same task. When every try fails, it has nothing to compare, so it learns nothing.
The idea
The team asked if an AI could improve by learning to explain its own attempts. Picture a cook who writes a note after each dinner on what worked, what went wrong and why. She never rereads the notes, but writing them changes how she cooks the next dinner. In the team’s method, ROFT, the AI tries a coding task and sees the test results. Then it writes a short explanation of its attempt. Training adjusts the AI only to produce that explanation, never its coding steps. The authors think explaining an attempt teaches lessons that shape many later decisions.
What they showed
- Slightly ahead with fewer rounds. On SWE-bench Verified, the starting model solved 44.2% of the problems. After ROFT it solved 49.2%, against 48.0% for GRPO trained for twice as many rounds.
- About half the training time. On the same computers, ROFT finished the same number of training rounds in about half the time GRPO needed. It also used about half as many coding attempts.
- Learning from failure alone. The team picked three single tasks where all 64 starting attempts failed. ROFT trained on each task alone and began solving that same task. It succeeded in only a small share of tries, while GRPO cannot learn there at all.
Why it matters
The main audience is teams that build coding AI tools that work through many steps on their own. On such long tasks, one pass or fail grade says little about which steps mattered. Explanations could add training material even when every try fails. The authors suggest that ordinary use of an agent could become a source of lessons, a step past what they tested.
The catch
The evidence is thin. The main comparison shows one score per method, at chosen points in training, with no error bars. So the small gap could come from chance or from which points were picked. The abstract and the results section also report different scores for the harder SWE-bench Pro test. A side analysis suggests ROFT favors correct steps, but it relies on unchecked labels from another AI. Most tests used one small model, on coding tasks only, and the code is not yet released.
Who wrote it
Jonathan Light (RPI and Microsoft Research) is first and corresponding author. The ten authors come from Microsoft Research, RPI, UC San Diego and 2 other institutions. Light co-authored Strategist: Self-improvement of LLM Decision Making via Bi-Level Tree Search (2024), which this paper cites.