Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Define context pollution in a multi-step agent and explain why it degrades reasoning quality. Describe three distinct mitigation strategies with their tradeoffs.
Context pollution is the buildup of stale, noisy, or contradictory history that drowns the signal an agent needs. Fix it by compacting, summarising, and retrieving instead of appending.
Imagine taking notes on one long scroll while solving a hard problem. Every wrong turn, every dead end, every typo stays on the scroll. By hour two the scroll is enormous, and your useful notes are buried between eight crossed-out attempts and a paragraph you no longer care about. When you glance back to decide your next move, your eye lands on the failures instead of the goal, and you repeat a mistake. An agent has the same scroll: its context window. Each step appends more text, including failed tool calls and outdated results. Eventually the noise outweighs the signal, and the model reasons worse than it did at step three. The fix is to keep the scroll tidy: summarise old sections, drop dead ends, and pull back only the notes that matter right now.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Define pollution and separate it from overflow, name lost-in-the-middle and stale-entry misdirection as the two harm mechanisms, then walk summarisation, compaction, scratchpad memory, and sub-agent isolation with one tradeoff each, and close on retrieval over replay.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating pollution as only a token-cost problem. The deeper harm is degraded reasoning: stale and contradictory entries actively mislead the model, not just inflate the bill.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.