Structured Feedback Improves Repair in an LLM Agent Loop
The paper introduces VeriHarness, a code-controlled agent loop demonstrating that providing LLMs with structured feedback containing failure location, observed values, and admissible alternatives significantly improves repair success rates in iterative tasks compared to raw diagnostics or incomplete feedback.
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 very smart, but slightly literal, robot how to play a video game. You give the robot a goal, like "find the treasure," and it tries to move around the world. Sometimes, the robot makes a mistake—maybe it tries to open a door that's already open, or it tries to pick up an item that isn't there. In the world of Artificial Intelligence, this robot is called an "LLM agent," and the part that checks if the robot's move is legal is called a "validator."
For a long time, when the robot messed up, the validator would just say, "Nope, that's wrong," and let the robot try again. It's like a teacher saying, "Try again," without telling the student why they got the answer wrong or what the right answer might be. The robot would just guess again, hoping to get lucky. But what if the validator could be more helpful? What if it could point exactly to the mistake, show what the robot actually did, and even suggest a list of things the robot could have done instead? This paper asks a simple but powerful question: Does giving the robot a detailed "repair kit" of information help it fix its mistakes faster and better than just getting a simple "try again" message?
The researchers behind this study built a special testing ground called VeriHarness. Think of it as a video game level where a strict referee (the validator) watches the robot (the AI model) play. If the robot makes a bad move, the referee stops the game and hands the robot a note. The team wanted to see what kind of note works best. They tested four different types of notes:
- The Raw Note: Just the error message, like "Command 1 is invalid."
- The Prose Note: A friendly paragraph explaining where the mistake happened, what the robot saw, and what it should have done.
- The Structured Note: The same info as the Prose Note, but formatted like a technical list with labels (like a JSON file).
- The "Location Only" Note: Telling the robot where it messed up and what it saw, but without suggesting any alternatives.
They ran this experiment 50 times with two different AI models (one called Qwen and one called Llama) playing text-based adventure games. The goal was to see how often the robot could reach the finish line (win the game) within a limit of four tries.
The results were a huge surprise for the "Raw Note" crowd. When the robot got the detailed notes that included where the mistake happened, what it observed, and a list of admissible alternatives (valid moves it could make instead), it became a champion.
- For the Qwen model, the success rate jumped from 28% (with the raw error message) to 72% (with the detailed notes). That's a 44 percentage point improvement.
- For the Llama model, it jumped from 16% to 58%, a 42 percentage point boost.
The most exciting part of the discovery is why this worked. The researchers suspected that maybe the robot just liked the neat, organized look of the "Structured Note" (the one with the technical labels). But they tested this by comparing the "Prose Note" (plain English) with the "Structured Note." The result? They performed almost exactly the same. Whether the advice was written in a friendly paragraph or a technical list didn't matter much. The magic ingredient wasn't the formatting; it was the content.
Specifically, the "Location Only" note (which told the robot where it failed but didn't give it new ideas) didn't help much at all. It stayed close to the low success rate of the raw error messages. This proves that simply pointing out the mistake isn't enough; the robot needs to be handed a list of valid alternatives to choose from. It's the difference between a teacher saying, "You spelled 'cat' wrong," versus "You spelled 'cat' wrong; you could have written 'bat,' 'hat,' or 'mat'."
The study also checked if this trick works for coding tasks (using a set of problems called HumanEval). They found that the method only works if the validator can actually see the mistake. If the robot passes a visible test but fails a hidden one that the validator can't see, no amount of feedback can fix it. This suggests that while detailed feedback is a superpower, it's not magic—it can only fix what it can see.
In the end, this paper suggests that if we want our AI agents to be better at fixing their own mistakes, we shouldn't just let them guess again. We need to build validators that act like helpful coaches: pointing out the specific error, showing what actually happened, and offering a menu of correct options to try next. It turns out that for AI, a little bit of specific, actionable advice is worth a thousand "try agains."
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.