On hard coding problems, iterative refinement with any tested feedback cannot beat simple parallel sampling under the same budget. Refinement acts as conditional resampling, not genuine discovery.
Going deeper

Imagine you are fixing a leaky pipe. A friend watches and gives you tips after each attempt. On a simple leak, any tip helps. On a medium leak, a plumber's exact instructions help most. But on a truly hard leak—say a corroded joint deep inside a wall—even a plumber's advice barely helps, because you lack the hands and tools to execute it.
This paper tests the same idea with AI coding agents. It gives an agent six kinds of tips—from vague scores to expert hints—and measures how much each one helps on easy, medium, and hard programming puzzles. On easy ones, every tip works. On medium ones, expert hints shine. On hard ones, even expert hints add almost nothing.
The surprise: on hard puzzles the agent would do better just trying ten times from scratch and picking its best answer, rather than trying once and revising nine times with feedback. The revisions look like someone dismantling and rebuilding the same pipe over and over, never getting further than their luckiest first try.
The abstract, word for word, with the seven densest phrases unpacked.
Recent advances in AI increasingly rely on agents that iteratively refine their responses at test time using feedback from an environment1. Yet it remains unclear what type of feedback most effectively enables an agent to make discoveries beyond its existing capabilities. We investigate this question using a controlled testbed of coding problems spanning different difficulty levels. We compare six forms of feedback most commonly used in practice2: detailed execution reports, aggregate performance scores, self-reflection, external LLM code review, failures on LLM-generated tests, and ground-truth hints written by human experts. Using this framework, we show that feedback effectiveness depends strongly on problem difficulty3: On easy problems, nearly all feedback types enable the agent to reach full accuracy when the agent was unable to solve them in the initial attempt. On medium problems, feedback derived from ground-truth solutions yields the largest improvement (40.4%), followed by feedback from LLM-generated test cases (24.1%). On hard problems, however, even ground-truth hints provide only a marginal improvement (5.3%)4. In this case, feedback based on LLM-generated test cases remains the most effective (20.4%). Nevertheless, under the same inference budget, best-of- N parallel sampling outperforms every iterative-feedback method in hard problems5. In fact, we show that the gains from refinement are proportional to the gap between the initial response and the best solution obtainable through parallel sampling6. These findings reveal an illusion of sequential refinement7: on difficult problems, iterative refinement primarily helps the agent recover from poor initial generations and approach, but not surpass, the best solutions it could independently generate.
Two lines of work converge: iterative self-repair and parallel test-time scaling.
Read five parts, in this order.
Skip Section 2 and Appendix A if you know coding agents and prompt engineering.
If the conclusion is weaker than it looks, check these places.
Nothing on this page was recomputed. Every claim points to the paper so you can check it.
In this work, we used generative AI tools for polishing writing, implementing methods, and visualization. We have not used generative AI tools for designing or providing feedback on research methodology or experiments, supporting qualitative and thematic data analysis, and interpreting results. Generating synthetic data sets, developing theoretical models or conceptual frameworks, formulating mathematical claims, providing critical ingredients for proving mathematical claims, assisting in the writing of proofs, proposing or refining hypotheses, assisting with translation, cleaning, and reformatting the dataset are not applicable to this work. Additionally, we used generative AI tools to polish writing, to help with data visualization, but not for ideation or structural framing. We have reviewed all AI-assisted work. We verified the generated AI code and results. We take responsibility for the final content of this work, including text, claims or artifacts produced with the aid of generative AI.
More latest news
Read all