Agent Memory as Rate-Limited Filtering: Explicit State Outlasts Long Context Beyond a Reader-Dependent Horizon
Abstract
Can a language model that reads the full history of an access log say whether a service may act now? On an executable benchmark of grants, withdrawals, reinstatements, expiries, groups and change windows under a known policy, scored on pairs of histories that differ only in the order or one field of the deciding events, open models of 7 to 32 billion parameters fall from 72 to 86 percent after eight or sixteen events to 48 to 55 percent after 256, while reasoning-trained 32B models reading the current state reach 96 and 98 percent. A reasoning model of 120 billion parameters trails the state by four and seven points at 256 and 512 events and by about ten at 1,024, so the length beyond which explicit state outlasts long context grows with the reader. We treat agent memory as recursive filtering. The decision depends on the history only through a state whose size is set by the number of tracked keys. A store holding fewer component records than the state forgets on a time scale set by its capacity, and a reader model predicts its accuracy within 0.02 on average in a registered test. Retaining log lines without regard to time order errs with probability approaching one half, a bound that is attained. A filter in which a model parses each line and an explicit rule applies the updates answers 80 to 89 percent at 256 events and beats relevance retrieval, model-kept ledgers, a reimplementation of StateMem and the Mem0 library. A retriever that selects at query time the lines the queried state depends on matches it at 256 events on the first domain, so what decides is selection by the state's dependencies, which the filter performs when writing, without the query. Applying parsed updates themselves, the models fall to 58 and 59 percent. A frozen replication on a second domain with fresh wording reproduces the horizon.
Figures & tables
| eviction | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| random | 3 | 64 | 4.3 | .000 | .161 | .161 | .355 | .450 | .581 | .709 | .840 | 1 |
| random | 3 | 256 | 4.2 | .000 | .194 | .194 | .410 | .455 | .649 | .716 | .910 | 1 |
| random | 7 | 64 | 8.0 | .000 | .098 | .203 | .314 | .457 | .572 | .708 | .851 | 1 |
| random | 7 | 256 | 8.2 | .000 | .101 | .208 | .319 | .468 | .594 | .724 | .860 | 1 |
| random | 15 | 64 | 13.0 | .000 | .118 | .212 | .341 | .470 | .578 | .713 | .853 | 1 |
| random | 15 | 256 | 16.2 | .000 | .084 | .178 | .282 | .417 | .548 | .688 | .839 | 1 |
| eviction | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| store, random | 3 | 64 | 4.2 | .000 | .025 | .025 | .106 | .110 | .322 | .313 | .768 | .769 |
| projection, random | 3 | 64 | 4.2 | .000 | .207 | .175 | .400 | .408 | .630 | .621 | .898 | .889 |
| store, LRU | 3 | 64 | 4.2 | .000 | .025 | .025 | .050 | .050 | .225 | .225 | .675 | .675 |
| projection, recency | 3 | 64 | 4.2 | .000 | .025 | .025 | .075 | .075 | .225 | .225 | .675 | .675 |
| store, random | 3 | 256 | 4.2 | .000 | .000 | .000 | .028 | .029 | .120 | .118 | .678 | .685 |
| projection, random | 3 | 256 | 4.2 | .000 | .187 | .177 | .390 | .387 | .589 | .613 | .869 | .859 |
| Executable ground truth | Supersession or revocation | Reinstatement after revocation | Source priority | Expiry | Paired order counterfactuals | Reader check with correct state | Query-unknown writing | Horizon as controlled variable | Real logs | |
| StateMemBench [ 14 ] | ✓ | ✓ | – | ✓ | ✓ | |||||
| STALE [ 8 ] | ✓ | ✓ | ||||||||
| Memora [ 64 ] | – | ✓ | – | – | – | ✓ | ||||
| MemoryAgentBench [ 21 ] | ✓ | ✓ | ✓ | |||||||
| MEMAUDIT [ 6 ] | ✓ | ✓ | – | – | ✓ | |||||
| OrgAccess [ 55 ] | – | ✓ |
| Qwen2.5-7B | Qwen2.5-14B | phi-4 | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Law | LOO | Extrap. | LOO | Extrap. | LOO | Extrap. | |||
| chain length | blocked events | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| rule | 5 | 9 | 17 | 33 | 65 | 2 | 4 | 8 | 16 | |
| 2 | BM25 | 0.50 | 0.50 | 0.50 | 0.50 | 0.50 | 0.36 | 0.36 | 0.43 | 0.47 |
| key mention | 0.38 | 0.44 | 0.48 | 0.49 | 0.48 | 0.17 | 0.35 | 0.36 | 0.43 | |
| salience | 0.50 | 0.50 | 0.50 | 0.50 | 0.50 | 0.50 | 0.50 | 0.50 | 0.50 | |
| gradient | 0.49 | 0.47 | 0.51 | 0.51 | 0.47 | 0.53 | 0.48 | 0.49 | 0.49 | |
| recency | 0.48 | 0.43 | 0.43 | 0.33 | 0.14 | 0.50 | 0.50 | 0.50 | 0.50 | |
| memory | 32 | 64 | 128 | 256 | 32 | 64 | 128 | 256 | 32 | 64 | 128 | 256 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| replayed state (oracle) | 0.94 | 0.64 | 0.55 | 0.53 | 0.94 | 0.85 | 0.71 | 0.60 | 0.94 | 0.90 | 0.90 | 0.79 |
| last applied event per component | 0.67 | 0.60 | 0.55 | 0.56 | 0.81 | 0.60 | 0.57 | 0.60 | 0.87 | 0.80 | 0.64 | 0.63 |
| last event per key | 0.60 | 0.66 | 0.57 | 0.55 | 0.79 | 0.62 | 0.49 | 0.60 | 0.85 | 0.74 | 0.58 | 0.60 |
| LLM state ledger | 0.68 | 0.55 | 0.62 | 0.51 | 0.66 | 0.67 | 0.58 | 0.50 | – | – | – | – |
| LLM summary | 0.58 | 0.56 | 0.52 | 0.54 | 0.70 | 0.62 | 0.58 | 0.53 | – | – | – | – |
| reader | memory | 64 | 128 | 256 | |
| Qwen2.5-14B | parsed events + transition rule | 0.94 | 0.90 | 0.88 | 0.80 |
| replayed state (oracle) | 0.94 | 0.90 | 0.90 | 0.83 | |
| LLM ledger, | 0.66 | 0.67 | 0.58 | 0.50 | |
| LLM applies the parsed updates | – | 0.72 | – | 0.59 | |
| LLM fact store (add, update, delete), | – | 0.83 | – | 0.59 | |
| BM25 retrieval, | 0.83 | 0.72 | 0.69 | 0.59 |
| what is exact, what a model does | Qwen2.5-14B | phi-4 |
|---|---|---|
| exact rule on the true events, no reader | 1.00 | 1.00 |
| exact rule on the parsed events, no reader (parsing) | 0.98 | 0.98 |
| reader on the true state (decoding) | 0.83 | 0.86 |
| reader on the state from parsed events (parsing and decoding) | 0.80 | 0.84 |
| reader on a table the model updates from the parsed events (transition) | 0.59 | 0.58 |
| reader on the full log with a 4,096-token trace (everything) | 0.64 | 0.73 |
| full log | state from parsed events | tokens per decision, 256 events | |||
|---|---|---|---|---|---|
| reader | 64 | 256 | 256 | full log | state |
| QwQ-32B | 0.90 | 0.85 | 0.98 | 7,052 + 2,513 | 745 + 787 |
| R1-Distill-Qwen-32B | 0.89 | 0.70 | 0.96 | 7,047 + 1,755 | 740 + 686 |
| full | state from | true | state from parsed | tokens per decision | |||
|---|---|---|---|---|---|---|---|
| reader | events | log | parsed events | state | minus log | full log | parsed state |
| gpt-oss-120b | 256 | 0.95 | 0.99 | 0.99 | 6.1k + 1.6k | 0.8k + 0.4k | |
| gpt-oss-120b | 1,024 | 0.87 | 0.99 | 0.98 | 23.4k + 4.7k | 0.9k + 0.4k | |
| Qwen2.5-72B (4-bit) | 256 | 0.72 | 0.94 | 0.95 | 7.1k + 0.2k | 0.8k + 0.1k | |
| Qwen2.5-72B (4-bit) | 1,024 | 0.55 | 0.92 | 0.92 | 27.5k + 0.1k | 0.8k + 0.1k | |
| QwQ-32B | 1,024 | 0.52 | – | – | – | 27.5k + 10.1k | – |
| parsed lines | full log | state / parsed + rule | reasoning trace | |||
|---|---|---|---|---|---|---|
| reader | correct | 64 | 256 | 64 | 256 | 256 |
| Qwen2.5-14B | 99.95% | 0.54 | 0.51 | 0.76 / 0.76 | 0.68 / 0.68 | 0.58 |
| phi-4 | 97.07% | 0.59 | 0.50 | 0.84 / 0.85 | 0.76 / 0.76 | 0.68 |
| memory | persistent store | raw archive | model calls per event | reader sees |
|---|---|---|---|---|
| full log | all lines | yes | 0 | all lines |
| BM25, recency and relevance | all lines | yes | 0 | top lines, 512 tokens |
| dependency retriever (R5-3) | all lines | yes | 0 | lines naming the query’s components |
| LLM ledger, summary | text, 256 tokens | no | 1 per 16 | the text |
| model-applied table (R2-B1) | table, at most 512 generated tokens | no | 1 per 16 | the table |
| Mem0-style fact store (R2-B3) | facts, unbounded | no | 1 per 16 | the facts, cut to 512 tokens |
| Method | Query-blind writing | Who decides supersession | Source authority | Persistent store bound | LLM calls per event |
|---|---|---|---|---|---|
| StateMem [ 14 ] | ✓ | LLM flags, newer turn wins | none, superseded units kept | 1 | |
| Mem0 [ 9 ] | ✓ | LLM (delete or update) | none | one per extracted fact | |
| Zep/Graphiti [ 52 ] | ✓ | LLM detects, time resolves | none, invalidated edges kept | several (extraction, resolution, temporal) | |
| A-Mem [ 75 ] | ✓ | none, notes are never superseded | none, one note per event | one per linked neighbour | |
| AriGraph [ 2 ] | ✓ | LLM selects outdated triplets | none | 2 | |
| MemAgent [ 76 ] | LLM rewrites memory | 1024 tokens | 1 |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| chain length | blocked events | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| rule | 5 | 9 | 17 | 33 | 65 | 2 | 4 | 8 | 16 | |
| 2 | BM25 | 0.49 | 0.50 | 0.50 | 0.50 | 0.50 | 0.34 | 0.38 | 0.43 | 0.47 |
| key mention | 0.40 | 0.44 | 0.48 | 0.49 | 0.48 | 0.30 | 0.39 | 0.43 | 0.46 | |
| salience | 0.49 | 0.50 | 0.51 | 0.50 | 0.50 | 0.44 | 0.48 | 0.49 | 0.49 | |
| gradient | 0.47 | 0.45 | 0.51 | 0.53 | 0.48 | 0.51 | 0.48 | 0.50 | 0.52 | |
| recency | 0.48 | 0.43 | 0.43 | 0.33 | 0.14 | 0.50 | 0.51 | 0.50 | 0.50 | |
| Benchmark | Evidence |
|---|---|
| StateMemBench [ 14 ] | Answers come from replaying each symbolic program through a deterministic evaluator. Scenarios contain value updates, scoped exceptions, commitments, and retractions. Restoration of a retracted item, source authority, order-only minimal pairs, and an answerer given the correct state are not described. A scoped override that may lapse leaves expiry ambiguous. Memory stores are built before the probe. Set A and Set B share the probe structure and differ in length. Programs are rendered into dialogue by an LLM, and public data supplies vocabulary only. |
| STALE [ 8 ] | Scenarios are generated by an LLM, edited by experts, and graded by an LLM judge. Each instance contains one implicit conflict that invalidates an earlier belief, and the paper limits itself to one-shot transitions, so no state is restored. Source authority, expiry, order pairs, and a correct-state control are not described. Frameworks ingest the dialogue before probing. Contexts reach 150K tokens, but length is not an experimental factor. |
| Memora [ 64 ] | Questions derive from simulated memory traces and are graded by LLM judges, so programmatic ground truth is ambiguous. The simulator introduces, updates, and invalidates entities. Users may reverse earlier statements, which leaves reinstatement ambiguous, and temporal constraints leave expiry ambiguous. Source authority, order pairs, and an oracle-memory condition are not described, and whether memory is written before the query is not stated. Weekly, monthly, and quarterly horizons are compared. Conversations are simulated. |
| MemoryAgentBench [ 21 ] | The selective-forgetting data reuse counterfactual edit pairs from MQuAKE, with the new fact placed after the original. The only conflict rule is to prefer later information. Reinstatement, expiry, order-swapped pairs, and a correct-state control are not described. Chunks are ingested incrementally before questions. Contexts of 6K, 32K, 64K, and 262K tokens are used. Inputs are reconstructed from existing long-context datasets to simulate multi-turn interaction. |
| MEMAUDIT [ 6 ] | Package optima are computed exactly by branch-and-bound with MILP certification. Tombstones mark superseded or deleted facts. Reinstatement, source priority, and order pairs are not described. A temporal-interval distribution leaves expiry ambiguous, and a reader audit in the appendix is not a correct-state control. Memory is written before future queries are known. Sweeps vary the budget, not the stream length. The natural package is a LongMemEval-style slice built with an LLM. |
| OrgAccess [ 55 ] | Expected responses are largely LLM-generated and human-reviewed. There are no grant-then-revoke sequences or reinstatement. Competing directives are mentioned without a defined priority order. Expiry dates and temporal access limits appear in examples. Order pairs, a correct-state control, and memory writing are not described. The controlled variable is the number of concurrent permissions (1, 3, or 5). |
| Test | Registered criterion | Outcome |
|---|---|---|
| E0 | Gradient retention beats longest-line and BM25 retention on five hand-written scenarios | Tied with longest line, demoted |
| E1 (gate 4) | Rank-one or query-averaged Fisher quadratic predicts KL at least 10% better than the best first-order predictor | Failed, mechanism claim terminated |
| E2-0, E2-0b | Full-context reader recalls both classes and reinstatements at 0.90 at 64 events | Failed for Qwen 7B and 14B |
| X1a | Reader AUC decreases with | Holds for all three readers |
| X1b | Neutral persona changes balanced accuracy at 64 events by 0.10 or more | No ( ) |
| X2 | State reading at 0.95 or above at every and flat in | Fails: below 0.95 for all readers; for phi-4 no detectable dependence on (no equivalence test) |