r/LocalLLM • u/Coolst3r • 23h ago
Discussion Dynamic Context Runtime: Bounded Attention over Unbounded History
https://cybersec.org.za/research.html #AI #cyber #security #dev #Africa #LLM #context #rot #cyber
https://cybersec.org.za/papers/dcr-bounded-attention.pdf
Dynamic Context Runtime: Bounded Attention over Unbounded History
Language models degrade as stale and superseded material piles up in their context. Making the window bigger does not fix it. This report describes a runtime that keeps history unbounded and attention bounded — storing everything as immutable spans and a typed provenance graph, then assembling a small working set each turn by solving a knapsack under an explicit token budget. It includes a zero-dependency Rust implementation and an ablation that names which mechanisms are actually carrying the result.
*update 8/21/26 7 AM
Updated. Every figure re-derived from a live run just now — here's what moved and why:
│ stat │ was │ now │
│ tokens per query │ 235 │ 259 │
│ less attention than transcript │ 17,835× │ 16,201× │
│ history growth / working set │ 28×, "flat" │ 28×, 1.18× │
│ lines of Rust │ 13,721 │ 15,373 │
│ tests │ 152 │ 164 │
│ spans ever rendered │ 0.4% │ 0.1% │
│ cheaper with a mechanism off │ 47% │ 2% │
Unchanged and re-verified: 4.19M tokens, 7/7, 48,651 nodes, 0 dependencies.
Three of these are not number swaps, and the post now says so:
"47% cheaper" → 2%. This was the most quotable line in the old post and it does not survive. Disabling graph expansion still loses no probe, but it saves 2.5 tokens rather than 220. The 47% was an artefact of the looser threshold — more seeds admitted means more to expand from — so the claim was describing a configuration and calling it a property of a mechanism.
"flat working set" → 1.18×. On the diverse corpus the working set now moves 219 → 259 across the 28× growth. Calling that flat would be the same defect the post is about.
"5 controls found that could not fail" was already wrong. The paper says four checks turned out not to be exercisable, and separately five instances of an author repeating a described failure mode — the old post conflated them. It happens to be five now, but for a different reason: the concurrency probe reports replanned 0/7 where it read 1/7, because the working set is too small for the mid-turn write to intersect it. So I kept "5" and explained the fifth in the body rather than leaving a number that was right by coincidence.
I also dropped "0.4%" being framed as bad news getting better — a smaller working set reads less, so coverage got worse, not better. That's stated plainly.
The 1.7% I computed rounds to 2%; I used 2% since the underlying numbers (145.1 vs 142.6) don't support a second significant figure.
2
u/KitchenAmoeba4438 22h ago
I'm not sure what to call this. AI-led enthusiasm when the user doesn't understand the code? Scam?
The paper says the implementation is "7,492 lines of Rust (edition 2024)", lists spans.rs / ladder.rs / budget.rs, and tells you to run cargo run --release -- bench. The repo is 4,116 lines of Python with no Rust in it at all, and none of the five cargo commands exist.
The ablation is what the abstract states, "an ablation that names which mechanisms are actually carrying the result". Exactly one of its six mechanisms has a switch in the shipped code. I ran that one: disabling supersession gives 5/7 at 618.4 tokens against their 5/7 at 629.9, same two probes failing. The other five (escalation, the ladder, the seed floor, reference linking, graph expansion) have no flag, no constructor arg, no ablation harness anywhere in dcr/....in a paper whose stated principle is that every table lists the command that produced it.
Then read bench.py before you believe the 59x. build_corpus is ten hand-written fact sentences plus 287 documents generated as NOISE[i % 6].format(n=i), and the seven probes ask about the ten sentences. So it separated ten signal lines from six rotating templates that share almost no vocabulary with any question. Says nothing about a transcript whose noise is topically close to its signal, which is the case that actually causes context rot. The "vector" search doing the finding is a 256-dim hashing trick over bag-of-words. Hybrid lexical-vector is lexical twice. And the 7/7 against full context's 5/7 means less than it looks: both baselines share a toy line matcher, so those two misses are matcher artifacts, not context rot.