Context Rot: Why 1M-Token Windows Still Reward Compact Data
Context rot: LLM accuracy degrades as input grows, even on simple tasks. What Chroma's 18-model study found and why smaller, structured payloads still pay off.
Context rot is the loss of accuracy LLMs show as their input gets longer, even on simple tasks. A 1M-token window lets you send more, but it doesn't make every token equally useful. Smaller, well-structured payloads still get better answers, so compact data formats keep paying off in the long-context era.
What is context rot?
The term comes from Chroma's technical report Context Rot: How Increasing Input Tokens Impacts LLM Performance (Kelly Hong, Anton Troynikov and Jeff Huber, July 14, 2025). It tested 18 LLMs, including GPT-4.1, Claude 4, Gemini 2.5 and Qwen3, and found that "model performance varies significantly as input length changes, even on simple tasks."
The usual assumption is that a model handles "the 10,000th token just as reliably as the 100th." Chroma's finding is that it doesn't. Performance "grows increasingly unreliable as input length grows," and degrades "often in surprising and non-uniform ways."
Anthropic uses the same term in its context engineering guide: "as the number of tokens in the context window increases, the model's ability to accurately recall information from that context decreases." It adds that "this characteristic emerges across all models," and traces it to the transformer architecture, where every token attends to every other token, creating n² pairwise relationships for n tokens.
What did Chroma's 18-model study find?
Chroma deliberately kept tasks simple, so that only input length changed. The main results:
| Experiment | Finding | What it means for your prompts |
|---|---|---|
| Needle-question similarity | Lower similarity between question and answer speeds up degradation | Indirect questions suffer most in long contexts |
| Distractors | Impact is non-uniform and "amplifies as input length grows" | Near-duplicate records are worse than unrelated filler |
| Haystack structure | Shuffled haystacks beat logically coherent ones across all 18 models | Layout of context affects how attention is applied |
| LongMemEval (~113k vs ~300 tokens) | Significantly higher accuracy on focused prompts for every model | Irrelevant history costs accuracy, not just money |
| Repeated words | Even text replication becomes non-uniform as length grows | No task is too simple to be affected |
The LongMemEval result is the most practical one. The full prompts averaged about 113k tokens, "mostly" content irrelevant to the question. The focused versions averaged about 300 tokens and contained only what was needed. "Across all models, we see significantly higher performance on focused prompts compared to full prompts." Thinking modes narrowed the gap but did not close it.
The haystack-structure result is counterintuitive: "Shuffling the haystack and removing local coherence consistently improves performance." Don't over-read it. It is about essay text, not data tables. It does show that how context is laid out changes results, not just how much of it there is.
If windows are 1M tokens, why compress at all?
Because window size and usable context are different numbers. Claude 4.6 and later models include the full 1M-token context window at standard pricing. As Anthropic puts it, "a 900k-token request is billed at the same per-token rate as a 9k-token request." That removes the long-context surcharge. It does not remove context rot.
There are three separate reasons to keep payloads small:
- Accuracy. Every token draws on what Anthropic calls the model's "attention budget." Chroma's data shows the effect is measurable on every model tested.
- Cost. A flat rate is still a rate. At Claude Sonnet 5.5's $2 per million input tokens (pricing checked October 2026), a 900k-token prompt costs $1.80 per call before output. An agent loop that resends it 20 times spends $36 on input alone.
- Latency. Prefill time grows with input length, and in an agent loop it is paid on every turn.
Tokenizers matter too. Anthropic says its Claude 4.7+ tokenizer "produces approximately 30% more tokens for the same text" (source). The same JSON file fills more of the window than it used to. We covered that in Claude's new tokenizer and your token count.
How does compact structured data help?
Context rot depends on input length and on how much of the input is noise. Compact formats attack length for data you have to include anyway. In JSON, a large part of every uniform array is repeated keys, quotes and braces. Those are tokens the model has to read past without learning anything new.
Here are three orders with a nested customer object, in pretty JSON:
{
"orders": [
{
"id": "A-1001",
"customer": { "name": "Ada Lovelace", "country": "UK" },
"status": "shipped",
"total": 129.5
},
{
"id": "A-1002",
"customer": { "name": "Grace Hopper", "country": "US" },
"status": "pending",
"total": 48
},
{
"id": "A-1003",
"customer": { "name": "Alan Turing", "country": "UK" },
"status": "refunded",
"total": 310.25
}
]
}And the same data as TOON, generated with @toon-format/toon 4.1.1. TOON v4's nested field groups keep the customer object inside the table:
orders[3]{id,customer{name,country},status,total}:
A-1001,Ada Lovelace,UK,shipped,129.5
A-1002,Grace Hopper,US,pending,48
A-1003,Alan Turing,UK,refunded,310.25Field names appear once, and the row count is declared up front. On the official benchmark's current run (spec v4.1, 5,856 calls across four models), TOON used 42.6% fewer tokens than JSON at 72.2% vs 71.4% accuracy. On the contacts dataset, which uses nested field groups like this, the token-efficiency results show 66.5% fewer tokens than JSON. See TOON nested field groups for the syntax, and the TOON token calculator to measure the difference on your own data.
What compact formats don't fix
Be precise about the claim. A compact format shortens the same content. It does not make irrelevant content relevant, and Chroma's strongest result, focused versus full prompts, is about relevance. Trimming 113k tokens of mostly irrelevant history by 40% still leaves tens of thousands of tokens of noise.
Distractors also survive any encoding. If your context holds five near-identical customer records and the question is about one of them, TOON makes all five cheaper but not less confusing. Deduplicate and filter first.
And format choice has its own trade-offs. On deeply nested or irregular data, compact JSON can match or beat TOON, and the "Notation Matters" study found TOON cost about 9 percentage points of accuracy in multi-turn agentic benchmarks on open-weight models. Test on your own model and task.
A long-context playbook that accounts for context rot
- Retrieve narrowly. Send the records that answer the question, not the table they live in.
- Remove distractors. Deduplicate near-identical rows and drop stale versions of the same entity.
- Project fields. Strip columns the task never reads.
- Encode by shape. TOON for uniform or mostly uniform arrays, compact JSON for irregular trees.
- Clear old tool results in agent loops so history doesn't grow without bound.
- Evaluate at your real input length. A prompt that works at 5k tokens may not at 500k.
Steps 1, 2 and 5 are context engineering in the sense of choosing the right tokens, which we cover in context engineering: picking the right tokens. Steps 3 and 4 make the tokens you keep cheaper. For fitting large datasets into a fixed budget, see context window management with TOON.
Frequently Asked Questions
What is context rot?
Context rot is the drop in an LLM's reliability as its input grows longer, even when the task itself stays the same. Chroma measured it across 18 models in 2025, and Anthropic describes it as the model's ability to accurately recall information decreasing as the number of tokens in the context window increases.
Do 1M-token context windows fix context rot?
No. A larger window raises the ceiling on how much you can send, but it does not make the model use every token equally well. Chroma found performance degrades with input length on every model it tested, so a focused prompt still beats a long one that contains the same answer.
Does a compact format like TOON prevent context rot?
It reduces one cause, input length, for the same data. The official TOON benchmark measured 42.6% fewer tokens than JSON at similar accuracy. It does not remove irrelevant content or distractors, so pair it with filtering and retrieval rather than treating it as a fix on its own.
Is long context still worth paying for?
Yes, when the task needs it, such as reasoning across a whole codebase or long document. Claude 4.6 and later models bill the full 1M window at standard per-token rates. The point is to fill it with relevant, compact data, not to fill it because it is there.
Recommended Reading
Context Engineering: Pick the Right Tokens, Not Just Fewer
Context engineering means curating the smallest set of high-signal tokens. How data format, tool-result clearing and just-in-time retrieval work together.
Claude Opus 5.5 and Sonnet 5.5: Cheaper Data Prompts
Claude Opus 5.5 costs $4/$20 and Sonnet 5.5 $2/$10 per 1M tokens, with cheaper cache reads. How to send tabular context to Claude 5.5 with TOON and caching.
Claude's New Tokenizer Uses ~30% More Tokens: What to Do
Claude's new tokenizer (Opus 4.7 and later) yields about 30% more tokens for the same text. What it does to your bill and why compact data formats help.