Feedback That Backfires: Why Small Language Model Agents Repeat the Call They Just Watched Fail
This paper reveals that small language model agents are significantly more likely to repeat failed tool calls when the failure is recorded verbatim in the transcript, a counterproductive effect driven primarily by the surface form of the failed action rather than the error message, which can be effectively mitigated by replacing the raw call with a runtime-generated description of the failure.
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 a digital assistant that can use tools to solve problems, like looking up a contact, checking a calendar, or writing a piece of code. To do this, the assistant follows a simple loop: it thinks of an action, tries to perform it, and then reads the result. If the action fails, the system records exactly what the assistant tried to do and the error message it received, then asks the assistant to try again. This method, known as the agent loop, is the standard way these systems learn from their mistakes. The logic seems sound: if you tell a person "you tried to open a locked door and it didn't work," they will not try the same locked door again. They will look for a different key or a different door. For years, engineers have assumed that small computer models, which power many of these assistants, would behave the same way. They believed that showing the model the error message would teach it to avoid that specific mistake.
A researcher at the University of Passau in Germany decided to test this assumption with extreme precision. They did not just watch the assistants fail and succeed; they measured the exact mathematical likelihood of the model choosing the same wrong action before and after seeing the error. They ran these tests on six different small computer models, ranging from very tiny to moderately sized, across two different environments: one where the models tried to use simulated office tools, and another where they attempted to fix broken computer programs. The researcher wanted to know if the error message actually corrected the model's behavior.
What they found was the opposite of what everyone expected. Instead of learning from the failure, the models became significantly more likely to repeat the exact same mistake. When the system showed the model the failed attempt and the error message, the model's internal probability of choosing that same failed action again jumped dramatically. In the tool-calling tests, the chance of the model repeating the failed call rose from a low six percent to over fifty percent. In nearly every single case the researcher tested, the error message did not act as a warning; it acted as a magnet, pulling the model back toward the very action it had just failed to perform.
The researcher then asked why this was happening. They suspected that the models might simply be too small to understand the error message. However, their investigation revealed a different culprit. They discovered that the problem was not the meaning of the error, but the presence of the text itself. When the failed action was written into the record, the model's internal machinery, which is designed to copy patterns it sees, latched onto the text of the failed action. This copying effect was so strong that it overwhelmed the actual message about the failure. Even when the researcher replaced the long, detailed error message with a simple note saying "this failed," the model still repeated the mistake. But when they removed the text of the failed action entirely and replaced it with a description of what went wrong, the model stopped repeating the error.
This finding upended the standard way these systems are built. The common advice for fixing a stuck agent has been to delete the failed attempt from the history and let the model start fresh, hoping to clear the "contamination." The researcher found that this was actually the worst possible thing to do. By deleting the failure, the system restored the exact conditions that caused the mistake in the first place, guaranteeing that the model would make the same error again. The solution, they discovered, was not to delete the history, but to change it. If the system kept the record of the failure but replaced the raw text of the failed command with a description generated by the system, the repetition stopped.
The study also tested a more obvious fix: simply telling the model in its instructions not to repeat the failed action. This approach, which sounds logical to a human, had almost no effect. The model could not easily follow a rule that told it to ignore a specific string of text that was sitting right in front of it. The researcher concluded that the issue was not a lack of intelligence in the model, but a flaw in how the information was presented. The standard method of showing the failed action alongside the error message creates a powerful urge to copy, which is stronger than the urge to learn from the mistake.
By running these experiments on a standard computer processor without specialized graphics cards, the researcher proved that this behavior is a fundamental property of how these small models work, not a glitch that requires massive computing power to fix. Their work suggests that to build reliable digital assistants, engineers must stop treating the failed action as a helpful lesson to be read and start treating it as a dangerous pattern to be hidden. The fix is structural: the context after a failure must look different from the context before it, but the difference cannot be the failed action itself. By removing the raw text of the mistake and keeping only the diagnosis, the system can break the cycle of repetition and allow the model to actually move forward.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.