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 and 1 others
University of California, Santa Barbara · University of North Carolina at Chapel Hill · Harvard University · University of Wisconsin–Madison
Published September 29, 2026 · on the feed October 2, 2026 · ▲ 7 · arXiv 2609.36435
The 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.
The Brief
3:14A short podcast summary of the paper. Written and voiced by AI.
Transcript
MemFold. Learning Compact Soft Memory for Long-Context Personalization via On-Policy Optimization. By Jingxuan Wu and eight others, from the University of California, Santa Barbara, the University of North Carolina at Chapel Hill, and two other institutions. Published on the twenty-ninth of September. Its code repository is worked out: about seventy-five source files, with a readme and a licence.
Picture an assistant serving the same person for a long time. To answer well it has to draw on what that person has revealed: which preferences still hold, which ones were revised, and which constraints apply right now. The authors draw a line that is easy to blur. Retaining that information is one thing. Acting on it is another. Yet the two are usually optimized as if they were the same.
The usual options each carry a cost. Keep the history as text, and the reader's input grows with everything retained. Compress it into a fixed number of latent vectors, and the interface is bounded, but such compressors are typically trained either to reconstruct text or to imitate reference answers. Both of those objectives are scored on sequences the reader itself never produced. The memory is graded on something other than what the reader does with it.
MemFold optimizes a fixed-budget soft memory by the behavior it supports. A textual memory, conditioned on the query, is compressed into K continuous vectors, and those vectors are the reader's whole memory interface. However much history the user has built up, the reader sees the same K vectors, so its input stays bounded. Then the reader is trained on its own rollouts. The training signal comes from what it actually generates, rather than from reconstructed text or from someone else's reference answers. Retaining and acting are no longer optimized as separate goals: the memory is judged by the behavior it makes possible.
Two complementary signals drive that training. The first is group-relative rewards for task outcomes: did the answer get it right. The second is confidence-gated on-policy distillation. Here a frozen teacher, which has the full textual memory, re-scores the tokens the student sampled, under that textual memory.
The teacher is never sampled from. That keeps supervision on the student's current distribution, and it means the teacher adds no autoregressive decoding of its own. At inference the teacher is removed entirely, and only the reader and its compact memory remain.
Testing spans three Qwen backbones. On PersonaMem-32K and PersonaMem-128K, MemFold attains the highest accuracy among the systems measured, and its margins widen at the longer history length. The gap grows, that is, as there is more history to compress. It also transfers to PrefEval and to LongMemEval without any training in those target domains.
The ablations split the credit. Most of the task gain is attributed to the reward term, and a smaller additional gain to the teacher signal. Memory interventions add one more check: the reader depends on the instance-specific content of its soft memory. What is in the vectors for this particular user is what the answers rest on.
Compressing memory is the familiar half of this. The shift MemFold makes is in what the compression answers to. Instead of rewarding a memory for preserving text, it rewards the memory for the answers the reader produces from it, on the reader's own samples, and keeps a text-reading teacher only as long as training lasts.
Paper Quest · 7 chapters · about 41 min
Play this paper
Learn it by doing: make the calls the authors made, guess the result before you see it, and defend it in a viva graded on your own words. Chapter 1 is right here.
Chapter 1 🧩 · The problem
Every quest starts with a wall. Here it is a memory usually graded on something other than what the assistant does with it.
You are building an assistant that serves one user for months. To answer well it must use what they revealed: which preferences still hold, which were revised, and which constraints apply now.
The road ahead
- 1 · The problem ~7 min A long-serving assistant must act on what a user revealed, but text memory keeps growing and compressed memory is trained on the wrong thing.
- 2 · What came before ~3 min
- 3 · The key idea ~9 min MemFold judges a fixed set of memory vectors by the answers the reader itself writes, using task rewards plus a frozen full-text teacher.
- 4 · Choose your own research ~3 min
- 5 · Build the method ~8 min Write query-focused notes, compress them to K vectors, sample answers, score them with rewards and teacher re-scoring, then drop the teacher.
- 6 · The experiment ~6 min You’ll guess: MemFold trains with two signals, a task reward and a teacher signal. Which did ablations credit with most of the task gain?
- 7 · The viva ~5 min Three questions from the examiners, answered in your own words. Win it for the paper’s trophy.
Free, with Google or an email address. Your stars and progress are kept.