arXiv(opens in a new tab)cs.SEAug 2026Cited by 3 papers on PaperVantage

Manuscript Offprint

arXiv:2608.23651

Feedback That Backfires: Why Small Language Model Agents Repeat the Call They Just Watched Fail

Esmail Gumaan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Agent harnesses record a failed tool call and its error message in the transcript and ask the model to continue, on the reasonable assumption that the error is corrective information. We measure whether it is. Defining the corrective gain of a failure record as the change in log-probability of re-emitting the action that just failed, we find the gain is negative for every instruction-tuned model we tested (6 checkpoints, 135M–1.7B, 4 families) in two environments: simulated tool calling and MBPP program repair with real interpreter output. Normalised by action length the effect has the same size in both, about -1.03 nats per action token, a factor of 2.8 in the odds of each token. It holds on 90%–100% of individual items, not merely on average. Over a fixed candidate set the normalised probability of repeating the failed call rises from 0.06 to 0.54, and greedy decoding reproduces the failed call token for token on 19% of items after the failure versus 0% before it. Counterfactual observations, in which the same call is paired with a failure message, a success message, or a valence-free acknowledgement, separate two competing effects. The failed call's surface form accounts for 83% of the damage; the semantic contribution of marking it as failed is small and its sign is not even consistent across environments. The problem is therefore in the harness, not in the model's grasp of error messages, and that predicts which remedies can work. Replacing the verbatim call with a runtime-generated description of the failure removes 76% of the inversion at no token cost, and making previously-failed strings unreachable at the decoder acts on the same term. Two remedies that sound right do not act on it at all. An explicit “do not repeat” instruction leaves the measured quantity where it was; and deleting the failed attempt to retry from a clean context, the standard prescription for context contamination, is the worst harness we measured for repetition, because it restores precisely the context that produced the failure. What survives is narrow enough to be useful: the context after a failure must differ from the context before it, and the difference must not be the failed action. The study runs end to end on a CPU and all artefacts are released.

1 Introduction

An agent that calls tools will get some of those calls wrong. What happens next is decided not by the model but by the harness: it appends the failed call to the transcript, appends whatever the runtime printed, and asks the model to continue. ReAct [Yao et al., 2022] introduced this pattern and essentially every agent framework since has kept it, including the ones built for small open-weight models. The reasoning is hard to argue with. The error message is real information, it was produced by ground truth rather than by a critic, and a model that reads it should not try the same thing again.

We measured whether that is what happens. It is not.

Take a decision point in an agent trajectory: a context C, an action a×a^{\times} that will fail there, and the error the runtime returns. Compare the model's probability of writing a×a^{\times} before the attempt with its probability after the failure has been recorded. For every one of the 6 instruction-tuned models we tested, spanning 135M–1.7B parameters across 4 families, that probability goes up, by -17.38 nats, or about -1.03 nats per token of the action, which is a factor of 2.8 in the odds of every token. The effect is not an average over a few dramatic cases: it holds on 90% or more of individual items.

Restated on a scale that is easier to hold onto: over a fixed set of four candidate actions, the probability of re-emitting the failed call rises from 0.06 before the attempt to 0.54 after it. Greedy decoding, which is what the agent would actually have written next, reproduces the failed call token for token on 19% of items after the failure, against 0% before it.

Practitioners know the symptom. Agents get stuck repeating a call that has already failed, and frameworks ship loop detectors and step caps to contain it. The symptom is usually attributed to the model: it is small, it does not really understand the error, a stronger model would recover. Our second result is that this diagnosis is wrong, and it matters because it points at the wrong fix.

Appending (a×,o×)(a^{\times}, o^{\times}) does two things at once, and they can be separated. It puts the token sequence of the failed call into the context, where the model's copying machinery can reach it [Olsson et al., 2022, Xu et al., 2022]; and it asserts that the call failed. We can measure each part on its own by scoring the same action under a context whose observation is valence-free, meaning the runtime acknowledges the call and says nothing about how it went. The surface-form term accounts for 83% of the effect. The semantic term, the part that would have to be large and negative for “the model does not understand the error” to be the explanation, is small, and its sign is not even consistent between our two environments. On tool calls it is slightly positive, since explaining what went wrong requires naming the tool and the argument again; on program repair it is slightly negative, so a traceback does push the model away from the code that produced it. We stress the second case, because it is the one that fixes the interpretation: these models are not simply failing to read error messages. Whatever reading happens is being outvoted, by a median of 7 to one across model and environment, and by 106 to one at the extreme.

This changes what a fix should look like. If the model misunderstood, the remedy is a better model or a clearer message. If the harm is carried by the presence of a string, then message engineering cannot reach it, and neither can an instruction: telling a model not to repeat a call requires it to represent a negation about a string that is sitting right there in its context, which is the condition under which negative instructions are known to work least well [Castricato et al., 2024, Vrabcová et al., 2025]. What should work instead is structural.

“Structural” turns out to be narrower than it first appears, and the experiment that shows this is the one we did not expect. The obvious structural fix is to delete the failed attempt and retry from a clean context, which is what prior work on context contamination recommends [Yang, 2026]. That is the worst harness we tested, multiplying the exact repeat rate by 2.6 without changing task success. The reason is embarrassingly simple once seen: deleting the failure restores the exact context that produced it, and a deterministic policy in an identical context emits an identical action. The requirement is therefore not “remove the failed action” but something more specific: the context after a failure must differ from the context before it, and the difference must not be the failed action.

We test all three. Replacing the verbatim call with a description the runtime generates from its own error metadata, which keeps the diagnosis and drops the token sequence, removes 76% of the inversion and drives the exact greedy repeat rate to zero, at no cost in generated tokens. A decoder-level ban on previously-failed strings acts on the same term and costs nothing at all. The natural-language prohibition moves the measured quantity slightly the wrong way, which is what the negative-instruction literature would predict for a prohibition that has to name the very string it is prohibiting [Castricato et al., 2024, Vrabcová et al., 2025], and in free-running rollouts it does not reduce repetition either, though it does change behaviour in another way we report rather than explain. Section 8 gives all of this in full, including where the interventions do not help.

We are not claiming that execution feedback is useless, or that agent transcripts should be thrown away. The failed call carries diagnostic information a harness genuinely needs. The claim is narrower and, we think, more useful: the standard way of delivering that information hands the model a strong reason to repeat itself, and a harness can keep the diagnosis while withholding the reason.

References (4)

  • agent-0011 solved=False
  • argument value ~
  • SyntaxError: co~
  • argument value ~ qwen2.5-0.5b, harness=abstract-ban goal: agent-0011 solved=False