In one line: Proof-of-concept pilot putting memory in a frozen Flan-T5-XL's continuous latent space rather than in text: six variants across three injection points and four write mechanisms; only the read adapters are trained (the write projections stay at random initialisation), and the bank keeps accumulating at inference without gradients. On LoCoMo (one seed, 639 questions) all six score above the stateless baseline's zero at 10x capacity, but that recall rate is clipped at zero per question and the baseline is zero by construction; at 1x three of the six make answers worse than no adapter, and at 10x the net gain is +1.8 to +6.3 F1 points over a 6.44 baseline. No RAG or text-memory baseline, single backbone.
How far to trust it: Read it as a map of the design space, not as evidence that latent memory works. The headline metric cannot go below zero, the zero baseline is zero by construction, three of six methods make answers worse at 1x, the write rules of five methods as written all but erase a turn within about 100 turns while 62% of test questions sit 256 or more turns back, it is one seed on about 639 questions with no text or retrieval baseline, and several ranking statements contradict the paper's own tables. The evidence, judged.
The idea in one sentence: give a frozen Flan-T5-XL a persistent latent memory bank that a fixed, never-trained rule writes every turn and a small trained adapter reads; on LoCoMo every method scores above the stateless baseline's zero at 10x capacity, but that score cannot go below zero, and the write rule all but erases a turn within about 100 turns while most test questions are older.
You need: how an encoder-decoder's decoder reads the encoder through cross-attention (Families and objectives) and how a frozen model is adapted with a few trained parameters, prefix tuning and LoRA (PEFT). New terms: persistent bank P (an nP × d matrix kept across turns); injection point (where the bank enters the frozen model); write mechanism (the rule that folds a turn into the bank); delegated or explicit read (the frozen cross-attention picks from the bank, or the adapter retrieves first); conversational learning (the bank keeps filling at inference, no gradients); memory recall rate ρ (the share of headroom the bank fills, clipped at zero); evidence lag (turns from the evidence to the question).
The paper calls itself a proof-of-concept pilot study: one frozen Flan-T5-XL backbone, small trainable adapters, one dataset, and it is explicit that resource constraints shaped every choice (abstract, §1, §7.3).
A frozen encoder-decoder language model is stateless. The encoder turns the current input xt into a latent Zt, the decoder reads Zt through cross-attention and writes the answer, and Zt is discarded after every forward pass (Eq. 1, Figure 1). Nothing persists between turns or sessions: if a user says "I like reading" in session 1 and asks "What do I like?" in session 3, the model cannot answer (§1).
The industry answer is text-level memory: write facts to a store as strings, retrieve the relevant ones later, and paste them back into the prompt (agent memory files and memory-layer libraries are on Context engineering). MemGPT and MemoryBank are the paper's examples (§2). It works, but the write and the read are discrete, non-differentiable operations bolted on from outside the model.
The question: can memory live in the model's continuous latent space instead, so that reading and writing become differentiable operations on dense vectors that can be trained end to end, while every backbone weight stays frozen?
The bank's shading is the share of it that each turn still holds under the paper's decay γ = 0.95 per turn (§6.2): a turn written l turns ago keeps weight γl before normalisation. The simulation tab runs the real write rules.
Add a persistent memory bank Pt, a matrix of nP rows of width d (Flan-T5-XL's d = 2,048), that survives from turn to turn. Each turn now does three things (Eq. 2):
| Encode | Zt = Efrozen(xt) | unchanged |
| Read | ŷt = Dfrozen(Read(Zt, Pt−1)) | the answer sees what earlier turns left in the bank |
| Write | Pt = Write(Pt−1, Zt) | this turn's latent is folded into the bank |
Why not just keep the raw encoder outputs and let the decoder attend to all of them? The decoder's cross-attention was pre-trained to read current encoder states; piling up history in the same softmax spreads attention thin instead of sharpening retrieval. So a small trainable adapter θMem learns to put memory in a form the frozen decoder can use (§1, §7.1). The animation runs the paper's own example through both systems, the stateless baseline and a model with a bank, one step at a time:
The paper builds six variants spanning three injection points (where memory enters the frozen model: before the encoder, between encoder and decoder, or inside the decoder) and four write mechanisms (how the bank updates: an attention-coupled update, a Hebbian outer product, gated cross-attention, sparse slot addressing) (§1, Table 1). The backbone stays frozen and only the small adapters train. Each method borrows a known primitive: prefix tuning (M.1), Flamingo's gated cross-attention (M.2, M.5), Memorizing Transformers' extra keys and values (M.3), fast-weight outer products (M.4) and Neural Turing Machine slots (M.6); the contribution claimed is the controlled comparison, not the primitives (§2).
Fig. 1 attaches each method to the frozen model in turn, in the order of where its memory enters: write paths in orange (never trained), read paths in blue (trained). Parameter counts are recounted from Flan-T5-XL's configuration (d = 2,048, 24 decoder layers, 2.85B parameters in total); Table 2's printed counts are rounded.
Delegated or explicit read. M.1, M.3 and M.6 hand all of P to the decoder as extra keys and values and let the frozen cross-attention pick; M.2, M.4 and M.5 do their own content-based retrieval first (Table 1). Two of the three "inside the decoder" methods are not built that way: for M.2 and M.5 the per-layer read is approximated by computing it once with Zt standing in for the decoder's hidden state and passing the result to the decoder as extra encoder positions (§4.2 implementation note, §4.5). As run, then, five of the six methods enter through the same door, extra positions in the decoder's cross-attention; only M.1 differs.
Four methods share one attention-coupled write: queries from the current latent, keys from the bank, values from the current latent, then Pt = γPt−1 + At⊤V with At = softmax(QK⊤/√d). Taking values from Zt, not from P, is what lets an all-zero bank fill up at all (Eq. 7). M.4 keeps a dh × dh matrix, adds (1/n)(ZWK,H)⊤(ZWV,H) each turn and rescales it whenever its Frobenius norm passes 1 (Eq. 16). M.6 mean-pools the turn, scores the 64 slots, and moves only the top 8 towards the new vector, γP[s] + (1 − γ)ut (Eqs. 24 to 28). Zero-initialised read projections (M.2's β, M.3's WMem) and M.5's negative gate bias make each method start exactly or nearly as the frozen baseline; M.4 initialises WQ,H small but non-zero, since zeroing both of its read matrices would deadlock the gradients (§4.4, §4.5).
All three write rules multiply what is already stored by γ each turn (M.6 only in the slots it picks); that one fact drives most of the evidence section.
"Frozen" means the encoder and decoder get no weight updates, not that gradients stop at them: the loss flows back through the frozen decoder (and, for M.1, the frozen encoder) to the adapter, the same principle as prefix tuning and LoRA (§5; how those work is on PEFT). Training has two phases (Figure 8):
So the experiment trains a decoder for whatever a random write rule deposits; nothing learns what to store.
| Backbone | Flan-T5-XL, 3B parameters, bfloat16, every weight frozen |
| Optimiser | AdamW, learning rate 10−4, weight decay 10−2, 200 warmup steps, gradient clipping at 1.0 |
| Schedule | 10 epochs, batch 2 with gradient accumulation 8 (effective 16); truncated backpropagation through time over k = 8 turns |
| Memory, 1x | nP = 64 rows, γ = 0.95; M.4 dh = 256; M.6 64 slots, top-k = 8 |
| Memory, 10x | nP = 640, dh = 810 (810² / 256² = 10.0, so ten times the entries), 640 slots |
| Runs | one seed (42), one NVIDIA GPU |
From §6.2 and §6.4. The paper says the adapters are trained "on the public training split" of LoCoMo, but LoCoMo is released as 10 evaluation conversations with no split; the 639 test questions match the last three conversations (conv-48, 49 and 50) to within 4 questions per lag bucket, so the training presumably used the other seven. That is inferred here, not stated.
Every condition sees only the current turn; no method gets the history as text (the equal-input principle, §6.2). For each LoCoMo question the evidence lag is the number of turns from the oldest annotated evidence turn to the end of the conversation, ℓq = T − min Eq (Eq. 37). Each trained method answers twice, with its bank intact and with its bank forced to zero, and the memory recall rate is the share of the available headroom the bank fills (Eq. 40):
ρq = max(0, F1mem − F1zero) / max(1 − F1zero, ε)
Scores are averaged in five lag buckets (0 to 31, 32 to 63, 64 to 127, 128 to 255, 256 or more turns) and smoothed with a weighted non-increasing isotonic fit, so a curve can only stay flat or fall with lag (§6.3).
The baseline has no bank to ablate, so F1mem = F1zero and ρ = 0 by definition (Eq. 41); it still answers some questions (6.44 F1, Table 5). The zero is a sanity check, not a comparison. And the max(0, ...) clips each question at zero before averaging: a bank that changes answers at random, helping some questions and hurting as many, still averages above zero. Try it:
Illustrative: 200 questions with a zero-memory F1 of 0.06 (near the baseline's 6.44); a helped question gains, a hurt one loses, by a random amount up to 0.3 F1 (seeded). The other questions are unchanged. The paper's own Table 5 shows this happening: at 1x M.1 scores a positive 0.02% recall rate while its answers with memory are 6.42 F1 points worse than the baseline's.
So the headline "all six positive" is close to guaranteed for any adapter whose answers change at all when the bank is wiped. What the metric can tell apart is how much each method helps and whether the help falls with lag, which is where the results start.
Evaluated on LoCoMo with the forgetting-curve protocol at two capacity scales, 1x and 10x (§6.4). LoCoMo is a public benchmark of 10 very long two-person conversations, generated by LLM agents and edited by people (19 to 32 sessions, 369 to 689 turns each) with annotated evidence turns for every question, which is what lets each question sit at a known lag (LoCoMo; counts from the released data). The test set has 639 questions, and 62% of them sit 256 or more turns back.
The paper's adapter-interference analysis, Table 5, gives two numbers per method: the adapter tax, how far the adapter alone (bank zeroed) pulls F1 below the baseline, and the net benefit, F1 with the bank minus the baseline (Eqs. 44, 45). Since the baseline is 6.44 F1 at both scales, both F1 levels follow; the chart puts them side by side.
F1 with the bank zeroed = 6.44 − tax; F1 with the bank = 6.44 + benefit (derived here from Table 5, which prints only tax and benefit). At 1x, M.1, M.3 and M.5 answer with memory at 0.02, 0.00 and 0.14 F1: memory switched on destroys almost every answer. The paper calls the tax "modest (2 to 4%)"; against a 6.44 baseline, 2.38 to 4.23 points is 37% to 66% of what the frozen model answered on its own.
Net benefit at 10x is positive for all six, +1.83 to +6.26 F1 points over the baseline; at 1x only M.2 (+6.76), M.6 (+5.75) and M.4 (+3.10) come out ahead (§7.2). The taxes take only two values per scale (2.38 or 4.23 for the delegated-read methods, 3.39 for every explicit-read one), which is unusual for six separately trained adapters and is not explained.
Knowledge accumulation (§6.5, Table 4): after writing sessions 1 to s, probe every question whose evidence is already written, and track the mean F1 Ks; ΔK = K30 − K1. At 1x M.6 has the largest gain (ΔK = 9.71) and M.4 (7.84) and M.2 (7.34) follow, while M.1, M.3 and M.5 stay under 0.2. Two things do not add up (details below).
The text says M.6 has "the highest terminal K30 = 9.7%", but M.2 (11.04) and M.4 (10.62) are higher in the same table. And the stateless baseline gains 5.57 points, explained as "more context injected into the current prompt", although the equal-input rule gives it only the current turn; with K1 = 0, what changes is which questions are answerable, not the baseline. Two of the three test conversations have 30 sessions; conv-49 has 25.
The framing is the valuable part. Nearly all deployed agent memory is text-level and non-differentiable: retrieval is a separate system, and the model has no say in what gets written or how it is encoded. Latent-space memory makes the write mechanism itself learnable, and the six-variant taxonomy (injection point × write mechanism) is a reasonable map of the design space, even if these experiments cannot rank the options convincingly.
OpenClaw keeps memory as plain Markdown files such as MEMORY.md (OpenClaw docs); Hermes injects bounded MEMORY.md and USER.md files at session start and plugs in external memory providers (Hermes docs).
What it does not show:
A positive score against a zero baseline is a floor, not evidence of a competitive system. The paper's own forward-looking claims (that unfreezing the backbone, 70B+ models, more data and banks of millions of slots will give "substantially stronger results", §7.3, §8) are expectations, not results.
What holds up. The protocol is clean in two ways: every condition sees the same current-turn input, and each method is scored against itself with its bank wiped, so the score isolates what the bank contributes (§6.2, Eq. 40). The equations are complete enough to run (the simulation tab does), the hyperparameters are given, and the parameter counts check out when recounted. The author is upfront about the limits: a pilot, one backbone, one dataset, absolute recall "modest (up to ≈ 12%)" (§7.3), and that counts in the paper's favour.
The weaknesses, concretely:
0.95256 ≈ 2 × 10−6. The bank is an exponential moving average with an effective window of 1/(1 − γ) = 20 turns; a turn's weight drops below bfloat16's resolution (2−8, the precision the backbone runs at) after 109 turns. Below, the paper's three write rules run on a synthetic 600-turn conversation (the bars are the share of LoCoMo's 639 test questions at each lag):
Yet the long-lag scores are where the methods score most of their points: 7% to 10% at 256+ turns, on 62% of the questions. Whatever earns that credit is unlikely to be the evidence turn itself. One candidate is recent context: in the three test conversations, 34% of answerable questions share a content word of the answer with the last 20 turns (33% of those at lag 256+), counted from the released data. And in the simulation, an attention-coupled bank that starts at zero, as §4.1's remark about zero initialisation suggests, keeps all 64 (or 640) rows identical forever, because identical keys give every row the same attention weight, and a bank started from small random values drifts to the same state (its rows' spread falls from 21% after one turn to 0.3% after 100, at 1x); ten times the rows then stores nothing more, so the "capacity" story does not follow from the write rule as written. The slot rule fares little better from a zero start: ties always pick the same first slots, so 64 of the 640 slots at 10x are ever written (simulation tab). Both are illustrative (random latents, d = 32), not a rerun of the paper.
Verdict: read it as a map of the design space and a clear statement of the problem, not as evidence that latent memory works. The metric cannot go below zero, three methods make answers worse at 1x, five of the six write rules as specified all but erase a turn within about 100 turns while most questions are older, and there is one seed, no competitor and no released code.
No code or weights are released, so using it means implementing §4 yourself on an open, hookable encoder-decoder; the compute is modest, and for an agent that must remember users today, text memory or retrieval is far ahead on this benchmark.
The paper's three write rules, run exactly as written: the attention-coupled write of M.1, M.2, M.3 and M.5 (Eq. 7), M.4's Hebbian outer product with its norm rescaling (Eq. 16) and M.6's top-k slot write (Eqs. 24 to 28). The write projections are fixed random maps, which is faithful: the paper never trains them (§5). What is illustrative is the input: 600 turns of random latents with d = 32 features and 8 tokens per turn, instead of Flan-T5-XL's 2,048-wide encoder states. The row counts (64 or 640), the Hebbian size (scaled to d = 32 in the paper's 256 : 2,048 and 810 : 2,048 ratios), the 8 of 64 or 640 slots and γ are the paper's (§6.2). Everything runs in float64 in your browser, and check_sim.py checks this JavaScript against an independent NumPy implementation of the same equations: across 15 cases the largest relative difference is about 10−13.
The bank cannot be read without the trained read adapters, which were not released, so the simulation measures what any read could find: how much of the bank a turn still accounts for after l more turns, and how many different rows the bank actually holds.
At γ = 0.95 the attention-coupled bank is an exponential moving average: a turn's weight after l turns is 0.95l, so 0.95256 ≈ 2.0 × 10−6, the effective window is 1/(1 − γ) = 20 turns, and the weight drops below bfloat16's 2−8 after 109 turns. These follow from Eq. 7 and the printed γ (§6.2) and are recomputed in recompute.py; the chart's curve follows the same slope, independently. Keeping 1% of a turn for 256 turns would need γ ≥ 0.9822 (try it on the slider). Not reproducible here: the recall rates themselves, which need the trained adapters and Flan-T5-XL.
Colour: each cell's value divided by the largest absolute value in the bank at that turn (blue positive, orange negative). Spread: the rows' distance from their mean, as a share of the bank's norm. Random latents, d = 32, seed 7; illustrative.
The 10x results are read as "capacity is doing much of the work" (§6.4). Capacity only helps if different rows hold different things. In the attention-coupled write every row's key is computed from the row itself, so rows that are equal get equal attention and receive equal updates. The animation shows the 64 rows of a 1x bank (one column each, 32 features down) after each turn, from a zero start and from a small random start.
What this cannot show: real encoder states are not random, and a trained read adapter might extract something from a bank whose rows agree (a single averaged vector of the last 20 turns still carries recent context). What it does show is that, as written, ten times more rows add no independent storage to the attention-coupled bank, and at 10x the slot rule from a zero start only ever writes 64 of its 640 slots, because ties go to the same first slots (from a small random start it writes 120 of them in 600 turns). The paper does not state the initial bank, so both starts are shown.
Every table that carries the argument, transcribed into tables.json at the printed precision, with every derived number recomputed in recompute.py. Click a column heading to sort.
Recall rate in %, isotonic-smoothed as printed (Table 3). "Mean" is the paper's column, which is the unweighted average of the five buckets; "weighted" averages over questions (28, 24, 62, 130 and 395 per bucket), recomputed here. "± SE" is the largest possible standard error of the weighted mean for a 0-to-1 score, √(p(1 − p)/n) per bucket; it ignores the isotonic pooling and seed-to-seed variation, so the real uncertainty is larger. Bold: best in the column.
Tax and benefit in F1 points as printed (Table 5; Eqs. 44, 45). The F1 levels are derived here from the printed baseline of 6.44: zeroed = 6.44 − tax, with memory = 6.44 + benefit. Red: memory switched on leaves answers worse than the frozen model with no adapter.
K30 and ΔK as printed (Table 4); K1 = K30 − ΔK is derived here.
Every parameter count in Table 2 reproduces independently from Flan-T5-XL's configuration (d = 2,048, 24 decoder layers, 2,849,757,184 parameters in total; config.json), using the shapes in §4. The 10x Hebbian size reproduces by construction: 810² / 256² = 10.01. The 10x bank's size, 640 × 2,048 × 4 bytes = 5.24 MB, matches "≈ 5 MB" (§7.4).
Counted from LoCoMo's released data with the paper's lag definition (Eq. 37; locomo_stats.py). The last three conversations give 639 questions, exactly the paper's total, and agree within 4 per bucket; the small differences presumably come from which evidence turns count. This is the basis for the inference that the other seven conversations were used for training.
Each claim checked in recompute.py against the paper's own tables and equations.
Every link opens in a new tab. Reading time of the resources below: 5h 00m.
arXiv preprint, 2026, the paper itself; the HTML version has the anchors this page links to. abstract page, PDF.
(40 min)
the paper says it will "release six trained memory adapters" (§1), but neither the paper nor its arXiv page links any code or weights (checked 3 October 2026).
Maharana et al., ACL 2024: the benchmark this paper evaluates on: how the conversations were generated, the five question types, and the text-memory and RAG baselines (GPT-3.5 with retrieved observations reaches 41.4 F1).
(40 min)
Snap Research: the released 10 conversations (locomo10.json) with per-answer evidence turns; this page's lag and overlap counts come from it.
(15 min)
Packer et al., 2023: the text-level memory system the paper positions itself against: paging facts in and out of the context window.
(40 min)
Alayrac et al., NeurIPS 2022: gated cross-attention inserted into a frozen LM, zero-initialised so training starts from the frozen model; the template for M.2 and M.5.
(30 min)
Wu et al., ICLR 2022: extends attention with a kNN-retrieved cache of past keys and values; the KV-extension idea behind M.3, with real long-range retrieval.
(30 min)
Schlag, Irie and Schmidhuber, ICML 2021: the outer-product (Hebbian) write that M.4 uses, and why a plain sum of outer products runs out of capacity: the delta rule fix.
(35 min)
Mu, Li and Goodman, NeurIPS 2023: compressing a prompt into a few learned latent tokens: the compression-into-latents relative of this paper's bank.
(25 min)
Snell, Klein and Zhong, 2022: context distillation: moving what a prompt says into the weights instead of into a memory.
(25 min)
OpenClaw docs: the text-level memory personal agents actually ship: plain Markdown files (MEMORY.md, USER.md, daily notes), no hidden state.
(10 min)
Nous Research docs: bounded MEMORY.md and USER.md injected at session start, plus pluggable external providers (Honcho, mem0 and others).
(10 min)
adjacent in the same batch: another frozen-backbone-plus-small-adapter design (bidirectional features added to a decoder).
adjacent in the same batch: a frozen large model's representations read through trained cross-attention.
the encoder-decoder family of the frozen backbone (Flan-T5-XL is an instruction-tuned T5 at 3B).
a current encoder-decoder backbone, if anyone retries this on something newer than Flan-T5.
the retrieval baseline this paper does not compare against.
compressing context into latents trained end to end at scale: the direction this pilot gestures at.
text-level agent memory with selective reminding.
learning to curate task-adaptive (text) memory for agents.
the other way to add few trainable parameters to a frozen model; gradients flow through frozen weights the same way (§5).
a fixed-size state that decays and is overwritten every step, like this bank, but learned with a selective (input-dependent) decay.
adapters on frozen backbones.
agent memory.
retrieval as the practical alternative to latent memory.
This page is one row of the Papers database; its properties (Paper, Takeaway, Topics, Year) live there. Added to the knowledge base on 2026-09-01 from a blog entry.