# Instant Weight-Space Consolidation for Long-Term Memory in LLMs

Manan Suri, Dinesh Manocha · arXiv · 2026-11-16

- **Problem** Agentic memory systems keep the base model's weights fixed, so knowledge reaches the model only through retrieved text.
- **Method** CLAM uses a recurrent hypernetwork that folds each session's activations into a gated, fixed-size carried state and decodes that state into a low-rank adapter in one forward pass. An episodic buffer supplies verbatim spans at query time.
- **Results** CLAM reaches 47.7, 51.6 and 55.3 LLM-judge accuracy on LoCoMo overall for Gemma-2-2B, Qwen3-4B and Mistral-7B. On Gemma-2-2B the adapter adds 4.8 points over an oracle buffer.

![Figure 1: (a) CLAM overview: sessions are consolidated into a carried workspace Qt via a recurrent hypernetwork that decodes QN into a LoRA adapter; the episo…](https://refivu.com/papers/d7e910e4-bc6c-4c84-b5c0-2c8df4c15f81/figures/figure-415cead27200d5bfeea838e5948f6b2a.png?thumb=512)

**Figure 1** : (a) CLAM overview: sessions are consolidated into a carried workspace Qt via a recurrent hypernetwork that decodes QN into a LoRA adapter; the episodic buffer retrieves spans at query time. (b) One consolidation step: Qt−1 cross-attends into session activations Zt, slots reorganise via self-attention, and a gate controls the write.

[Original paper](https://arxiv.org/abs/2611.20759v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Manan Suri, Dinesh Manocha · Instant Weight-Space Consolidation for Long-Term Memory in LLMs · Original paper figure · Extracted the figure area from page 3 of the original PDF.

## Why text-only memory leaves the weights unchanged

Systems such as Mem0, A-Mem and Generative Agents extract facts or summaries from conversations, store them as profiles, graphs or episodes, and retrieve fragments when a question arrives. Each stage can lose information: extraction misses implicit facts, indexing drops context, and retrieval may return the wrong fragment. Because the weights never change, patterns that no single fragment states, and preferences that build up slowly, have no route into the model.

Fine-tuning on past interactions is the obvious way to put experience into weights, and some recent work does it at test time with SGD or with an entropy gate. That route needs backpropagation at serving time, and the authors report that gradient-based consolidation degrades as the history grows, because the gradient signal becomes noisy and early sessions are overfitted.

CLAM is built to write sessions into weights without backpropagation at serving time.

## A carried latent state compiled into an adapter

At answer time the model is evaluated as \\(y = f\_{\\theta+\\Delta W}(q, C)\\), where \\(\\theta\\) holds the frozen base weights, \\(\\Delta W\\) is the adapter and \\(C\\) is the local context from the buffer. The adapter is produced by a hypernetwork that reads the whole session stream in one pass, so this channel runs once per stream and is cached without depending on the query.

The split follows from the roles: the adapter carries cross-session structure, and the buffer carries the query-specific text.

Each session is passed through the frozen base model, and the per-layer hidden states are collected as \\(Z\_t \\in \\mathbb{R}^{L \\times \|S\_t\| \\times d}\\), with \\(L\\) blocks and model dimension \\(d\\). A stack of Perceiver cross-attention blocks lets \\(m\\) latent queries pool these states into a fixed-size workspace, and each slot pools the session without looking at the other slots.

The carried state \\(Q\_t\\) is what keeps memory across sessions. At each step the encoder reads the new session with \\(Q\_{t-1}\\) as its latent queries, one self-attention layer lets the slots exchange information, and a gate mixes the result into the old state. The write is defined as follows. \\\[ g\_t = \\sigma\\big(W\_g\[x\_t; Q\_{t-1}\] + b\_g\\big), \\quad Q\_t = \\mathrm{LN}\\big((1-g\_t)\\, Q\_{t-1} + g\_t\\, x\_t\\big) \\\] The gate gives one scalar per slot, so some slots can keep long-lived facts while others are overwritten, and layer normalization limits magnitude drift over long streams.

A single decoder block maps the final state \\(Q\_N\\) to \\(L \\times r\\) output queries, one per layer and rank index, and each query becomes one rank-1 component. The components are assembled as follows. \\\[ \\Delta W\_\\ell = \\alpha\\, B\_\\ell A\_\\ell, \\quad A\_\\ell \\in \\mathbb{R}^{r \\times d\_{ff}}, \\quad B\_\\ell \\in \\mathbb{R}^{d \\times r} \\\]

## Episodic buffer and the query-time merge

A fixed-size parametric state cannot keep exact dates, names and figures with full fidelity, so a retrieval channel supplies them. Each session is embedded with all-MiniLM-L6-v2, and the top-k pieces by cosine similarity are returned with k=5 under a 7K-token budget, where pieces are at most 1,800 characters. The authors report that the gains hold across retriever choices and describe stronger indexing as complementary to the design.

At query time the cached adapter is loaded, the top-k spans are retrieved, the adapter is merged into the weights as \\(\\theta' = \\theta + \\Delta W\\), and the model generates from the query and the spans. Only the first step is amortised across queries for a user. Retrieval is an O(N) embedding comparison, the merge is a weight addition, and generation is standard.

## Training the hypernetwork by context distillation

The hypernetwork is trained by context distillation. A teacher answers each query with the full history in context, while the student is the frozen base model wearing only the generated adapter. The objective is written as follows. \\\[ \\mathcal{L}(\\phi) = \\mathbb{E}\_{(S,q,y)\\sim\\mathcal{D}}\\big\[-\\log p\_{\\theta+H\_\\phi(S)}(y \\mid q)\\big\] \\\] This is a cross-entropy on the teacher answers with a small adapter-magnitude penalty, and only the hypernetwork parameters \\(\\phi\\) are updated while the base model stays frozen.

Training uses no retrieval, so the adapter alone has to carry the answer.

Stage 1 starts from a released document-to-adapter checkpoint, and the gate, self-attention and positional embedding are inserted as no-ops that keep the pre-trained behaviour. Reported checkpoints are 25K Stage-2 steps for Gemma-2-2B and 8K for Qwen3-4B and Mistral-7B, trained once per base model on a single A100-80GB and not per conversation.

## Synthetic multi-session training data

No public dataset gives multi-session, memory-dependent training data at scale, since LoCoMo has about 10 conversations and LongMemEval has a few hundred questions. The authors generate this data with an automated six-stage pipeline driven by Llama-3.3-70B-Instruct, following the planted-evidence and distractor recipes of LongMemEval and LoCoMo.

The events are rendered as multi-turn sessions that reveal facts naturally, and distractor sessions are interleaved to depths beyond a hundred, so evidence is sparse.

A must-require-memory filter removes any question the base model answers without history, keeping about 82% of candidates. The corpus has about 900K trajectories from 23,984 distinct personas, with a median of 14 history chunks per trajectory.

## Benchmarks, baselines and judge

Every system runs on Gemma-2-2B, Qwen3-4B and Mistral-7B.

The agentic baselines are Mem0, A-Mem, Generative Agents, MemoryBank and SimpleMem, each run with its published pipeline. The parametric baselines are TMEM in once-per-conversation and per-question modes, TLM, test-time LoRA, FT-Ceiling and two D2L variants. Accuracy is graded by llama3.3-70b-instruct at temperature 0, with one identical prompt for every system.

## Comparison with agentic memory systems

Its lead over Mem0, the strongest agentic system there, is 6.0 points on Gemma-2-2B, 1.2 on Qwen3-4B and 12.0 on Mistral-7B. No other agentic system comes within 12 points of CLAM on any base.

On LongMemEval-S, CLAM leads every agentic baseline on Gemma-2-2B by 10.4 to 37.0 points and on Mistral-7B by 20.2 to 41.9 points.

In 28 of the 30 paired comparisons, the 95% bootstrap interval lies entirely away from zero.

## What building the memory costs

On Qwen3-4B over LoCoMo, building CLAM's memory for one conversation takes 10.3 seconds, with zero decode calls, zero LLM tokens and zero gradient steps. TMEM-per-question rebuilds its memory for each question, and one rebuild uses 315.0 gradient steps and 107.5 decode calls and takes 459.0 seconds.

Across extraction systems, the paper reports 3–151× less wall-clock time to build memory, and 1.3–16× less against gradient-based methods that take 18–63 backward passes. At answer time the cost moves the other way: CLAM uses 1,583 LLM tokens per question in Table 4, against 778 for Mem0.

## Weight-space baselines without retrieval

On LoCoMo, the consolidation channel alone scores 20.6, 21.7 and 18.3 across the three bases. The claim in the same section is that the channel leads both D2L variants on both benchmarks, which the Mistral-7B LoCoMo cell does not match.

The full CLAM system scores 48.3, 41.7 and 50.6 on LoCoMo and 39.3, 43.4 and 53.2 on LongMemEval-S.

## Behaviour as histories grow

On LongMemEval-S, described as having histories 4.5× longer, FT-Ceiling falls to between 5.2 and 7.5, while the consolidation channel stays between 15.0 and 15.6.

Broken down by evidence depth on LongMemEval-S without retrieval, FT-Ceiling loses 2.2 points per 10 sessions of depth, while CLAM stays flat.

## Whether the adapter adds to retrieval

The paper reports these intervals as conversation-clustered, with all of them clear of zero.

On Mistral-7B, where the oracle buffer already reaches 79%, the adapter adds +0.1. The authors read the remaining gain as the weights carrying cross-session integration and accumulated preferences, rather than a better-indexed copy of the buffer.

On the 36% of questions where the buffer misses the gold evidence, the adapter adds 12.4, 13.7 and 15.1 points. Where the buffer retrieves the evidence, the additions are 3.9, 9.7 and 3.2. The gain stays positive when the evidence is already in context, which the authors take to mean the adapter helps the model use the evidence it is given.

## Carried state and adapter controls

The ablation table groups three controls on LoCoMo judge accuracy: one stream versus both, the consolidation gate, and whether any adapter would do. Resetting the carried state at every session drops the learned-gate row from 21.9, 22.0 and 23.8 to 16.7, 17.2 and 24.1, and the reset costs 5.2 points on Gemma-2-2B and 4.8 on Qwen3-4B. On Mistral-7B the reset row is 24.1 against 23.8, so no drop appears there.

Ungated writes, which overwrite the state with g\_t set to 1, score 21.4, 21.2 and 22.5.

Without any adapter, the base model scores 1.1, 3.9 and 2.8, while a random adapter of the same shape scores 0.0, 0.6 and 0.0. The panels disagree on the consolidation-only value: the learned-gate row reads 21.9, 22.0 and 23.8, while the CLAM adapter row in panel (c) and the consolidation-only row of Table 3 read 20.6, 21.7 and 18.3. The excerpt does not explain the difference.

## Checking the judge and the metric

Because the grader shares a model family with the data generator, identical outputs were re-graded by three other judges under the same prompt.

Cover-EM is a containment score, defined as follows. \\\[ \\mathrm{CoverEM}(p,G) = \\max\_{g \\in G} \\mathbb{1}\\big\[\\mathrm{nrm}(g) \\subseteq \\mathrm{nrm}(p)\\big\] \\\] Here \\(p\\) is a prediction, \\(G\\) its gold answers and \\(\\mathrm{nrm}\\) the standard normalization, and the reported figure is the mean over questions. Extra words in the prediction are neither rewarded nor penalized, which keeps the score independent of answer length.

Repeated under Cover-EM, the main tables keep the broad ordering of the systems.

## The full-context teacher as a reference

The Llama-3.3-70B teacher reads the entire history in context, and it scores 68.3 on LoCoMo, where histories are about 24k tokens. On LongMemEval-S, with histories of about 109k tokens, the teacher falls to 33.5, below CLAM on every base.

## Limitations

The evaluation covers two English conversational-memory benchmarks and base models of 2–7B parameters, and behaviour at larger scale, in other languages and on documents or code is not tested. The parametric baselines are compared on a 180-question LoCoMo subset, and Table 4 reports build cost for Qwen3-4B over LoCoMo only.

The adapter is a fixed-size store, and the authors expect that scaling the adapter rank and the hypernetwork's parameter count could give better results, which this work does not test.

## Paper info

- **Authors**: Manan Suri, Dinesh Manocha
- **Venue**: arXiv · Preprint
- **First published**: 2026-11-16
- **Added**: 2026-11-17
- **Updated**: 2026-11-16
- **Version**: v1
- **arXiv**: 2611.20759
- **Category**: cs.CL
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2611.20759v1) · [PDF ↗](https://arxiv.org/pdf/2611.20759v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

Agentic memory systems give LLMs persistent memory by extracting experience into text and retrieving it at query time, but the model itself does not evolve: however many interactions it has had, it starts each query the same. Extraction errors compound, implicit cross-session patterns that no single fragment states cannot be surfaced, and the construction cost grows with every conversation. Fine-tuning on past interactions does change the weights, but requires backpropagation at serving time and degrades on long histories. We introduce CLAM (Carried Latent Adapter Memory), which combines the strengths of both: a recurrent hypernetwork performs parametric consolidation, compiling a stream of session activations into a low-rank adapter in a single forward pass with no gradient steps and no language-model generation calls, while a complementary episodic buffer supplies verbatim detail at inference. A gated latent state carries knowledge across sessions in fixed size, so the parametric memory accumulates without growing. On LoCoMo and LongMemEval-S across three open models (2-7B parameters), CLAM leads all agentic baselines by 1-45 points and all gradient-based parametric methods by 10-45 points, while requiring zero generative LLM calls, zero gradient steps, and 3-151x less wall-clock time than extraction systems to build its memory. The two channels are complementary: the consolidated adapter adds 12-15 accuracy points when the episodic buffer misses the gold evidence, and still adds 4-5 points even with an oracle buffer.

## Quote from the paper

Manan Suri, Dinesh Manocha (2026). Instant Weight-Space Consolidation for Long-Term Memory in LLMs. arXiv:2611.20759v1. https://arxiv.org/abs/2611.20759v1

**BibTeX**

```
@misc{suri2026instant,
  title = {{Instant Weight-Space Consolidation for Long-Term Memory in LLMs}},
  author = {Manan Suri and Dinesh Manocha},
  year = {2026},
  eprint = {2611.20759},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.20759v1}
}
```

## Other paper commentary

- [A First Look at System One Decision Models for Malware Detection](https://refivu.com/en/papers/d7188362-7fe4-49a4-b9d4-ee9f2814aa06-a-first-look-at-system-one-decision-models.md)
- [Language Models Meet Vibration Testing for LEO Constellation Satellites with Calibrated Response Prediction from Few-show Sweeps](https://refivu.com/en/papers/d307c57d-6ae8-4165-a834-80f2827101d4-language-models-meet-vibration-testing-for-leo-constellation.md)
- [When the Cheapest Feasible Router Fails: Auditing Deployment Commitments in Cost-Aware LLM Routing](https://refivu.com/en/papers/d992d0b2-38b5-446b-9139-ac49d02c18fb-when-the-cheapest-feasible-router-fails-auditing-deployment.md)
- [Risk-certified prompt optimization for LLM-as-a-judge guardrails](https://refivu.com/en/papers/5761a2cd-94aa-40cd-99c2-9a639057b6a3-risk-certified-prompt-optimization-for-llm-as-a.md)
- [Making Preemption Productive in Long-Output LLM Serving](https://refivu.com/en/papers/9b0d4dbe-5b49-451b-bbf8-332c064c718b-making-preemption-productive-in-long-output-llm-serving.md)
- [Agentic On-Policy Distillation Implicitly Reshapes LLMs' ReAct Patterns](https://refivu.com/en/papers/55212eb2-2bf0-44da-9bd0-02b1a8938860-agentic-on-policy-distillation-implicitly-reshapes-llms.md)
- [UniGraph: A Unified Graph-based Index for Dynamic Hybrid Dense-Sparse Vector Retrieval](https://refivu.com/en/papers/a5ee1bb8-7883-49ee-91f4-322d407f8039-unigraph-a-unified-graph-based-index-for-dynamic.md)
- [AdMem: Expectation-Grounded Procedural Memory for Long-Horizon Task-Solving Agents](https://refivu.com/en/papers/38393e75-1ceb-46fa-abaa-bc11cb447cee-admem-expectation-grounded-procedural-memory-for-long.md)
- [ToolGraph as a Q-Function for Test-Time Scaling of Tool-Use Agents](https://refivu.com/en/papers/c86b8c10-1fa4-4795-ab5c-6d8fbed7450e-toolgraph-as-a-q-function-for-test-time.md)
- [ReRead: Wrong Predictions, Useful Representations - Correcting Frozen Robot Policies by Re-reading Their Own Representations](https://refivu.com/en/papers/8296ea66-ea3c-4b5e-a10d-c73916f082a8-reread-wrong-predictions-useful-representations-correcting.md)
- [DexFormer 2.0: Towards a Cross-Embodiment Foundation Policy for Dexterous Grasping](https://refivu.com/en/papers/198188b6-2d22-44da-9ba3-93ce7566fc83-dexformer-2-0-towards-a-cross-embodiment-foundation.md)
- [How Reliable Is Visual Token Selection? Rethinking Pruning in Multimodal LLMs](https://refivu.com/en/papers/f4f12ad2-951c-4840-88b3-b100cffd3c70-how-reliable-is-visual-token-selection-rethinking-pruning.md)

## Terms in this paper

- [LoRA](https://refivu.com/en/terms/bee764895c36-lora)
- [LLM](https://refivu.com/en/terms/c8783141d968-llm)
- [context distillation](https://refivu.com/en/terms/b29adfb034f0-context-distillation)
- [low-rank adapter](https://refivu.com/en/terms/b299217e8d1c-low-rank-adapter)
- [Mem0](https://refivu.com/en/terms/cad97cd9c87b-mem0)
- [Mistral-7B](https://refivu.com/en/terms/b89deef91181-mistral-7b)
- [Test-Time Training](https://refivu.com/en/terms/a740f645f3da-test-time-training)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/d7e910e4-bc6c-4c84-b5c0-2c8df4c15f81-instant-weight-space-consolidation-for-long-term-memory)
