Why context rots
The instinct when an AI ignores a rule is to add another rule. That instinct makes things worse. Two well-documented effects explain why — and why MemMini treats context as a compiled, budgeted artifact instead of a growing pile.
Lost in the middle
Section titled “Lost in the middle”LLMs attend in a U-shape: information near the start and end of the context gets strong attention; the middle is a relative dead zone. Add a line and every existing line shifts deeper toward that middle. A rule that worked near the top can stop working once new text pushes it down — without anyone editing the rule itself.
The implication: position is a feature. The rules that matter most belong where the model actually looks, and the compile step reports each section’s position so you can see when a rule has drifted into the weak zone.
Compliance decays combinatorially
Section titled “Compliance decays combinatorially”Per-rule compliance is high, but all rules followed at once falls off fast as the count grows — each added constraint multiplicatively lowers the odds that the whole set is honored. This ceiling holds regardless of how well any single rule is written.
So the goal is the minimum set of rules that does the job, not the maximum that fits. Every rule must earn its place against the compliance cost it imposes on every other rule.
What MemMini does about it
Section titled “What MemMini does about it”- Compile lean and ordered.
scripts/compile-context.shemits a word count and a per-section position report, so cost and placement are visible at build time. - Route by type. Soft guidance stays in the injected context; rules better
enforced by code or output-checks are routed out to
ENFORCEMENT.md(Soft / routing / verifiable). - Remove before adding. When the budget is tight, the fix is subtraction. The deep, rarely-needed material lives in the knowledge graph, retrieved on demand, not carried every turn.
Go deeper
Section titled “Go deeper”Canonical node and the research it cites (Lost-in-the-Middle, compliance benchmarks,
prompt-compression results):
wiki/concepts/attention-mechanics.md
and the design document.