All guides

Why your LLM forgets rules in long chats, and why repeating them in the same thread fails

Your AI chat follows every constraint for the first three turns, then starts ignoring turn-1 rules by turn 10 with over 85% of its context window still empty. When you paste “read my instructions again” at the bottom of the thread, it apologizes and repeats the exact same mistake because its own wrong earlier drafts still sit in history.

  • Multi-turn chats drop 39% in average accuracy across 15 frontier models (arXiv:2505.06120) because the model anchors on its own bad early drafts.
  • Re-pasting your rules at the bottom of a derailed GPT-4o thread recovers only 51.6% of lost accuracy (76.6%), while a clean state reset without wrong drafts recovers 93.8% (90.9%).
  • Replacing stale tool logs with short receipts, resetting state cleanly, and moving tangents into side threads cuts turn-12 prompt size from 20,530 to 2,710 tokens and lowers 12-turn token spend by 67.1%.

Why long chats rot early

Advertised 128K and 200K token limits measure how much text an API accepts without throwing an error, not how much the model weighs reliably. On the NoLiMa benchmark (arXiv:2502.05167), 11 of 13 models claiming 128K+ windows drop below half their short-prompt baseline by 32K tokens (25.0% full), and GPT-4o falls from 99.3% to 69.7%.

Multi-turn chat rots even faster because the model writes half the prompt itself. Across 200,000+ conversations on 15 models (Laban et al., arXiv:2505.06120), splitting one task across turns cuts mean accuracy by 39% and raises unreliability by 112%, including on reasoning models like o3 and DeepSeek-R1 whose 33% longer replies inject extra early guesses.

  • Self-poisoning from early drafts: When turn 1 leaves any detail open, the assistant guesses early and treats its own verbose draft as ground truth on later turns.
  • Near-match distractors hurt worst: Chroma's 18-model Context Rot study shows superseded code drafts and near-match logs confuse attention far worse than random filler.
  • Middle-turn blind spot: As logs and detours pile up, early constraints slide into the middle of the prompt where recall drops by 20+ percentage points (Liu et al., arXiv:2307.03172).

Why repeating rules fails

Most developers try to rescue a derailed chat by pasting “remember my instructions” at the bottom of the thread. Every LLM API still resends the entire messages[] array on the next call, so your 200-token reminder has to outvote thousands of tokens of wrong assistant code and stale apologies right above it.

Four-bar comparison chart showing GPT-4o dropping from 93.0 percent in single-turn to 59.1 percent in multi-turn chat, recovering to only 76.6 percent when rules are repeated in the same chat, and jumping to 90.9 percent on a clean reset without wrong assistant draftsGPT-4o accuracy on identical tasks (arXiv:2505.06120)Single-turn spec93.0%Multi-turn chat59.1%Re-paste rules in same chat76.6%Clean reset without bad drafts90.9%

Table 2 of Laban et al. isolates the exact culprit by testing whether repeating user instructions in-place (Recap) matches carrying those exact same user instructions into a clean turn without prior assistant replies (Concat). Dropping the assistant's wrong drafts recovers nearly the entire accuracy loss on both GPT-4o and GPT-4o-mini.

Conversation strategyGPT-4oDrop recoveredGPT-4o-miniWhy it helps or fails
Single-turn full spec (Full)93.0%Baseline86.8%All user requirements arrive up front with zero wrong assistant drafts.
Normal multi-turn chat (Sharded)59.1%0.0%50.4%Early assistant guesses stay in history and anchor every later reply.
Repeat user rules every turn (Snowball)65.3%18.3%61.8%User rules repeat on each turn, yet verbose wrong replies still pile up.
Re-paste all rules at bottom (Recap)76.6%51.6%66.5%Fresh recap sits at the bottom, while failed assistant drafts remain above.
Clean reset with verified rules (Concat)90.9%93.8%84.4%Carries verified user requirements into a clean turn and drops bad drafts.

12-turn context audit

