Conversational agents struggle to handle long conversations due to context window limitations. Therefore, memory systems are developed to leverage essential historical information. Existing memory systems typically follow a pipeline of offline memory construction and update, and online retrieval. Despite the flexible online phase, the offline phase remains fixed and task-independent. In this phase, memory construction operates under a predefined workflow and fails to emphasize task relevant information. Meanwhile, memory updates are guided by generic metrics rather than task specific supervision. This leads to a misalignment between offline memory preparation and task requirements, which undermines downstream task performance. To this end, we propose an Adversarial Memory Adaptation mechanism (AMA) that aligns memory construction and update with task objectives by simulating task execution. Specifically, first, a challenger agent generates question answer pairs based on the original dialogues. The constructed memory is then used to answer these questions, simulating downstream inference. Subsequently, an evaluator agent assesses the responses and performs error analysis. Finally, an adapter agent analyzes the error cases and performs dual level updates on both the construction strategy and the content. Through this process, the memory system receives task aware supervision signals in advance during the offline phase, enhancing its adaptability to downstream tasks. AMA can be integrated into various existing memory systems, and extensive experiments on long dialogue benchmark LoCoMo demonstrate its effectiveness.
翻译:对话代理因上下文窗口限制难以处理长对话,因此需开发记忆系统以利用关键历史信息。现有记忆系统通常遵循离线记忆构建与更新、在线检索的流程。尽管在线阶段具有灵活性,离线阶段仍保持固定且与任务无关。在此阶段,记忆构建遵循预定义流程,未能突出任务相关信息;同时记忆更新依赖通用指标而非任务特定监督。这导致离线记忆准备与任务需求错配,进而损害下游任务性能。为此,我们提出对抗性记忆适配机制(AMA),通过模拟任务执行使记忆构建和更新与任务目标对齐。具体而言:首先,挑战者代理基于原始对话生成问答对;随后利用已构建的记忆回答这些问题以模拟下游推理;接着,评估者代理对回答进行评估并执行错误分析;最后,适配器代理分析错误案例,并对构建策略与内容进行双重更新。通过此流程,记忆系统在离线阶段预先接收任务感知监督信号,从而增强其对下游任务的适应能力。AMA可集成至多种现有记忆系统,在长对话基准LoCoMo上的大量实验验证了其有效性。