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

AuthorsHyeonjeong Ha, Jeonghwan Kim, Cheng Qian et al.

arXiv 20262026

TL;DR

MEMGUARD uses type-aware memory reorganization and dynamic routing to prevent heterogeneous memory contamination, reaching 89.53% anti-hallucination accuracy on HaluMem (+28.27% over MemOS).

SharePost on XLinkedIn

Read our summary here, or open the publisher PDF on the next tab.

THE PROBLEM

Heterogeneous Memory Contamination Causes 97.7% Unverifiability Errors

Conversational memory mixes semantic facts, episodic events, and procedural rules, causing heterogeneous memory contamination when functional boundaries are weak.

On LoCoMo, 97.7% of unverifiability errors stem from write-time contamination, while 63.8% of factuality errors come from retrieval-time contamination.

HOW IT WORKS

MEMGUARD: Type-Aware Memory Reorganization and Dynamic Routing

Type-Aware Knowledge Decomposition, Self-Verified Extraction, and the Relational Knowledge Graph let MEMGUARD break conversations into atomic, typed memories and link them safely.

Think of MEMGUARD as a card catalog in a library: facts, episodes, and procedures live in separate drawers, with cross-references instead of merged cards.

This structure plus Query-Adaptive Type Routing lets MEMGUARD retrieve only compatible memory types and compose evidence across types, something a plain context window cannot control.

DIAGRAM

Write-Time Memory Reorganization Lifecycle in MEMGUARD

This diagram shows how MEMGUARD reorganizes a conversation into typed memory atoms, verifies coverage, builds a relational graph, and writes into type-isolated stores.

DIAGRAM

Retrieval-Time Dynamic Memory Routing and Relational Composition

This diagram shows how MEMGUARD routes queries to memory types, retrieves primary contexts, and expands them via relational composition.

PROCESS

How MEMGUARD Handles a Long-Horizon Conversation Session

  1. 01

    Write-Time Memory Reorganization

    MEMGUARD converts each conversation into atomic memories using Type-Aware Knowledge Decomposition and Self-Verified Extraction, enforcing single-type constraints for every memory atom.

  2. 02

    Relational Knowledge Graph Construction

    MEMGUARD builds a directed, typed Relational Knowledge Graph over memory atoms, encoding cross-type dependencies without merging their contents.

  3. 03

    Type-Isolated Memory Writing

    MEMGUARD writes each atom into its corresponding store, using type-local comparison and ADD, UPDATE, or SKIP operations to avoid cross-type overwrites.

  4. 04

    Retrieval-Time Dynamic Memory Routing

    MEMGUARD applies Query-Adaptive Type Routing and Relational Knowledge Composition to retrieve type-compatible memories and expand them over the graph for answering.

KEY CONTRIBUTIONS

Key Contributions

  • 01

    Identification of Heterogeneous Memory Contamination

    MEMGUARD formalizes heterogeneous memory contamination and shows that 97.7% of unverifiability errors on LoCoMo arise from write-time contamination, with 63.8% factuality errors from retrieval-time contamination.

  • 02

    Type-Aware Memory Framework MEMGUARD

    MEMGUARD introduces Type-Aware Knowledge Decomposition, Self-Verified Extraction, and a Relational Knowledge Graph to preserve functional boundaries during memory writing and retrieval.

  • 03

    Improved Hallucination Robustness with Fewer Tokens

    MEMGUARD achieves 89.53% anti-hallucination accuracy and 71.49% update correctness on HaluMem while retrieving up to 5.8× fewer memory tokens than A-Mem on LoCoMo.

RESULTS

By the Numbers

Acc. (%)

89.53

+28.27 over MemOS

F1

94.15

vs MemOS on HaluMem extraction

C (Update)

71.49

memory update correctness on HaluMem

# Avg. Token

1605

4.5× fewer tokens than A-Mem on LoCoMo (7244)

