Apply to my task
arXiv:2608.23651 ★ 84 Aug 24, 2026

Feedback Inversion: Why Quoting an Error Word for Word Makes the Model Repeat It

Key result

6% → 54%: that's how much the chance of repeating a failed call grew once the model saw the exact text of its own failed attempt. Rephrasing the error in your own words lets you fix an LLM's failed attempts without loops of the same mistake over and over. The catch: the model doesn't respond to the meaning of the feedback; it copies what's in front of it. Remove the exact text of the failure, keep only the gist, and the copying effect nearly disappears.

01

TL;DR

When a model makes a failed tool call or writes buggy code, the standard approach is to hand it back the exact text of that attempt plus the error message and ask it to fix things. The logic makes sense: the error is a fact, and the model should take it into account. In practice the opposite happens: the probability that the model repeats that very same failed version shoots up instead of going down.

In the experiments, the probability of repeating a failed action jumped from 6% to 54% after the model saw the record of its failure. The reason isn't that the model "didn't understand" the error message. 83% of the damage comes from the mere presence of the exact text of the failed attempt in the context: the model copies what's in front of it more strongly than it responds to the meaning of the error. It's like being shown a photo of the wrong answer and told "don't do this": your eye still latches onto the picture.

The fix: don't paste the failure back in verbatim. Instead, describe the gist of the problem in your own words, without quoting the original. That removes most of the effect at no extra cost. Meanwhile, the instruction "don't repeat this" doesn't work, and wiping the history for a "clean restart" doesn't work either; it actually turns out to be worse.


Method Blueprint

STEP 1: The model makes a failed attempt (code, call, text) → it gets recorded in the history
STEP 2: DON'T paste the verbatim text of the attempt back into the prompt
STEP 3: Describe the gist of the error in your own words → "the problem was that X"
STEP 4: Ask for a new version, explicitly requiring that it not repeat the old one's structure

All of this is a single prompt (the next turn in the conversation), with no API and no code.


Example in Action

Task: You ask Claude to write a Google Sheets formula or an SQL query to pull some data. The model gives you a version, you paste it in, and you get an error. The standard reflex is to copy the error and the code back into the chat.

Prompt (the usual approach, which hurts):

Here's your query:
SELECT name, revenue FROM sales JOIN clients ON sales.client=clients.id

Error: column "client" does not exist

Fix it.

