MemGuard: Preventing Memory Contamination in Long-Term Memory-Augmented Large Language Models

TL;DR

MemGuard uses a type-aware framework to reduce memory contamination, improving memory reliability by 28.27%.

cs.CL 🔴 Advanced 2026-05-27 6 views
Hyeonjeong Ha Jeonghwan Kim Cheng Qian Jiayu Liu William M. Campbell Yue Wu Yuji Zhang Kathleen McKeown Dilek Hakkani-Tur Heng Ji
memory augmentation large language models memory contamination long-term reasoning type-aware

Key Findings

Methodology

MemGuard is a type-aware memory framework designed to maintain functional memory boundaries. It assigns each memory an explicit functional role at write time and selectively composes evidence only from necessary memory types during retrieval, thus reducing contamination from irrelevant or functionally incompatible evidence.

Key Results

  • On the HaluMem benchmark, MemGuard achieved 89.53% anti-hallucination accuracy, a 28.27% improvement over previous methods.
  • On the LoCoMo benchmark, MemGuard maintained competitive performance while reducing memory retrieval volume.
  • In long-term conversation tasks, MemGuard retrieved 5.8 times fewer memory tokens.

Significance

This study significantly enhances the reliability of long-term memory-augmented large language models by introducing a type-aware memory framework. It addresses the issue of heterogeneous memory contamination, which is crucial for personalization and long-term reasoning.

Technical Contribution

MemGuard introduces functional boundaries in memory writing, retrieval, and evidence composition, reducing memory contamination and improving memory update accuracy.

Novelty

MemGuard is the first to apply a type-aware framework to memory-augmented large language models, significantly reducing the issue of heterogeneous memory contamination.

Limitations

  • In complex dialogue scenarios, memory retrieval accuracy may still be an issue.
  • Further optimization is needed for handling larger datasets.

Future Work

Future research could explore applying MemGuard to more language models and further optimizing its performance for more complex dialogue scenarios.

AI Executive Summary

Memory contamination is a major challenge in long-term memory-augmented large language models. Existing systems often mix memories of different functions, leading to reasoning errors. MemGuard addresses this issue by introducing a type-aware memory framework. This framework assigns each memory an explicit functional role at write time and selectively composes evidence only from necessary memory types during retrieval. Experimental results show that MemGuard significantly improves memory reliability and reduces memory contamination across multiple benchmarks. However, further research is needed to optimize its performance in more complex scenarios.

Deep Analysis

Background

In recent years, memory-augmented large language models have shown great potential in personalization and long-term reasoning. However, these models often face the issue of memory contamination, where memories of different functions are wrongly mixed during retrieval, leading to reasoning errors.

Core Problem

The core problem is heterogeneous memory contamination, which causes models to use irrelevant or incompatible memories during reasoning. Solving this problem is crucial for improving model reliability.

Innovation

MemGuard's core innovation is the introduction of a type-aware memory framework that maintains functional boundaries during writing and retrieval, reducing memory contamination.

Methodology

  • �� Assign explicit functional roles to each memory at write time
  • �� Maintain type-isolated memory stores
  • �� Selectively compose necessary memory types based on the query during retrieval

Experiments

Experiments were conducted using benchmarks like HaluMem and LoCoMo to evaluate MemGuard's performance in reducing memory contamination and improving memory reliability.

Results

MemGuard achieved 89.53% anti-hallucination accuracy on the HaluMem benchmark and reduced memory retrieval volume in long-term conversation tasks.

Applications

MemGuard can be used in personalized dialogue systems and reasoning tasks requiring long-term memory.

Limitations & Outlook

While MemGuard performs well in reducing memory contamination, further optimization is needed for handling more complex dialogue scenarios.

Plain Language Accessible to non-experts

Imagine a library where books are categorized by topic. Whenever you need information, you only go to the relevant section rather than searching the entire library. MemGuard acts like this library's categorization system, ensuring you always find the most relevant information without being distracted by unrelated books.

ELI14 Explained like you're 14

Imagine you're playing a game and your character has many skills. During battles, you only use the most suitable skills, not all at once. MemGuard is like a helper that picks the best skills for you, ensuring you always make the best choices in the game!

Glossary

Memory Contamination

Refers to the incorrect mixing of memories with different functions during retrieval and use, leading to reasoning errors.

Memory contamination is the main research problem in the paper.

Type-Aware Memory

A memory framework that maintains functional boundaries during writing and retrieval.

MemGuard uses type-aware memory to reduce memory contamination.

Long-Term Memory

Refers to memories retained and used by the model over long periods.

Long-term memory is crucial for personalization and long-term reasoning in large language models.

Semantic Memory

A type of memory that stores facts and knowledge about the world.

In MemGuard, semantic memory is stored separately from other types.

Episodic Memory

A type of memory that stores personal experiences and events.

MemGuard manages episodic memory through a type-aware framework.

Open Questions Unanswered questions from this research

  • 1 How to further optimize MemGuard's performance in more complex dialogue scenarios.
  • 2 Exploring the potential of MemGuard in other language models.

Applications

Immediate Applications

Personalized Dialogue Systems

MemGuard can be used to improve the reliability of personalized dialogue systems by reducing reasoning errors.

Long-term Vision

Intelligent Assistants

In the future, MemGuard could be used to develop smarter assistants capable of accurate reasoning in complex scenarios.

Abstract

Memory-augmented large language models extend reasoning beyond a fixed context window by maintaining long-term memory across interactions. However, existing memory systems often collapse stable user facts, episodic events, and behavioral rules into a shared space, allowing functionally distinct memories to be retrieved and used as interchangeable evidence. We identify this failure mode as heterogeneous memory contamination, where context-specific events become overgeneralized claims, or semantically relevant but functionally incompatible memories mislead generation. To this end, we introduce MemGuard, a type-aware memory framework that preserves functional memory boundaries during memory construction and retrieval. It assigns each memory an explicit functional role at write time, maintains relations across type-isolated memories, and selectively composes evidence only from necessary memory types, reducing contamination from irrelevant or functionally incompatible evidence. Across hallucination and long-horizon conversation benchmarks, MemGuard improves memory reliability by up to 28.27% while retrieving up to 5.8x fewer memory tokens than prior methods. These results suggest that reliable long-term reasoning depends on principled organization and selective use of heterogeneous memory.

cs.CL cs.AI cs.LG