EMNLP 2026 Findings

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

Facts, experiences, and routines serve different purposes. MemGuard keeps them distinct — and connects them when it matters.

Hyeonjeong Ha1, Jeonghwan Kim1, Cheng Qian1, Jiayu Liu1, William M. Campbell3, Yue Wu3, Yuji Zhang1, Kathleen McKeown2, Dilek Hakkani-Tür1, Heng Ji1

1University of Illinois Urbana-Champaign  ·  2Columbia University  ·  3Capital One

{hh38, hengji}@illinois.edu

89.53% +28.27
Anti-hallucination accuracy
on HaluMem extraction
71.49% +9.38
Memory update
correctness
5.8× fewer
Retrieved memory
tokens
90.13% vs. 68.83
Adversarial (abstention)
accuracy on LoCoMo
See it in action

Separate by function, connect by purpose

In this recorded case, Donna's old creative experiences displace her stated weekend routine. MemGuard preserves the difference between what happened once and what she regularly does.

01 Opening
02 The problem
03 Across years
04 Write time
05 Relational knowledge composition
06 Retrieval & answer
07 Why it works
08 Results
The evaluation question · December 7, 2031 session

“How might Donna Gonzalez utilize weekends to enhance her creative process?”

Ground truth: By immersing herself in new game soundtracks.
A-Mem / baseline✗ Hallucination

“Attend workshops, city tours, festivals”

Its top 20 include a January 2027 workshop at rank 6 and a May 2028 city and festival visit at rank 7. The stored weekend routine is absent from this query's retrieval.

MemGuard / ours✓ Correct

“Immerses in soundtracks weekends.”

The router assigns 50% to procedural, 30% to episodic, and 20% to semantic memory. The top composed entry links Donna's weekend routine to its creative purpose.

Donna Gonzalez's 2027 workshop and 2028 festival are retrieved for a 2031 weekend question. A-Mem misses a stored routine; MemGuard routes 20 percent semantic, 30 percent episodic, 50 percent procedural and follows the recorded routine-to-creative-purpose supports edge to answer correctly.
Figure 1. A 1,772-day memory gap: one-time experiences compete with a recurring routine. Top: the three source conversations and the question. Bottom: what each system wrote, what it retrieved, and the answer that follows. The same memory titles and the P1 → supports → S1 direction appear at both writing and retrieval. View full size ↗
Abstract

Memory is more than recall

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.8× fewer memory tokens than prior methods. These results suggest that reliable long-term reasoning depends on principled organization and selective use of heterogeneous memory.

Motivation

Related memories are not interchangeable

A memory can match a query's topic and still play the wrong evidential role. Reliability starts before the final answer.

Heterogeneous memory contamination: write-time contamination, retrieval-time contamination, and downstream composition failure.
Heterogeneous memory contamination. Weak functional boundaries cause semantic constraints, episodic observations, and procedural guidance to be stored, retrieved, and composed as interchangeable evidence. The contamination propagates across writing and retrieval, producing persistent hallucinations.
01

At writing

An event becomes a general fact. A routine absorbs an exception. Without functional boundaries, different kinds of knowledge can overwrite one another.

An experience An unsupported belief
02

At retrieval

Topical similarity surfaces a familiar claim, but the question calls for a specific event. Relevant-looking evidence can displace the evidence actually needed.

A general claim The wrong event answer
03

Across time

Once a contaminated memory enters the system, it can be retrieved and reused. A local mistake becomes a persistent source of hallucination.

Write Retrieve Reuse

Where the failures come from

We annotate 300 incorrect responses on LoCoMo with their memory-lifecycle source, separating factuality errors (the answer is recoverable from the conversation but the system gets it wrong) from unverifiability errors (the evidence is insufficient, so the system should abstain but answers anyway). The two error types have sharply different origins.

Factuality errors are 63.8 percent retrieval-time and 36.2 percent composition-time; unverifiability errors are 97.7 percent write-time and 2.3 percent retrieval-time, with sub-category breakdowns.
Error attribution across the memory lifecycle. Unverifiability errors are almost entirely write-time (97.7%) — unsupported knowledge is stored before retrieval ever happens — while factuality errors are dominated by retrieval-time contamination (63.8%), where the right evidence exists but is missed or out-ranked.
Method

