problem:
mambas forget.. that's the whole knock on them vs transformers (as per figure 4 in Hybrid Architectures, Bae, et al, 2026 and included below). everyone fixes this by bolting attention back on.. but then your still O(n^2).. just a factor improvement..
solution:
inspired by RLM.. just teach the model a skill, to remind itself when it forgets stuff.. so you add a tool called "self-grep(regex, prefix=, suffix=)" on its own tape and remind itself of things that are fading in its hidden state..
Like so:
----------------------------
[tok 0] Francois' phone number is 650-555-0142
[insert 60k toks of other stuff.. state has reset 15 times.. the number is long gone from hidden...]
[tok 61,480] Ok, Francois' phone number is:
<|grep|>
self-grep("Francois.{0,20}phone.{0,30}\d{3}-\d{3}-\d{4}", prefix=5, suffix=5)
<|end_grep|>
<|grep_result|>
tape -> "...Francois' phone number is 650-555-0142..."
<|end_grep_result|>
650-555-0142
----------------------------
the model writes the grep call, the decoder pastes the hits in front of it, the state runs over them and it keeps going.
1.5B toks of this w/ 2M grep calls (real code, long docs, agent sessions + synthetic lookups), only 5% of the pretrain stream. we only keep a call where it actually lowers the loss, so it learns when to ask.
result: needle hidden 64k toks back.. 9% -> 98% success!
just on an 82M param body. no attention added!
the hard part was not reading the result.. it was teaching it to ask. after a reset it doesn't know what it forgot. still weak on free running text, but for lookups it just works.
more coming!