Apply to my task
arXiv:2606.29718 ★ 79 Jun 29, 2026

Context Rot: Why a Model Starts Giving Up in Long Sessions, and How to Stop It

Key result

A long session, and the model starts writing 'hard to say,' 'not enough data,' 'possibly.' It looks like it ran out of memory. Nope: the context is clogged with dead ends, and the model reproduces their tone. Context Rot, as the researchers named this pattern, explains why a model degrades in long sessions and how to stop it. The method is periodically compressing the history into a progress summary: you open a new chat with that summary, and the model reasons confidently again. No fine-tuning, no plugins, just one prompt.

01

TL;DR

Context Rot is when a model in a long session starts giving up ("I can't find the answer") or giving hedged answers ("as far as I know, it's possible that...") instead of thinking further. The longer the conversation, the more often it happens. The study calls this "context rot" and shows that it's not a bug in any particular model but a systemic problem across all LLMs.

The key finding: the model doesn't just "lose accuracy" in long chats; it changes its behavior. At first it makes more confident mistakes. Then, as the context grows, it starts either flatly refusing ("I can't determine that") or answering with explicit caveats. This isn't because the context window is full: every model stayed within its limit. It's because the accumulated trail of failed attempts weighs on generation. Remove the history of failures, and the model works normally again.

The fix comes in three strategies: periodic compression (ask the model to summarize progress), selective pruning (delete old failures, keep the summary), and filtering out "rotten" answers (out of several attempts, keep only the confident ones). The best result comes from combining compression and pruning.

Want this for your own case? Apply this study to your task: AI adapts its method to what you are working on and writes the prompt.

02

Method Blueprint

Two independent approaches you can use together:

APPROACH A — Context management (within a session)

STEP 1: Run a long conversation → watch for rot signals
         (the model writes "I can't determine," "possibly," "there isn't enough data")
STEP 2: A trigger is hit (N messages OR signals appear) →
         ask the model to compress the context into a summary
STEP 3: Start a new chat with the summary instead of the full history →
         keep going without the "tail" of failures

All steps are done by hand in a regular chat.

APPROACH B — Filtering results (parallel attempts)

STEP 1: Ask the same hard question 3-5 times in separate chats
STEP 2: Look at the type of answer: confident ("here's the answer") vs. gave up ("can't find it")
STEP 3: Keep only the confident answers → compare them against each other

Each request is a separate chat, so there's no cross-contamination.

03

Example in Action

Task: You're doing deep research for a new project, looking for an untapped niche in the US online education market. You're already 40 messages in with Claude. You've started noticing the model writing more and more often "it's hard to say with confidence," "there isn't enough data for a definitive conclusion," "it may be worth checking this yourself."

That's textbook context rot. The model has piled a heap of dead ends from the earlier search into the context, and now it generates with all that uncertainty baked in.

Context-compression prompt (run it every 10-15 messages):

Stop. Before we continue, write a progress summary.

Summary structure:
1. Research goal (one sentence)
2. What we've DEFINITELY established (only high-confidence facts)
3. What we checked and ruled out (dead ends, briefly)
4. What hasn't been checked yet (open questions)
5. The next logical step

Only what you're sure of. No "possibly" or "probably" in items 1-2.

Then open a new chat, paste the summary in as the system context, and continue the research without the dead weight of failures.

Result: The model produces a structured summary of 200-400 words. In the new chat it starts reasoning confidently, without the "tail" of 40 messages full of failed attempts. Answer quality improves noticeably: more specifics, fewer caveats.

04

Why It Works

An LLM generates the next token based on everything that came before it. If the history is full of patterns of failed attempts ("searched, didn't find it," "checked, doesn't fit," "not much data"), those patterns weigh on generation. The model sort of "catches" the tone of the context and starts reproducing it: it gives up or hedges.

LLMs are good at one thing: continuing an established pattern. If the context is the story of confident, methodical research, the model keeps going in the same spirit. If the context is a dump of attempts and failures, it reproduces the uncertainty.

Compressing the context removes the failure pattern and leaves only progress. The model looks at a clean summary of achievements and keeps working productively. Not because it "remembers less," but because the pattern it relies on is now a healthy one.

Control knobs: - Compression frequency → every 10 messages is expensive, every 20 is a compromise. One compression at the end beats none - Filter strictness → "only high-confidence facts" in the prompt strips out junk more aggressively than just "takeaways" - Number of parallel attempts → 3 is enough for simple tasks, 5-8 for critical decisions - Rot signals → marker words: "possibly," "hard to say," "not enough data," "can't determine" serve as triggers for compression

05

Prompt Template

Template A — Periodic context compression:

Stop. Write a summary of our progress on the task: {task}.

1. What's definitely established (confident conclusions only)
2. What we checked and ruled out
3. What remains open
4. The next priority step

No "possibly" or "most likely" in items 1-2.
If you're not sure, put it in item 3, not item 1.

Template B — Rot-aware filter for parallel attempts:

Rate this answer on one criterion: did the model answer CONFIDENTLY or did it GIVE UP?

Confident answer: gives a concrete result; the reasoning leads to a conclusion
Gave-up answer: "I can't determine," "there isn't enough data," an answer full of constant caveats

Answer to rate:
{paste the model's answer}

Output: CONFIDENT / GAVE UP + one sentence explaining why.

Placeholders: - {task} — what you're researching/writing/analyzing - {paste the model's answer} — copy the answer you want to check for rot

🚀 Quick start — paste into a chat:

Here's a template for fighting context degradation in long sessions. 
Adapt it to my task: {your task}.
Ask me questions to set it up properly.

[paste the template above]

The LLM will ask about compression frequency and the type of task, because the trigger for a "stop and summarize" depends on how fast junk piles up in your particular workflow.

