Topic 3 of 5 · 3 min read
Irrelevant material that pulls answers off course
Goal: Identify which irrelevant items steered an answer off-task and remove them without losing needed material.
Context confusion is when extra material that is not needed for the task still steers the answer, even though nothing in it is wrong. The model treats everything in the window as possibly useful, so unneeded items get used.
Check yourself · 1 of 3
You paste a whole handbook to get a two-line email and the reply mentions parking rules. What happened?
Why it matters
It is tempting to add more: another document, another example, a few more tools, just in case. But the model does not know which parts you care about. It tries to use what it was given. A pasted marketing deck can pull a legal summary into sales language. Ten example emails in a different style can pull your draft toward them. An agent with forty tools may call one that does not fit, because it is there. More context is not safer. It is more to misread.
How to spot it
- Check what the answer borrowed. Does it mention a name, a style or a fact from something you did not need?
- Check the examples. Models copy examples closely. If every example is about hotels, a request about hospitals may come out sounding like a hotel.
- Check the tools. If an agent picks the wrong tool, ask how many similar tools it can see.
- Run it clean. Remove the suspect item and try again. If the answer improves, you found the cause.
How to fix it
Include only what the task needs. Name the part that matters: "Use only section 4 of the attached report." Replace a long document with the relevant page. Keep examples few, varied and close to the task.
Before and after
Before: You paste a 40-page company handbook and ask: "Draft a two-line out-of-office message." The reply mentions the dress code and the parking policy.
After: You paste only the leave policy paragraph and ask for the same message. The reply is two lines, about leave.
What goes wrong
- Just in case. Adding everything "in case it helps" makes the useful part harder to find.
- Example anchoring. A single strong example makes every answer look like it.
- Tool overload. Many tools with overlapping descriptions lead to wrong calls.
Confusion differs from poisoning and clash: nothing here is false and nothing disagrees. The material is simply off-topic.
Optional: in a coding agent
Task: fix the date format in invoice.ts
Attached: whole repo (320 files), 3 unrelated style guides
Give the agent the one file and the one rule instead.
Examples
The handbook in the way
A user pastes a full employee handbook to get a short email. The reply quotes dress-code rules. Pasting just the relevant paragraph gives a clean email.
The one-sided examples
Five sample product descriptions, all for luxury watches, are pasted to guide a description for a garden hose. The result sounds like a watch advert. Using two examples from different products fixes the tone.
Key points
- Extra material can steer an answer off course even when every item in it is correct.
- The model tries to use what it is given, so unneeded items often show up in the answer.
- Examples are copied closely, so one strong example can shape every output.
- Too many similar tools make an agent more likely to choose the wrong one.
- Test for confusion by removing the suspect item and running the request again.
Common mistakes
- Pasting whole documents when one section is needed.
- Adding many examples that all look alike.
- Leaving old files and unused tools attached to a new task.
- Treating more context as always safer.
Check yourself · 2 of 3
An agent has forty tools and keeps picking one that does not fit the task. What is a sensible first step?
Check yourself · 3 of 3
Every sample you gave is a formal legal letter, and your new draft for a friendly newsletter sounds stiff. Which change is most likely to help?
Practice items, not counted towards your mastery.
Start here
- How long contexts fail (Drew Breunig) (opens in a new tab)ArticleFree
Names poisoning, distraction, confusion and clash, with examples from real agents.
- How to fix your context (Drew Breunig) (opens in a new tab)ArticleFree
Practical ways to prune, quarantine and summarise context after a failure.
- The lethal trifecta for AI agents (Simon Willison) (opens in a new tab)ArticleFree
Plain explanation of when untrusted content in context can leak private data.
More for this topic
- Lost in the Middle: How Language Models Use Long Contexts (opens in a new tab)PaperFree
Research showing models use information less well when it sits in the middle of a long input.