MemTrace: Rastreamento e Atribuição de Erros em Sistemas de Memória de Grandes Modelos de Linguagem
MemTrace: Tracing and Attributing Errors in Large Language Model Memory Systems
May 27, 2026
Autores: Xinle Deng, Ruobin Zhong, Hujin Peng, Xiaoben Lu, Yanzhe Wu, Guang Li, Buqiang Xu, Yunzhi Yao, Jizhan Fang, Haoliang Cao, Junjie Guo, Yuan Yuan, Ziqing Ma, Yuanqiang Yu, Rui Hu, Baohua Dong, Hangcheng Zhu, Ningyu Zhang
cs.AI
Resumo
A memória é essencial para permitir que modelos de linguagem de grande escala suportem raciocínio de longo horizonte, no entanto, os sistemas de memória existentes permanecem pouco confiáveis e difíceis de depurar. Rastrear a evolução dinâmica da memória é crucial para entender como a informação é sintetizada, propagada ou corrompida ao longo do tempo. Neste trabalho, estudamos o novo problema de rastreamento e atribuição de erros em sistemas de memória de LLMs. Propomos uma nova estrutura que transforma pipelines de memória em gráficos executáveis de evolução da memória, permitindo o rastreamento refinado do fluxo operacional de informação. Em seguida, construímos o MemTraceBench, um benchmark coletado a partir de sistemas de memória representativos, como Long-Context, RAG, Mem0 e EverMemOS, para estudar sistematicamente os modos de falha de memória. Além disso, introduzimos um método automático de atribuição que rastreia iterativamente subgráficos de operação para identificar a causa raiz de qualquer caso de falha. Nossa análise revela que as falhas de memória são sistemáticas, decorrentes de problemas no nível da operação, como perda de informação e desalinhamento na recuperação. Crucialmente, aproveitamos esses sinais de atribuição refinados para orientar a otimização de prompts a jusante, estabelecendo um sistema em malha fechada que corrige automaticamente falhas e melhora o desempenho da tarefa final em até 7,62%. O código será disponibilizado em https://github.com/zjunlp/MemTrace.
English
Memory is essential for enabling large language models to support long-horizon reasoning, yet existing memory systems remain unreliable and difficult to debug. Tracing memory's dynamic evolution is crucial to understand how information is synthesized, propagated, or corrupted over time. In this work, we study the new problem of error tracing and attribution in LLM memory systems. We propose a novel framework that transforms memory pipelines into executable memory evolution graphs, enabling fine-grained tracing of operational information flow. We then construct MemTraceBench, a benchmark collected from representative memory systems such as Long-Context, RAG, Mem0, and EverMemOS, to systematically study memory failure modes. We further introduce an automatic attribution method that iteratively traces operation subgraphs to pinpoint the root cause of any failed case. Our analysis reveals that memory failures are systematic, stemming from operation-level issues like information loss and retrieval misalignment. Crucially, we leverage these fine-grained attribution signals to guide downstream prompt optimization, establishing a closed-loop system that automatically corrects faults and boosts end-task performance by up to 7.62%. Code will be released at https://github.com/zjunlp/MemTrace.