06

Limitations

⚠️ Simple tasks: You don't need the method for short conversations (under 10-15 messages). Rot sets in during long research sessions.

⚠️ Context isolation (sub-agents): Delegating tasks to separate "specialists" (separate chats) depends heavily on the model; with weaker models it can make results worse. It only works well with top-tier models.

⚠️ Compression kills details: The model may leave out important details from the summary that turn out to matter later. If the task requires reproducing every step exactly, write the summary yourself; don't trust the model with it.

⚠️ Parallel attempts are token-hungry: The "5 times with filtering" approach multiplies your spend by 5. For quick requests, it's overkill.

07

Resources

Title: Diagnosing and Mitigating Context Rot in Long-horizon Search (2025)

Authors: Shijie Xia, Yikun Wang, Zhen Huang, Pengfei Liu

Organizations: Shanghai Jiao Tong University, Fudan University, SII, GAIR

Code: https://github.com/GAIR-NLP/ContextRot

Related concepts: ReAct framework (Yao et al., 2023), FoldAgent (Sun et al., 2025)

Research digest

Key result

A long session, and the model starts writing 'hard to say,' 'not enough data,' 'possibly.' It looks like it ran out of memory. Nope: the context is clogged with dead ends, and the model reproduces their tone. Context Rot, as the researchers named this pattern, explains why a model degrades in long sessions and how to stop it. The method is periodically compressing the history into a progress summary: you open a new chat with that summary, and the model reasons confidently again. No fine-tuning, no plugins, just one prompt.

Principle

An LLM generates each next answer based on everything that came before. If the history is a dump of 'tried, didn't find it' and 'not much data,' the model continues that pattern. Three levers: periodic compression (ask the model to summarize progress), pruning failures (delete old history, keep the summary), filtering by confidence (out of several parallel attempts, keep only the ones where the model gets specific). Remove the history of failures and you remove the infected pattern. It's like rewriting a draft on a fresh sheet: you don't lose the substance, but you shed the dead weight.

Why it works

The model doesn't 'think'; it continues a pattern. If 30 of the 40 messages in the history contain failed attempts, the odds that the next answer will be confident drop sharply. And it's not that the context window is full: in the experiments, every model stayed within its limit. Compression changes the pattern itself: instead of a dump of failures, a clean summary of achievements. The model looks at a healthy history and keeps working productively.

When to apply

Long analytical and research sessions: market analysis, writing long texts, strategic reasoning and deep brainstorming, especially once a session passes 15-20 messages and the model starts hedging every answer. Not needed for short conversations under 10 messages, where context rot doesn't have time to set in. The parallel approach with multiple chats only works well with top-tier models; with weaker ones it can make results worse.

Mini recipe

1. Watch for degradation signals: marker words like 'possibly,' 'hard to say,' 'not enough data,' 'can't determine.' Two or three such answers in a row are your trigger to act. 2. Stop the session and ask for a summary: paste the compression prompt right into the current chat, and the model will write up the progress so far. 3. Open a new chat with the summary: paste the summary in as the starting context instead of the full history. Keep going without the tail of failures. 4. For critical decisions, use parallel attempts: ask the same question in 3-5 different chats. Keep only the confident answers, the ones where the model gets specific without caveats. Compare them against each other.

Examples

[BAD]: `Keep researching the US online education market` [GOOD]: `Stop. Write a progress summary for our task: finding niches in the online education market. 1. What's definitely established (confident conclusions only) 2. What we checked and ruled out, briefly 3. What remains open 4. The next priority step No 'possibly' or 'most likely' in items 1-2. If you're not sure, put it in item 3.` Then you open a new chat and paste this summary in as the start of the conversation, without the previous 40 messages.

In plain words

The Context Rot problem isn't just a bug; it's a fundamental flaw in how AI models "think." When you run a long conversation, the model doesn't simply read the message history, it literally soaks up its mood. If early in the search it failed to find an answer a couple of times or gave a cautious "possibly," that pattern of uncertainty snowballs. In the end, the LLM turns into a burned-out employee who answers any hard question with: "I don't know, there's no data, look it up yourself," even though the answer is buried somewhere in the documents.

It's as if you went to a doctor who had just seen thirty hypochondriacs before you. Even if you show up with an actual broken bone, the doctor, having "caught" the mood of the previous whiners, starts doubting the obvious and prescribes chamomile tea instead of a cast. On paper, he's doing his job, but his brain is already tuned to the uselessness frequency, and he just replays that script without bothering to dig into your problem.

To cure this slump, the researchers propose two methods: Self-Correction and Context Filtering. The first is when you make the model double-check its "excuses": if it says there's no info, you slap its wrist and make it search again until it delivers specifics. The second, context filtering, works like a history cleanup: all its past "oops, couldn't find it" and "probably" moments get tossed out of the model's memory so these uncertainty patterns don't poison fresh answers.

It was tested on deep information search, but the principle of context degradation applies to any long stretch of work with AI. Whether it's writing code, where the model starts churning out bugs by line 50, or complex market research, anywhere a conversation drags on, there comes a point when the AI "gets dumber" simply because it got used to failing in earlier messages. SEO for AI brains now means cleaning out that junk in time; otherwise even the most powerful model turns into a useless advisor.

Bottom line: if your Claude or GPT has started mumbling and dodging the question, it's not that you're asking bad questions, it's that its context has rotted. You either need to firmly demand it reconsider its conclusion or clean the "junk" doubts out of the history. If you don't filter out that negative experience, the model will shut down completely, and you'll spend your time reading polite apologies instead of getting real work done.

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on Context Rot: Why a Model Starts Giving Up in Long Sessions, and How to Stop It arXiv:2606.29718

Sign in to apply this study New accounts get 50 free credits.