Experiments with re-writable n-gram tables for LLM persistent memory

Mrinohk · reddit · 2026-09-19

Inspired by how new offload knowledge into n-gram tables, a hobbyist is experimenting with writable n-gram tables plus mid-runtime backprop as a path to persistent LLM memory.

Findings so far: storing memories as question:answer pairs recalls better than raw facts; grafting onto different layers helps but no pattern yet; the main issue is that memory vectors injected into the residual stream can corrupt unrelated outputs when written too strongly. The hypothesis: memories only need to surface once during chain-of-thought, so weaker writes plus attention should suffice.

Testing uses 500 real Q:A pairs from the author's own agent's RAG database (not synthetic), running Qwen3 0.6B on an 8GB RX 6600XT, with sweeps underway on how recall of older facts degrades as memories accumulate.

Original post →

More from Research

Research channel →