← Latest papers
💻 computer science

Try Again, Don't Look Back: Blind Resampling Outperforms Self-Repair in Small Code Models

This paper demonstrates that for small code models, blind resampling (retrying without feedback) outperforms or matches standard self-repair methods while using significantly fewer tokens, because conditioning on a model's own failed attempt causes it to "anchor" to the original error rather than effectively utilizing execution feedback.

Original authors: Yuvraj Verma

Published 2026-07-30
📖 5 min read🧠 Deep dive

Original authors: Yuvraj Verma

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are teaching a robot to write computer code. You give the robot a task, like "write a program that adds two numbers," and it tries to do it. Sometimes, the robot makes a mistake, and the code doesn't work. In the world of artificial intelligence, a popular idea is "self-repair." This is like telling the robot, "Hey, you messed up. Here is your broken code and the error message. Now, look at it, think about what went wrong, and try to fix it." It sounds like a smart way to learn from mistakes, right? But there's a catch. When we test if this "fixing" works, we often compare it to a robot that just gives up after one try. That's a bit unfair because the robot that gets a second chance has a better shot at success simply because it tried again, not necessarily because it learned from its error. To really know if "fixing" is the magic ingredient, we need to compare it to a robot that gets a second chance but doesn't see its old mistake. This paper dives into that exact question: Is it better to look back at a failure and try to fix it, or is it better to just forget the failure and try a brand-new approach from scratch?

The researchers in this paper decided to play a game of "Try Again, Don't Look Back" with some small AI models. They set up a clever experiment using a "placebo" test, which is usually something you do in medicine to see if a pill works or if it's just the hope of taking a pill that helps. Here, they compared four different ways a robot could try to fix its code:

  1. Blind Resampling: The robot gets a second chance but is told nothing about the first try. It's like asking a student to take a math test again without showing them the first one.
  2. The Placebo: The robot sees its broken code and a simple note saying, "This is wrong," but no details on why.
  3. Real Feedback: The robot sees the broken code and the specific error message (like "you forgot a semicolon").
  4. Reflection: The robot sees the error and is asked to write a paragraph explaining what went wrong before trying to fix it.

They ran this test on three different sizes of AI models (small, medium, and slightly larger) and watched how many times they got the code right.

Here is the surprising twist: Looking back at the mistake actually made the small robots worse.

For the smaller models (1.5 billion and 3 billion parameters), the "Blind Resampling" strategy was the clear winner. It was not only the most accurate but also the cheapest in terms of computer time and energy. When the researchers forced the robots to look at their own failed code (the "Placebo" or "Feedback" groups), the robots got stuck. They tended to make tiny, almost invisible changes to the broken code instead of thinking of a completely new solution. The paper calls this "anchoring." It's like if you try to draw a cat, mess it up, and then try to fix it by just erasing a few lines of the bad drawing. You end up with a weird, half-fixed cat. But if you just put the paper down and start a fresh sheet, you might draw a totally different, better cat.

The researchers found that when the robots looked at their own failed attempts, they reproduced a nearly identical program 33% to 68% of the time. In contrast, when they tried blindly (without looking), they only repeated themselves 2% to 14% of the time. The "information" in the error messages didn't help at all; a simple "this is wrong" note was just as bad as the full error report. Even asking the robot to "think out loud" about the mistake (Reflection) didn't save the day; it just made the process much more expensive without improving the results enough to matter.

However, there is a glimmer of hope for bigger brains. When they tested the largest model (7 billion parameters), the penalty for looking back almost disappeared. The "Blind Resampling" and the "Self-Repair" methods ended up in a statistical tie. This suggests that as AI gets smarter, it becomes better at not getting stuck on its own mistakes. But for the smaller, cheaper models that many people actually use, the advice is clear: Don't look back.

The paper also ruled out a few other ideas. They checked if the problem was just because the prompts got too long and confused the robots, but adding code from other successful tasks didn't hurt performance. This proved the problem wasn't about length, but specifically about the robot looking at its own failure. They also checked if the problem was just a glitch in how the computer stored the numbers (quantization), but the result stayed the same even with higher precision.

So, what's the takeaway? If you are using a small AI to write code, don't waste time showing it its mistakes and asking it to fix them. It will likely just get stuck in a loop of tiny, useless edits. Instead, just ask it to try again from scratch. It's faster, cheaper, and surprisingly, it works better. The cost of "fixing" a bad first attempt is just the cost of being stuck with a bad first attempt. Sometimes, the best way to move forward is to forget the past and start fresh.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →