# Context Rot: What Happens When You Paste 12,000 Tokens of HTML Docs into a Coding Turn

Published: 2026-10-18 | Domain: https://dontbeameatproxy.si | Related Study: DueCare Ablation (duecare.tayloramarel.com)

## Outcome first: more tokens in the prompt often produce worse output

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](https://duecare.tayloramarel.com)) and our **14-constraint engineering suite** ([compare.baltor.ai](https://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

1. **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:31b` dropped 8 of the 14 rules when given raw reference files, but satisfied `14/14 (100%)` when given a compact checklist (`RULES.md`) and contract card.
2. **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.
3. **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%` |
