Back to Blog
November 9, 2026

The short version: context rot is the drop in an LLM's accuracy as its input gets longer, even when the task stays just as easy and the answer is still in the prompt. The term was popularized in mid-2025 by a Chroma technical report that tested 18 models on length-controlled tasks and found performance "grows increasingly unreliable as input length grows." Proposed causes include attention spread across more token pairs, training data that skews short, weak recall in the middle of long inputs, and distractors that look like the answer. The practical fix is to send the model less: retrieve, compact, or decompose the input so each call sees a short, focused context.

What does "context rot" actually mean?

It names a gap between two numbers on a model card: how many tokens a model accepts, and how many it can use reliably. A model with a 1M-token window will take a 900K-token prompt without error. Context rot is the observation that its answers on that prompt are worse than its answers on the same question with a short prompt.

The phrase spread through practitioner talk about long chat sessions and bloated coding-agent histories before it had a formal definition. Chroma's July 2025 report, "Context Rot: How Increasing Input Tokens Impacts LLM Performance" by Kelly Hong, Anton Troynikov, and Jeff Huber, gave it a measured one. Anthropic's context engineering guide uses a short version: "as the number of tokens in the context window increases, the model's ability to accurately recall information from that context decreases," and adds that the effect "emerges across all models," some more gently than others.

Alex Zhang, first author of the RLM paper, argues in his blog post that the recall definition "doesn't fully hit the mark," because frontier models score well on retrieval benchmarks like RULER and still feel worse as a conversation grows. A working definition that covers both: context rot is any loss of accuracy that comes from input length itself, separate from task difficulty.

What evidence shows performance falling as input grows?

Four lines of work, each controlling for a different confound.

  • Position effects (2023). "Lost in the Middle" (Liu et al., TACL) tested multi-document QA and key-value retrieval. Performance was "often highest when relevant information occurs at the beginning or end of the input context," and dropped significantly when the answer sat in the middle, "even for explicitly long-context models."
  • Claimed vs effective length (2024). RULER (Hsieh et al., COLM 2024) ran 17 long-context models on 13 tasks, adding multi-hop tracing and aggregation to plain needle retrieval. Models scored near-perfect on vanilla needle-in-a-haystack, yet "almost all models exhibit large performance drops as the context length increases." All claimed at least 32K tokens; only half kept satisfactory performance at 32K.
  • No literal matches (2025). NoLiMa (Modarressi et al., ICML 2025) wrote needles that share almost no words with the question. Of 13 models claiming 128K or more, 11 fell below 50% of their short-context baselines at 32K. GPT-4o went from 99.3% to 69.7%.
  • Length-only controls (2025). Chroma held task difficulty fixed and varied only input length, across 8 lengths and 11 needle positions, 194,480 calls in total. Its summary: "Across all experiments, model performance consistently degrades with increasing input length."

The RLM paper (Zhang, Kraska, and Khattab) uses this as its starting point. It says frontier reasoning models "tend to exhibit context rot," citing Chroma, and its Figure 1 scales inputs from 2^13 to 2^20 tokens (about 8K to 1M). GPT-5 "degrades significantly as a function of both input length and task complexity."

Why do LLMs get worse with longer inputs?

Nobody has one confirmed cause. These are the mechanisms the sources propose, and the evidence behind each.

  1. A finite attention budget. Anthropic's guide notes that a transformer creates "n² pairwise relationships for n tokens," and that as length grows the model's ability to capture them "gets stretched thin." More tokens means less focus on any one of them.
  2. Short training data. The same guide says models learn attention patterns from distributions "where shorter sequences are typically more common," so they have "fewer specialized parameters for context-wide dependencies." Position interpolation stretches a model past its trained length, "with some degradation in token position understanding."
  3. Position bias. Liu et al.'s U-shaped curve means facts in the middle of a long prompt are recalled less reliably than facts at the edges.
  4. Semantic, not lexical, matching. NoLiMa's authors attribute the drop to "increased difficulty the attention mechanism faces in longer contexts when literal matches are absent." Chroma found the same: lower needle-question similarity made accuracy fall faster with length.
  5. Distractors. Chroma found that text topically close to the answer, but wrong, hurt more as length grew, and different distractors hurt by different amounts.

One Chroma result does not fit a simple story. Models did better when the haystack sentences were shuffled than when they kept their logical flow, across all 18 models. Context rot depends on what fills the window, not only how much. For the deeper case that dense tasks break attention, see why context windows are the wrong abstraction.

What does context rot look like in a real workload?

Chroma's LongMemEval experiment is the closest thing to a production chat assistant. It used 306 questions about a user's chat history. Each question had two versions:

  • Full: the whole history, averaging about 113K tokens, mostly irrelevant to the question.
  • Focused: only the relevant turns, averaging about 300 tokens.

Same question, same facts, same model. Across all models, the report found "significantly higher performance on focused prompts." Thinking modes helped on both versions but did not close the gap. Claude models showed the widest gap, mostly from abstaining: Claude Sonnet 4 answered a date-difference question by saying the dates "are not provided in the chat history," when they were.

