Enhancing Conversational Agents via Task-Oriented Adversarial Memory Adaptation

Yimin Deng, Yuqing Fu, Derong Xu, Yejing Wang, Wei Ni, Xiangyu Zhao, Xiaopeng Li, Chengxu Liu, Xiao Han, Guoshuai Zhao, Li Zhu, Xueming Qian · DOI

Abstract

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.

Introduction

Large Language Models (LLMs) face significant challenges in maintaining coherence over long, multi-turn conversations due to their finite context windows. To mitigate this, developers use memory systems that extract and store key facts from dialogue history for later retrieval. However, traditional memory systems often suffer from a misalignment between their offline construction phase and the online task requirements.

Standard offline phases typically use generic summarization rules (e.g., "extract entities") that may discard information critical for specific downstream tasks, such as temporal reasoning or complex multi-hop queries. This paper introduces Adversarial Memory Adaptation (AMA), a plug-and-play mechanism designed to inject task-specific supervision into the memory construction process.

Methodology: Adversarial Memory Adaptation (AMA)

AMA transforms memory construction from a passive summarization task into an active, self-correcting loop. It utilizes a multi-agent framework to simulate downstream task execution during the offline phase.

The AMA multi-agent feedback loop for task-oriented memory construction.

The framework consists of three primary agents:

  1. Challenger Agent: Simulates potential user queries by generating task-specific question-answer (QA) pairs from the raw dialogue.
  2. Evaluator Agent: Tests the current memory by attempting to answer the Challenger's questions. It identifies failures, such as missing information or hallucinations.
  3. Adapter Agent: Performs a dual-level update based on the Evaluator's feedback. It executes a Content Update by injecting missing facts directly into the database and a Strategy Update by refining the extraction prompts to prevent similar omissions in the future.

Experimental Evaluation

The effectiveness of AMA was evaluated using the LoCoMo (Long-Context Conversational Memory) benchmark. LoCoMo features extremely long dialogues (averaging 16K tokens) and tests memory performance across four categories: Multi-hop reasoning, Temporal reasoning, Open-domain knowledge, and Single-hop factual recall. AMA was integrated into three state-of-the-art memory architectures: A-MEM, LightMEM, and Nemori.

Key Results

Integration of AMA consistently improved performance across all baseline systems and LLM backbones (GPT-4o and GPT-4o-mini).

LLM Score improvements across different memory systems and task categories when using AMA.

Key performance highlights include:

  • Semantic Quality: Using an LLM-as-a-judge, AMA boosted average scores for LightMEM by +3.4% and Nemori by +2.5%.
  • Complex Reasoning: The most significant gains were observed in challenging categories. For instance, LightMEM + AMA achieved a +10.3% improvement in Open-Domain question scores.
  • F1 and BLEU Scores: For Nemori + AMA using GPT-4o-mini, average F1 scores increased from 49.92 to 52.44, while BLEU-1 scores rose from 39.63 to 42.25.

Key Insights

  • Task-Driven Alignment: Simulating actual tasks ensures the memory system retains specific nuances required for downstream success, outperforming generic summarization.
  • Dual-Level Updates: Ablation studies confirmed that both content and strategy updates are essential; fixing the extraction strategy is as critical as fixing the data itself.
  • Efficiency: AMA is highly efficient, achieving near-optimal performance with as little as one generated QA pair per conversation session.
  • Universal Compatibility: The mechanism is architecture-agnostic, successfully enhancing diverse memory systems.

Conclusion

Adversarial Memory Adaptation (AMA) effectively bridges the gap between offline memory preparation and online task execution. By employing a multi-agent feedback loop, it ensures that conversational agents have access to task-relevant, high-quality memory. While the use of additional agents introduces some computational overhead, the significant gains in reasoning and recall accuracy make it a powerful tool for enhancing long-context conversational agents.

Summary updated

BibTeX
@misc{deng2026enhancing,
  author = {Yimin Deng and Yuqing Fu and Derong Xu and Yejing Wang and Wei Ni and Xiangyu Zhao and Xiaopeng Li and Chengxu Liu and Xiao Han and Guoshuai Zhao and Xiangyu Zhao and Li Zhu and Xueming Qian},
  title = {{Enhancing Conversational Agents via Task-Oriented Adversarial Memory Adaptation}},
  year = {2026},
  eprint = {2601.21797},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.21797},
}
Figure