cs.AISep 25, 2026

HasMem: Hard-Origin Adaptively Softened Memory for Long-Term LLM Agents

Authors: Zihong He, Junxiao Shen, Chen Liang, Hai-Ning Liang

Organizations: The Hong Kong University of Science and Technology (Guangzhou) · University of Bristol · The Hong Kong University of Science and Technology

Abstract

Text-based memory and context compression support reuse of past interactions. Resizing continuous memory changes the input to a frozen LLM, coupling capacity allocation with readout. We propose Hard-Origin Adaptively Softened Memory (HasMem). Frozen hard-prompt embeddings provide a verifiable initial state. A controller adjusts memory widths, a Writer re-encodes resized entries, and Reader and Global provide readout adaptation and cross-turn state. On all 535535 questions in a reconstruction probe derived from the Multi-Session Chat (MSC) development split, the main configuration achieves lexical F1 of 95.395.3 (+4.4+4.4 percentage points) at 93.6%93.6\% of the hard reference's framed memory positions. With approximately matched per-question target body budgets, six configurations at mean per-entry retention around 0.830.83--0.910.91 exceed rule-based re-encoding by 8.08.0--23.623.6 exact-match (EM) percentage points. With fixed model parameters and rule target width ratio 0.750.75, Global's EM gain passes a user-level exact paired test with Bonferroni correction over eight comparisons. On all 500500 LongMemEval-S questions, local lexical F1 rises from the hard reference's 3.43.4 to 8.98.9, and answer negative log-likelihood (NLL) falls from 12.25712.257 to 5.2745.274. F1 gains accompany lower EM on both evaluations.

Figures & tables

Appendix figures & tables14 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. LazyMem: Retrieve Broadly, Construct Selectively for Efficient Long-Term Agent Memory

    Jul 17, 2026Jing Yu, Yibo Zhao, Jiaming Zhang +1Persistent Memory for Language ModelsLong-Term Conversational Memory

  2. AdaMem: Learning What to Remember with Adaptive Memory Policies for Personalized Agents

    Jun 19, 2026Xingyu Chen, Rui Wang, Zhaopeng Tu +1LLM Agent MemoryPersistent Memory for Language Models

  3. ElasticMem: Latent Memory as a Learnable Resource for LLM Agents

    May 29, 2026Tao Feng, Chongrui Ye, Tianyang Luo +5LLM Agent MemoryPersistent Memory for Language Models