MemFold:通过在线策略优化学习用于长上下文个性化的紧凑软记忆

·

研究论文 · 2026/10/03

MemFold 提出一种通过行为优化固定预算软记忆的方法,用于长上下文个性化。它将查询条件文本记忆压缩为 K 个连续向量作为阅读器的记忆接口,并利用任务结果的组相对奖励和置信门控的在线策略蒸馏(教师为冻结的文本记忆模型,仅对学生采样令牌重新评分)训练阅读器。在三个 Qwen 骨干上,MemFold 在 PersonaMem-32K 和 PersonaMem-128K 上取得最高准确率,且随历史长度增加优势扩大,并能零样本迁移到 PrefEval 和 LongMemEval。消融实验表明任务增益主要来自奖励项,教师信号带来较小额外增益,记忆干预显示阅读器依赖软记忆的实例特定内容。

MemFold 为长上下文个性化提供了一种高效且有效的软记忆优化框架,在多个基准上取得领先结果,且无需目标域训练即可迁移,对实际部署有重要价值。

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.

阅读原文

参与讨论