The lesson for anyone building on long histories: the full prompt makes the model do two jobs at once, find the relevant turns and then reason over them. The focused prompt only asks for the second.

How do practitioners reduce context rot?

Every working fix shrinks what one model call has to read. They differ in who decides what to keep, and when.

  • Retrieval. An embedding index picks the chunks before the call. Cheap and fast, but the choice is made once, from the query alone. Our RLM vs RAG comparison covers where that breaks.
  • Just-in-time loading. Anthropic describes agents that keep "lightweight identifiers (file paths, stored queries, web links, etc.)" and load data with tools only when needed.
  • Compaction. Summarize old turns and restart with the summary. It works for linear sessions, but a summary loses detail it did not know would matter. See RLM vs context compaction.
  • Sub-agents. Specialized agents explore with clean windows and return a condensed result, which Anthropic puts at "often 1,000-2,000 tokens."
  • Recursive decomposition. An RLM stores the prompt as a variable in a REPL. The root model writes code to slice and search it, then sends short chunks to sub-calls. In one trajectory in the RLM paper, the model classified data "using sub-LM calls over smaller chunks of the input (to avoid context rot and mistakes in larger contexts)."

A short checklist before you send a long prompt:

  1. Measure your own task at two lengths: the full input and a hand-trimmed focused input. If the gap is large, you have context rot.
  2. Put the instruction and the key facts at the start or end, not the middle.
  3. Remove near-miss distractors (old versions, similar records) before the call, not after.
  4. If the answer needs many scattered parts of the input, split the work so each call reads one part, then combine results in code.
  5. Do not trust a needle-in-a-haystack score as proof that a model handles your length. RULER and NoLiMa show the gap.

The bottom line

Context rot is the measured fact that a model's accuracy depends on how long its input is, not just on whether the answer is in it. Four independent studies from 2023 to 2025 show the drop, from position bias to plain length effects on trivial tasks. The causes are still debated. The fix is not. Keep each model call short and focused, and let retrieval, compaction, or recursion decide what goes in.

References & Further Reading

  1. Hong, K., Troynikov, A., Huber, J. "Context Rot: How Increasing Input Tokens Impacts LLM Performance." Chroma technical report, July 14, 2025. 18 models, length-controlled tasks, LongMemEval focused vs full prompts, shuffled haystack result. research.trychroma.com/context-rot
  2. Liu, N. F., et al. "Lost in the Middle: How Language Models Use Long Contexts." TACL, 2023 (arXiv:2307.03172). Recall is highest at the start and end of the input. arxiv.org/abs/2307.03172
  3. Hsieh, C.-P., et al. "RULER: What's the Real Context Size of Your Long-Context Language Models?" COLM 2024 (arXiv:2404.06654). 17 models, only half satisfactory at 32K. arxiv.org/abs/2404.06654
  4. Modarressi, A., et al. "NoLiMa: Long-Context Evaluation Beyond Literal Matching." ICML 2025 (arXiv:2502.05167). 11 of 13 models below 50% of baseline at 32K; GPT-4o 99.3% to 69.7%. arxiv.org/abs/2502.05167
  5. Zhang, A. L., Kraska, T., Khattab, O. "Recursive Language Models." arXiv:2512.24601. Cites context rot as motivation; GPT-5 degrades with input length and task complexity. arxiv.org/abs/2512.24601
  6. Zhang, A. "Recursive Language Models." Author blog, 2025. Argues the recall definition of context rot is incomplete. alexzhang13.github.io/blog/2025/rlm
  7. Anthropic. "Effective context engineering for AI agents." Anthropic Engineering. Definition of context rot, attention budget, just-in-time loading, compaction, sub-agents. www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
FAQ

Frequently asked questions

Who coined the term context rot?

No source we found shows who first used the phrase. Chroma's July 2025 technical report by Hong, Troynikov, and Huber gave it a measured definition across 18 models. Anthropic and the RLM authors both cite that framing.

Does a bigger context window fix context rot?

No. RULER found that only half of models claiming 32K or more tokens kept satisfactory performance at 32K. A larger window raises the hard limit but does not stop accuracy from falling well before it.

Do reasoning or thinking models avoid context rot?

They reduce it but do not remove it. Chroma found thinking modes improved both short and long versions of LongMemEval questions, yet the gap between them stayed. NoLiMa reported that reasoning models and chain-of-thought prompting still struggled at long lengths.

Is context rot the same as the lost-in-the-middle effect?

Lost in the middle is one part of it. It describes recall that depends on where a fact sits in the prompt. Context rot is broader and includes drops from length alone, distractors, and weak semantic matching.

How can I test my own application for context rot?

Run the same questions twice: once with the full input and once with only the relevant passages. Hold the model and prompt template fixed. A large accuracy gap between the two runs is context rot in your workload.