MemGuard: functional boundaries as a reliability constraint

Three memory stores. A query-dependent retrieval budget. Explicit relations that reconnect useful evidence.

Overview of MemGuard: write-time memory reorganization and retrieval-time dynamic memory routing.
Overview of MemGuard. At write time, MemGuard reorganizes a conversation into atomic knowledge units, constructs directed relations among them, verifies missing information, and writes each atom to a type-isolated memory store. At retrieval time, the model routes queries adaptively to relevant memory types and selectively composes retrieved atoms via a relational knowledge graph, reducing cross-type interference.
01 / Write

Type-aware reorganization

Decompose dialogue into atomic memories. Compare, add, update, or skip each atom within its own type's store.

SemanticFacts & beliefs
EpisodicEvents & experiences
ProceduralRoutines & behaviors

Cross-type dependencies become graph links, preserving separate records.

02 / Route

Query-adaptive retrieval

Estimate which memory types the question needs. Allocate the primary retrieval budget across those stores.

Semantic20%
Episodic30%
Procedural50%

Routing recorded for the case above. K = 20: 4 semantic, 6 episodic, and 10 procedural slots.

03 / Compose

Relational knowledge composition

Expand retrieved atoms through labeled graph edges, then rerank the composed evidence for the question.

Weekend routine supports → Creative purpose

Actual retrieved relation. One-hop expansion; configured hop decay λ = 0.85.

Experimental Results

Cleaner memory, fewer tokens

Results span memory extraction, updating, and generation, together with long-horizon conversation benchmarks.

89.53%

Anti-hallucination accuracy

HaluMem memory extraction
MemGuard · 1 hop · Table 1

79.10%

LoCoMo accuracy

GPT-4.1-mini base / GPT-4.1 judge
MemGuard · 2 hops · Table 2

5.8×

Fewer retrieved tokens

1,250 vs. A-Mem's 7,244 tokens
GPT-4o-mini · 2 hops · Table 2

HaluMem · Table 1. Hallucination across the memory lifecycle; all values in percent.
MethodExtraction Acc. ↑Extraction F1 ↑ Update correct ↑Generation correct ↑Generation halluc. ↓
Mem060.8657.3125.5053.0219.17
Mem0-Graph61.8657.8524.5054.6619.28
Zep47.2855.4721.92
MemOS59.5579.7062.1167.2315.17
Memobase32.2925.135.2035.3329.97
Supermemory60.8356.9016.3754.0722.24
MemGuard 1 hop89.5394.1570.7959.5016.32
MemGuard 2 hops89.4994.1171.4958.2616.61

Baselines are reported from HaluMem using GPT-4o; MemGuard uses GPT-4.1-mini with GPT-4.1 judging, so the comparison is conservative for MemGuard. A-Mem is not included in the paper's HaluMem table; the demo above uses a separately supplied local A-Mem run, which is a different evaluation setting.

Boundaries + connections

Both components matter

Routing controls which kinds of memories enter retrieval. The graph restores useful dependencies that similarity alone may miss. The ablations support using both.

Where the gains appear

Upstream reliability improves

The largest HaluMem gains are in extraction and updating. MemGuard does not lead every generation metric; preserving memory is one part of a reliable answer pipeline.

All experimental values are transcribed from the paper, Tables 1–3 (pp. 7–8). MemGuard does not control generation-time behavior, so composition errors can still occur even with correct retrieved context, and the agentic memory pipeline adds LLM inference cost relative to end-to-end memory policies.

Citation

Building on MemGuard?

BibTeX
@inproceedings{ha2026memguard,
  title     = {MemGuard: Preventing Memory Contamination in Long-Term
               Memory-Augmented Large Language Models},
  author    = {Ha, Hyeonjeong and Kim, Jeonghwan and Qian, Cheng and Liu, Jiayu and
               Campbell, William M. and Wu, Yue and Zhang, Yuji and McKeown, Kathleen and
               Hakkani-T{\"u}r, Dilek and Ji, Heng},
  booktitle = {Findings of the Association for Computational Linguistics: EMNLP 2026},
  year      = {2026}
}