Prompt (based on the study's finding):

The previous version of the query didn't work: you used a column name 
that doesn't exist when joining the sales and clients tables. 

Write a new query for the same task (pull the client name and revenue), 
but don't repeat the JOIN structure from the last attempt; first check 
what the columns linking the two tables are actually called.

Result: in the second case the model doesn't have the exact wrong query staring it in the face, so it doesn't "slide" into repeating it. It gets the diagnosis (what went wrong) without the temptation to copy the failed text itself. In practice this shows up as a more varied answer instead of one stuck on the previous mistake.


Why It Works

Models tend to copy what they've recently seen in the context. It's a fundamental mechanism of transformers (the model "gravitates" toward similar chunks of text that are already nearby). When the failed code or call stays in the history in full, that copying tendency outweighs the logical "don't do this," even when "error" is written clearly right next to it.

At the same time, the model responds well to rephrased descriptions of the problem: remove the trigger itself (the exact error text), and there's nothing for its "eye" to latch onto, so it freely generates a new version.

Control knobs: - Verbatim text vs. your own words: the main lever. Replacing the quote with a paraphrase removes most of the problem. - The "don't repeat" instruction: doesn't work, so don't waste words on it. To follow it, the model has to "keep in mind" a ban on a line that's sitting right in front of it, and models are bad at that. - "Let's start from scratch": a trap. If you just delete the error history but leave the task and prompt the same, the model will most likely give you the very same wrong answer again, because it sees the very same context that led to the error the first time.


Prompt Template

The previous attempt ({what the model was doing}) didn't work.

The problem (in my own words, without quoting the previous version): {gist of the error}

Requirements for the new version: {what should be different}

Write a new {content_type} without repeating the wording or structure 
of the previous attempt.

🚀 Quick start: paste this into the chat:

Here's a principle for giving an LLM corrective feedback: when fixing an error, don't 
quote the failed version verbatim; describe the problem in your own 
words. Adapt this template to my task: {your task}.
Ask me questions to fill in the fields.

[paste the template above]

The LLM will ask what exactly didn't work and what should change, because without that information it can't write an accurate "description of the problem in your own words" without losing the diagnosis.


Limitations

⚠️ Scope of testing: only small models were tested (135 million – 1.7 billion parameters), not top-tier GPT-4/Claude/Gemini. The mechanism (copying from context) is shared by all transformers, but how strong the effect is in large frontier models wasn't checked.

⚠️ Feedback isn't useless: the takeaway isn't "don't give the model information about the error"; it's "don't give it verbatim." If you strip out all diagnostics entirely, it won't help: the model simply won't understand what to fix.

⚠️ "A fresh chat from scratch" is no cure-all: if you just open a new chat and repeat the same prompt after a failure, without changing the wording, then per this finding the model may give you the same wrong result again. You need to change the context, not just delete it.


How They Studied It

The researchers took 6 small instruction-tuned models (135 million – 1.7 billion parameters, 4 different families) and ran them through two environments: a simulation of tool calls (office tasks like "find a contact," "create an event") and real Python code fixing with actual interpreter output. At each decision point they measured the probability the model assigns to repeating the failed action, before and after that failure was written into the history.

To separate "the model didn't understand the error" from "the model is just copying what it sees," they made control versions of the same failed action: with a success message, with a neutral acknowledgment and no verdict, and with no record of the attempt at all. It turned out that 83% of the damage comes from the mere presence of the exact text of the failed attempt, not from the fact that it says "failure."

The most unexpected result: the "obvious" fix, deleting the failed attempt and starting from a clean slate (as earlier literature on "context pollution" recommends), turned out to be the worst of all the options tested. The reason is simple: deleting restores the very same context that led to the error the first time, and in an identical context the model gives an identical answer.


Resources

Esmail Gumaan, University of Passau, Germany. Code, data, and every number in the paper: github.com/Esmail-ibraheem/feedback-that-backfires

Want this for your own case? Apply this study to your task: AI adapts its method to what you are working on and writes the prompt.

Research digest

Key result

6% → 54%: that's how much the chance of repeating a failed call grew once the model saw the exact text of its own failed attempt. Rephrasing the error in your own words lets you fix an LLM's failed attempts without loops of the same mistake over and over. The catch: the model doesn't respond to the meaning of the feedback; it copies what's in front of it. Remove the exact text of the failure, keep only the gist, and the copying effect nearly disappears.

Principle

The rule is simple: never quote the failed version; retell the problem in your own words. The model behaves like a student who copies from the next desk even after being told 'don't copy': the eye latches onto the text, not the meaning of the ban. The copying effect of transformers is stronger than any 'don't repeat this' instruction.

Why it works

83% of the damage comes from the mere presence of the verbatim error text in the context: not the meaning of the message, but its literal presence nearby. The model gravitates toward similar chunks of text it has seen nearby; that's a basic transformer mechanism, and the logic of 'this is wrong' doesn't override it. The 'don't repeat' instruction doesn't work at all: the model would have to hold the ban in mind and the text sitting right in front of it at the same time.

When to apply

For agents and chatbots that fix their own code, SQL queries, or API calls → specifically when the model sees its own failed attempt in the conversation history, especially in automatic retry loops. Not a reason to drop diagnostics entirely: simply removing the feedback works even worse. The model needs the gist of the error, just not as a quote.

Mini recipe

1. Pin down the gist of the error: don't copy the whole code or query; describe in words what went wrong. 2. Remove the quote: the exact text of the failed attempt should disappear from the prompt, leaving only a paraphrase. 3. Add a requirement: explicitly ask it not to repeat the previous version's structure. 4. Restate the task: with the new problem description and the same expected output.

Examples

[BAD]: `Here's your query: SELECT name FROM sales JOIN clients ON sales.client=clients.id. Error: column "client" does not exist. Fix it.` [GOOD]: `The previous version of the query didn't work: it used a column name that doesn't exist when linking the sales and clients tables. Write a new query for the same task, but don't repeat the JOIN structure from the last attempt; first check the actual column names.`

In plain words

When a language model spits out broken code or botches a function call, the standard reflex is to hand it that line back, attach the error text, and say: "fix it." But for transformers this works exactly backwards. Models are fundamentally wired to copy patterns from recent context. For the model, the old failed code in the history isn't a warning; it's a powerful visual anchor that completely drowns out any logical "don't do this" instruction.

It's like teaching a newbie to drive and yelling "just don't hit that pole" while making him stare at it nonstop. The driver's hands automatically steer right into the obstacle. The model sees its own fresh snippet right in front of it, gets stuck on the familiar tokens, and with woodpecker-like persistence repeats exactly the same mistake it just made.

The attention mechanism simply overpowers the negative prompt. To break this vicious cycle, you don't need to scold; you need to clean up the context. What actually works: cutting the failed attempt out of the agent's history, replacing raw code with an abstract description of the problem, or forcing a context reset before the next generation. Once you remove the broken template from the model's field of view, the probability of a successful fix goes up several times over.

The study looked at small agent models and tool calls, but this principle hits everyone. Whether you're writing a complex SQL query, a spreadsheet formula, or setting up an autonomous assistant, blindly pasting the error back into the chat will inevitably drive even top LLMs into an endless loop of self-repetition.

Bottom line: when the code breaks, stop rubbing the model's nose in its own mess. Delete the broken snippet from the prompt, describe the error in words at the level of logic, and ask for a solution from scratch. Less junk in the context means better odds of a working result.

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on Feedback Inversion: Why Quoting an Error Word for Word Makes the Model Repeat It arXiv:2608.23651

Sign in to apply this study New accounts get 50 free credits.