On HaluMem-Medium, which tests hallucination across memory extraction, updating, and question answering, MEMGUARD reaches 89.53% anti-hallucination accuracy and 94.15 F1. On LoCoMo, MEMGUARD attains 79.10% average accuracy with 2-hop retrieval using GPT-4.1-mini, showing that structured, type-aware memory improves reliability without scaling retrieval indiscriminately.

BENCHMARK

By the Numbers

On HaluMem-Medium, which tests hallucination across memory extraction, updating, and question answering, MEMGUARD reaches 89.53% anti-hallucination accuracy and 94.15 F1. On LoCoMo, MEMGUARD attains 79.10% average accuracy with 2-hop retrieval using GPT-4.1-mini, showing that structured, type-aware memory improves reliability without scaling retrieval indiscriminately.

BENCHMARK

Hallucination Evaluation on HaluMem: Extraction Anti-Hallucination Accuracy

Acc. (%) for memory extraction anti-hallucination accuracy on HaluMem-Medium.

BENCHMARK

Utility Evaluation on LoCoMo: Average Accuracy (GPT-4.1-mini Setting)

Avg. accuracy (%) across LoCoMo tasks under GPT-4.1-mini base LLM and GPT-4.1 judge.

KEY INSIGHT

The Counterintuitive Finding

MEMGUARD retrieves up to 5.8× fewer memory tokens than A-Mem on LoCoMo while still achieving higher average accuracy and stronger adversarial performance.

This is counterintuitive because many memory-augmented systems assume more retrieved context always helps, but MEMGUARD shows that selective, type-aware retrieval can be both leaner and more reliable.

WHY IT MATTERS

What this unlocks for the field

MEMGUARD unlocks long-term conversational agents that treat episodic, semantic, and procedural memories as distinct evidence sources with controllable interactions.

Builders can now design memory-augmented LLMs that maintain personalization and long-horizon reasoning while explicitly governing which memory types are allowed to influence each answer.

~12 min read← Back to papers

Related papers

Agent MemoryLong-Term Memory

Adaptive Memory Admission Control for LLM Agents

Guilin Zhang, Wei Jiang et al.

· 2026

A-MAC scores candidate memories using Utility, Confidence, Novelty, Recency, and Type Prior combined by a learned linear admission policy with Algorithm 1 A-MAC Memory Admission. On the LoCoMo benchmark, A-MAC achieves F1 0.583 and 2644 ms latency, improving F1 by 0.042 and reducing latency by 1187 ms compared to A-mem.

Long-Term Memory

Advancing Open-source World Models

Robbyant Team, Zelin Gao et al.

arXiv 2026 · 2026

LingBot-World combines a Data Engine, Fundamental World Model, Action-Conditioned World Model, and Post-Training causal adaptation to turn a 28B-parameter video generator into a real-time interactive world simulator. On the VBench benchmark, LingBot-World achieves a dynamic degree of 0.8857 versus 0.7612 for Yume-1.5, while also improving imaging quality to 0.6683.

BenchmarkBenchmarkLong-Term Memory

AgenticAI-DialogGen: Topic-Guided Conversation Generation for Fine-Tuning and Evaluating Short- and Long-Term Memories of LLMs

Manoj Madushanka Perera, Adnan Mahmood et al.

· 2026

AgenticAI-DialogGen chains ChatPreprocessor, KnowledgeExtractor, TopicAnalyzer, KnowledgeGraphBuilder, PersonaGenerator, DuelingChat Agent, ConversationValidator, ConversationRefiner, QAGeneration, and PostProcessing to turn raw multi-session chats into topic-guided, persona-grounded conversations with explicit short- and long-term memories. On the TGC / KG memory QA benchmark, Mistral-7B fine-tuned within AgenticAI-DialogGen achieves 87.36 F1, compared to GPT-4’s 83.77 F1 in a zero-shot setting on the same task.

Questions about this paper?

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

Answers use this explainer on Memory Papers.

Checking…