Context Rot: What Happens When You Paste 12,000 Tokens of HTML Docs into a Coding Turn
Our DueCare and 14-constraint ablations prove that unfiltered documentation dumps actually lower model precision. Here is how to measure and prevent context rot.
A widespread myth in prompt engineering is that giving a model a 128k or 1M context window means you can paste entire documentation sites, raw statutory PDFs, or full repository trees without penalty. In our controlled ablations across both DueCare (duecare.tayloramarel.com) and our 14-constraint engineering suite (compare.baltor.ai), dumping unfiltered reference text into the prompt degraded precision by 18.4 pp to 57.1 pp compared to factorized < 2 KB contract cards.
Three mechanisms of context rot
- Middle-constraint attention decay ("lost in the middle"): When 12,000 tokens of copied documentation sit between the user's system rules and the generation cursor, transformer attention weights over Rules 5 through 11 drop sharply. In our 14-rule benchmark,
gemma4:31bdropped 8 of the 14 rules when given raw reference files, but satisfied14/14 (100%)when given a compact checklist (RULES.md) and contract card. - Conflicting version examples in scraped pages: Pasted web documentation frequently includes "Legacy v1 Migration" callouts alongside v2 examples. Models attend to both and emit hybrid calls that fail at runtime.
- Distractor activation on benign inputs: In our DueCare statutory screening benchmark, unfiltered RAG dumps of trafficking statutes caused models to flag lawful employer-paid contracts (
false positive rate > 28%) because statutory keywords overwhelmed the specific contract clauses under review.
| Context Injection Strategy | Prompt Tokens Added | 14-Constraint Spec Pass Rate | Statutory False-Alarm Rate |
|---|---|---|---|
| Unfiltered HTML / Doc Paste | +12,400 tokens | 42.9% (6/14) | 28.6% |
| Naive Top-K Chunked RAG | +4,800 tokens | 64.3% (9/14) | 19.0% |
Baltor < 2 KB Contract Card + RULES.md |
+410 tokens | 100.0% (14/14) | 4.2% |
| Navigation | Post Title | Routes |
|---|---|---|
| Previous Post | Replacing Clipboard Relay Loops with Direct Verifier-to-Harness Pipes | HTML · Markdown |
| Next Post | The Zero-Paste Workflow: Letting Your Harness Pull Only the Contract Card It Needs | HTML · Markdown |
| Domain Blog Index | Return to dontbeameatproxy.si/blog Index | feed.json · feed.xml |