To see how fast noise takes over a real debugging loop, model a deterministic 12-turn session: an 800-token system spec, eight 1,400-token log or tool dumps, three superseded wrong assistant drafts (2,110 tokens), and a 3-turn OAuth side tangent on turns 8 to 10 (4,975 tokens). By turn 10, the prompt holds 19,105 tokens (leaving 85.1% of a 128K window and 90.4% of a 200K window empty), and by turn 12 three-quarters of the 20,530-token prompt is pure distraction.

Stacked bar comparison of turn-12 prompt tokens showing 75.4 percent noise in a 20,530-token append-only chat versus 2,710 clean signal tokens with state reset and side-thread isolationTurn-12 prompt compositionAppend-only chat (20,530 tok)75.4% noiseSignal 24.6%Stale logs 40.9%Tangent 24.2%DraftsState reset + side thread (2,710 tok)0.0% noiseSignal 100%
History strategyTurn-12 promptTurn-12 noise12-turn billedToken changeWhat changes
Append-only chat20,530 tok15,485 tok (75.4%)149,120 tokBaselineKeeps 8,400 tok of old logs, 4,975 tok of tangents, and 2,110 tok of bad drafts.
Re-paste rules in same chat20,850 tok15,485 tok (74.3%)149,440 tok+0.2%Adds a 320-tok rule recap at turn 12 while leaving all 15,485 noise tokens intact.
Clear old tool dumps only9,810 tok4,765 tok (48.6%)87,480 tok-41.3%Swaps logs older than 1 turn for 60-tok receipts, leaving wrong drafts and tangents.
State reset + side thread2,710 tok0 tok (0.0%)49,020 tok-67.1%Compacts verified facts into a 240-tok state note and isolates the 3-turn tangent.

Four fixes that work

Whether you chat in a browser UI or build an agent loop against an API, treat context like working memory rather than an append-only log. Combine these four habits whenever a thread passes six to eight turns.

1. Edit or reset instead of arguing in-place

When the model writes a wrong draft, do not reply 'no, follow rule 2' underneath it. Edit your earlier message to branch above the mistake, or start a fresh chat with only verified constraints.

2. Carry a 6-line verified state note

Distill active rules, confirmed facts, and ruled-out dead ends into one compact state block. Listing dead ends in one line stops the model from suggesting them again without replaying failed code.

3. Replace stale logs with 60-token receipts

In agent harnesses, raw stack traces and JSON tool outputs are only needed on the turn they run. Swap tool outputs older than two turns for a one-line receipt, and compact in batches to protect prompt caches.

4. Open separate side threads for tangents

Never ask 'wait, how does PKCE S256 work?' inside your main implementation thread. Ask subtopic detours in an isolated side chat so tangent tokens never enter your main context window.

Copyable 6-line state reset note for starting a fresh thread cleanly:

Goal: Add PKCE S256 check to /oauth/token without changing session TTL.
Hard rules: Standard library crypto only; preserve HTTP 400 error codes.
Confirmed facts: S256 base64url strips '=' padding; verifier is 43..128 chars.
Ruled-out dead ends: Do not store raw code_verifier in Redis or cookies.
Last tool receipt: pytest tests/test_pkce.py passed 5/6 (padding case failed).
Next step: Fix unpadded base64url comparison in verify_pkce_challenge().

On API agents, compact in 8-turn batches instead of sliding messages[-10:] every turn to keep prompt cache prefixes and cut first-token prefill wait. Pair clean history with RAG retrieval checks, first-bad-step trace debugging, and the full guides index.

Study complex topics without derailing one giant chat

Learning a hard subject in normal AI chat hits the exact same context rot: either one long thread forgets your level, or twenty separate tabs lose your place. Topic Breakdown keeps one clean chapter roadmap while letting you highlight any phrase to open an isolated side chat right beside it.

Or enter Transformer attention, context windows, and multi-turn memory on the home page.

Sources

Checked 27 November 2026