arXiv:2611.05636cs.AINov 2026

Manuscript Offprint

arXiv:2611.05636

Route to Remember: Adaptive Memory Selection for LLM Agents

Zeyu Fang, Jun Yin, Yongsheng Mei, Xu Han, Chaitali Joshi, Zhongkai Sun, Jie Hao, Bin Guo, Chengyuan Ma, Benjamin Z. Yao, Chenlei Guo

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

The memory of production agents is increasingly becoming a bottleneck and is built almost exclusively from text: key points are extracted from out-of-limit context and retrieved into context at query time. Therefore, every new query incurs an additional cost that grows with the accumulated history. Weight memory is a complementary alternative that internalizes knowledge into model parameters and answers with no context at all, and has recently proven effective in self-evolving agents for internalizing skills and behaviors. However, its application in episodic and semantic memory, such as user-specific facts, remains comparatively unexplored, and a gap remains between earlier attempts at weight memory and text-based systems regarding recall performance. We study how to make weight memory competitive as a long-term factual store by applying on-policy self-distillation (OPSD). It trains a context-free student from a teacher, which is the same model conditioned on the user's memory, together with a verify-then-regenerate router that lets weight and text memory each cover the queries they handle best. On the HaluMem benchmark, OPSD matches or surpasses strong text-memory baselines, including full-context prompting and retrieval systems, while reading fewer tokens per query. We further conduct an extensive study that characterizes the behavior of weight memory and analyzes how different training recipes affect its performance. As agent harnesses move toward persistent, multi-session deployments, these results position weight memory as a practical, low-cost component of agent memory and provide insights into feasible training and evaluation protocols for combining it with retrieval.

1 Introduction

Persistent agents need to recall project conventions, user preferences, and earlier interactions across sessions. Many memory systems store this information as text, then retrieve relevant entries into the prompt [Packer et al., 2023, Gutiérrez et al., 2025, Xu et al., 2026a, Li et al., 2025]. This design makes stored evidence inspectable but introduces retrieval and context-processing costs and depends on retrieving the relevant facts.

Storing memory in weights provides an alternative. If user history is internalized into parameters, the following queries can be answered without retrieval or context, so the marginal cost of a query stops depending on how long the dialogue is, and the cost is a training pass whenever memory is written. Early attempts to use weights as memory, however, underperform once the model is deprived of context at inference and are studied mostly for verbatim recall [Back et al., 2026, Xu et al., 2026b]. Recent self-evolving agents revive the idea more successfully, showing that on-policy

*Corresponding Author: Zeyu Fang, joey.fang@gwu.edu

40th Conference on Neural Information Processing Systems (NeurIPS 2026). Workshop: Personalized, aligned, long-term memory for AI systems.

distillation can internalize procedural skill into weights [Zhang et al., 2026a, Feng et al., 2026a]. But none of this work isolates the memory itself from the harness, and the case that matters most for personalization is left open: the episodic and semantic memories built from timestamped sessions can arrive incrementally, update, or even sometimes contradict each other. The nearest evidence is a diagnostic of substrate asymmetry [Deng, 2026], which compares a per-user adapter against retrieval and concludes that neither dominates and the two are complementary — leaving unanswered how far a parametric memory can actually be pushed on episodic and semantic recall and what it would take.

We address that question directly and apply on-policy self-distillation (OPSD): a per-user Low-Rank Adaptation (LoRA), referred to as the student, which is trained to reproduce, with no context at inference, the answers that the same model provides with context in the prompt, referred to as the teacher. The distillation takes place on the student's own distribution, so the objective matches the deployment condition. OPSD makes weight memory outperform every text baseline we test, but it requires extra training costs and inherits two limits intrinsic to its parameters: it forgets older facts along with new updates, and it cannot tell whether a fact was never recorded, so it confabulates instead of abstaining. Because weight and text memory fail on different questions, we then ask whether they can combine. We adopt verify-then-regenerate (VtR): the parametric memory answers first; those answers are audited against the text store, and only conflicted answers are regenerated with the retrieved evidence, auditing the produced answer rather than judging from the query.

These claims rest on a broad experimental study on benchmarks for long-term memory such as HaluMem Chen et al. [2025] and LoCoMo Maharana et al. [2024], and four findings stand out. First, OPSD reaches an overall QA accuracy of 59.9%, while ordinary Supervised Fine-Tuning (SFT) on identical data reaches 36.9%, which is below every text baseline; the accuracy holds across model variant scales. Second, the three memory paradigms differ less in accuracy than in how they degrade with question age: context truncates, weights forget gradually, retrieval barely notices, and within weight memory, the learned habit of declining survives while the content it protected decays. Third, the one deficit training does not fix is inspecting absence, which can be traced to a single training-side lever. The model's willingness to decline is attributable entirely to the ratio of refusal samples included in the training set. Fourth, VtR adds 6.2 points over OPSD and improves five of six question categories, whereas every other query-side routing signal we tried, including similarity, learned query features, model consistency, and answer confidence, can hardly predict whether the answer of weight-based memory is correct. Extensive analysis is conducted on these observations.

We summarize our contributions as follows.

  • An evaluation of OPSD for recent user-memory recall. On the question set for eight HaluMem-Long users, OPSD reaches 59.9%, compared with 47.8% for MemOS-style retrieval, 51.9% for extracted context, and 51.3% for raw dialogue. The advantage over retrieval is positive for all eight users, and the comparison with extracted context and retrieval holds at 4B, 9B, and 27B.

  • A characterization of retention and training effects. Repeated questions distinguish context truncation, gradual forgetting in weights, and more stable retrieval. Our ablations identify training-objective and refusal-supervision effects within the tested recipes, while cost accounting separates query token usage from unmeasured deployment costs.

  • A routing study and VtR integration. Query-side and confidence signals provide limited correctness information in our probes. Answer verification with text-based regeneration adds 6.2 points over OPSD on native HaluMem questions, improving five of six categories while reducing memory-conflict accuracy.

References (48)