ConsistencyGate: Preventing Memory Contamination in LLM Agents via Self-Consistency Admission Control
Abstract
LLM agents that operate over many turns accumulate facts in an external memory store and reuse them as premises for downstream reasoning. A hallucinated fact written at one step therefore persists as a false premise for every subsequent step, a failure mode we call memory contamination. Existing memory management addresses retrieval and capacity but not write-time correctness; this admission problem cannot be solved by utility- or recency-based criteria, and uncontrolled contamination compounds across long trajectories. We propose ConsistencyGate, a write-time admission gate that, before committing a candidate fact m extracted from context c, queries the LLM K times for a soft support score and admits m only when the average exceeds a threshold. The mechanism is model-agnostic, requires no fine-tuning, and reduces to a single forward pass in a log-probability variant for latency-sensitive deployments. To measure the effect on natural data, we construct two real-conversation benchmarks (LoCoMo-Contam and MSC-Contam) by planting controlled single-detail corruptions in long-term conversations from LoCoMo and MSC, and complement them with a structured synthetic corpus (MemContam) that isolates a near-oracle upper bound. Across four LLM backbones, ConsistencyGate reduces contamination on every benchmark relative to a write-everything baseline, with the cost concentrated on facts that are stated only implicitly in the source context. We release all three benchmarks together with the gate implementation.
Create a lesson
Metadata
- Categories
- cs.AI, cs.CL
- Comments
- 24 pages, 2 figures, 6 tables, 1 algorithm; includes appendices
Related papers
Agentic Waterfall: An Intent-Driven Information Discovery Framework for Reclaiming User Control in the Attention Economy
Shared title terminologycs.AIYige Luo, Shining Zhang, Jikun Liu et al.
EvoLink-Bench: A Benchmark for Evaluating Self-Evolving Agents in Long-Horizon Interdependent Task Streams
Shared title terminologycs.AIWei Chen, Xiaodong Lu, Weihao Shen et al.
The Control-Flow Tax: Specialized Decision Routing for LLM Agent Workflows
Shared title terminologycs.AIZhikai Cheng, Shuanghu Wang, Li Jiang
From Rule-based to Agentic: LLM Agent based Real-time Control of Urban Drainage Systems for Flooding and Sewer Overflow Mitigation
Shared title terminologycs.AIWenchong Tian, Shixun Li, Ruozhou Lin et al.
Structured Authority Injection: Persistent Human Control for LLM Agents via Typed MCP Overrides
Shared title terminologycs.AIRyan Tran, YueMing Zhang, Lingfeng Tao et al.
When Do Agent Loops Mistake Stagnation for Progress? Self-Evaluation Bias and Externally Grounded Verification in Long-Running Autonomous LLM Agent Loops
Shared title terminologycs.AIHyundoo Park, Byungho Choi