trendingzones
← Back to the Intermediate level

AI & ML — ADVANCED

Context Engineering in Production: Context Rot & Multi-Agent Isolation

At production scale, context engineering stops being about one prompt and starts being about an entire system: degradation that isn’t explained by position alone, and architectures built specifically to contain it.

The Quick Answer

Long-context failure isn’t one effect — it’s at least two, separately documented ones. The “lost in the middle” effect is positional: accuracy depends on where a fact sits. “Context rot” is different — accuracy degrades as total input length grows, even when the relevant fact stays put in a favorable position. In production, teams fight both at once, often by restructuring the entire agent architecture — splitting work across isolated subagents rather than trying to fit everything into one ever-growing context.

Context Rot: A Separate Failure Mode

Chroma’s 2025 research tested 18 frontier models — including GPT-4.1, the Claude 4 family, Gemini 2.5, and Qwen3 — specifically isolating length from position. They held a target fact at a fixed, favorable spot in the context and only varied how much surrounding text there was. Performance still degraded, and non-uniformly: adding distractor sentences that merely resembled the target information reduced accuracy further than distractor-free text of the same length, and models varied significantly in how gracefully they handled it.

Source: Chroma Research, “Context Rot: How Increasing Input Tokens Impacts LLM Performance”

Try it below: the target fact stays at the easiest possible position — the very start — the whole time. Only the number of distractor sentences around it changes.

Case Study: Anthropic’s Multi-Agent Research System

Anthropic’s own research system is a direct, production answer to context rot: an orchestrator-worker architecture where a lead agent (Claude Opus 4) decomposes a research task and spawns subagents (Claude Sonnet 4), each with its own self-contained task description and — critically — its own isolated context window. A subagent doesn’t know other subagents exist and can’t see their intermediate work; it explores its slice of the problem independently, then returns only a condensed summary to the lead agent.

The measured result: this multi-agent setup outperformed a single-agent Claude Opus 4 by 90.2%on Anthropic’s internal research evaluation. In their own analysis of what drove performance on the BrowseComp benchmark, token usage alone explained about 80% of the variance— with tool-call count and model choice explaining most of the rest. The trade-off is real, though: multi-agent systems used roughly 15× more total tokens than a single chat turn to get there. It’s a deliberate spend, not a free win — isolated context per subagent costs more tokens overall in exchange for each individual context staying small, focused, and free of cross-talk.

Source: Anthropic, “How We Built Our Multi-Agent Research System”

When to Reach for This

Isolated subagent context isn’t free, so it’s not the default choice for every task. It earns its 15× token cost specifically on tasks that genuinely decompose into independent, parallelizable sub-investigations — broad research questions, not tightly sequential ones where each step depends on the previous step’s full detail. For anything narrower, the compaction and structured note-taking techniques from the Intermediate level are usually the cheaper, sufficient answer.

Fun Fact

Anthropic’s subagents are deliberately kept in the dark about each other by design — not a limitation they’re working around, but the actual mechanism that makes parallel execution possible. A subagent that knew about its siblings’ work would need that work in its own context to make sense of it, defeating the entire point of keeping each context small and focused.

Test Yourself

How is "context rot" different from the "lost in the middle" effect?

In Chroma’s 2025 research, what is one factor shown to affect how quickly performance degrades with length?

By what margin did Anthropic’s multi-agent system (Opus lead + Sonnet subagents) outperform a single-agent Opus setup on their internal research eval?

According to Anthropic’s multi-agent research writeup, what single factor explained about 80% of the performance variance?

Why do subagents in an orchestrator-worker architecture each get their own isolated context window?