MemFold: Learning Compact Soft Memory for Long-Context Personalization via On-Policy Optimization
Jingxuan Wu, Yuzhe Yang, Yiqiao Huang, Chengzhi Liu, Qingni Wang, Chengxuan Qian, Shutong Wu, Jiawei Zhang, Xin Eric Wang
Abstract
An assistant that serves the same user over a long horizon has to answer from what that user has revealed: which preferences still hold, which were revised, and which constraints apply now. Retaining that information is not the same as acting on it, and the two are usually optimized as if they were. Keeping the information as text makes the reader's input grow with the retained history, while compressing it into a fixed number of latent vectors bounds the interface but is typically trained to reconstruct text or imitate reference answers, both of which are scored on sequences the reader never produced. We present MemFold, which optimizes a fixed-budget soft memory by the behavior it supports. A query-conditioned textual memory is compressed into K continuous vectors that form the reader's memory interface, and the reader is then trained on its own rollouts under two complementary signals: group-relative rewards for task outcomes, and confidence-gated on-policy distillation in which a frozen textual-memory teacher re-scores the student's sampled tokens under the textual memory. The teacher is never sampled from, so supervision stays on the student's current distribution and adds no autoregressive decoding; at inference it is removed entirely. Across three Qwen backbones, MemFold attains the highest accuracy we measure on PersonaMem-32K and PersonaMem-128K, with margins that widen at the longer history length, and transfers to PrefEval and LongMemEval without target-domain training. Ablations attribute most of the task gain to the reward term and a smaller additional gain to the teacher signal, and memory interventions show that the reader depends on the instance-specific content of its soft memory.
Create a lesson
Related papers
Persistent Context Graphs for Efficient Memory Compaction in LLM Agents
Shared title terminologycs.CLJingbo Yang, Kwei-Herng Lai, Xiaowen Wang et al.
LongHarness Bench: Stress-Testing Language Model Harnesses for Long-Context Reasoning
Shared title terminologycs.CLQuang Hieu Pham, Thuy Duong Nguyen, Jocelyn Qiaochu Chen et al.
Learning What to Remember: Long-horizon Counterfactual Memory Optimization
Shared title terminologycs.CLJiaming Tang, Mingyan Liu, Armin Sarabi
Selecting What Matters: Semantic Compression-Guided Selective Pooling for Long-Context Embeddings
Shared title terminologycs.CLZifeng Cheng, Jie Zheng, Zhiwei Jiang et al.
CoT-Proxy: Cross-Format Transfer for Distilling Long-Horizon Policies
Shared title terminologycs.CLDawid J. Kopiczko, Tijmen Blankevoort, Yuki M. Asano
LimeTree: Linear-Memory Graph Neural Networks over Tree-Graphs for Resource-Efficient Language Modeling and Context Extrapolation
Shared title terminologycs.CLElisabeth Fink