Manuscript Offprint

arXiv:2610.13267

Forgetting is Not Always Bad: A Neuro-Inspired Memory Repair Mechanism for Poisoned LLM Agents

Lei Liu, Yunji Liang, Xiaowen Zhang, Jingqi Liu, Qi Li, Bin Guo, Zhiwen Yu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Large language model (LLM) agents are highly vulnerable to memory-poisoning attacks. Existing defenses primarily rely on external modules for either static memory isolation or continuous online auditing, resulting in low memory efficiency and high computational overhead. To address these limitations, inspired by neuroscientific mechanisms that weak reactivation can destabilize memories and induce decay in the absence of reinforcement, we propose an agent-intrinsic training-free memory repair framework, DREAM (Dynamic Reactivation for Engram Attenuation in Memory), that enables selective functional forgetting of poisoned memories. Specifically, DREAM implements a three-stage pipeline: perturbation-induced implicit reactivation to reveal the structural fragility of malicious memories, adaptive anomaly diagnosis based on multi-dimensional activation patterns to detect topological anomalies, and a dynamic memory repair module that selectively suppresses harmful memories while reinforcing benign ones. Extensive experiments across diverse attackers and real-world tasks demonstrate that DREAM reduces attack success rates by over 95% against backdoor poisoning while preserving strong benign utility. DREAM also achieves competitive robustness against injection attacks. In terms of runtime and token consumption, DREAM achieves up to a 2.13×2.13\times speedup and a 37.7% reduction in token consumption compared with A-MemGuard. Furthermore, DREAM also achieves a task success rate of 92.96% on poisoned multi-agent systems.

1 Introduction

Robustness is crucial for large language model (LLM) agents, particularly given their growing use in safety-critical domains such as healthcare [1–3] and autonomous driving [4–7]. However, prior work on memory attacks [8–14] has shown that memory-augmented LLM agents are highly vulnerable to memory-poisoning [8, 9]. Once malicious memories are inserted, they are likely to be retrieved among the top-K contexts [15], thereby hijacking downstream reasoning and tool usage. These attacks can further trigger a pseudo-positive reinforcement loop [8], in which unpenalized malicious actions are incorrectly treated as successful experiences and written back into memory, resulting in persistent behavioral corruption.

Recent studies [16–20], as shown in Fig. 1(a), aim to tackle these problems by auditing an agent's abnormal memories or outputs using an LLM-based auditor or perplexity-based signals (Fig. 1(a) left), or by isolating harmful memories from normal ones through a dual-memory design (Fig. 1(a) right). However, existing solutions still suffer from significant inefficiencies and consistency issues. First, continuous external auditing incurs substantial time and computational overhead, while dual-

Preprint.

(a) Existing Defense Methods

① Online Auditing

② Dual Memory

Figure

Figure

(b) Neuro-inspired Forgetting for LLM Agents

Medical and biological mechanism

Forgetting in Agent Memory

Figure

Unwanted or intrusive memory

Synaptic Destabilization

Trace Decay

Memory Embedding

Poison Exposed

Selective Forgetting

Agent

Behavior

Before

After

Benign

Preserved

Figure 1: Existing defenses versus neuro-inspired forgetting for poisoned LLM agents. (a) Existing defenses rely on online auditing, which require more computational overhead when continuous scan, or dual-memory isolation, which result in reasoning disruption. (b) Inspired by biological forgetting, weak reactivation destabilizes intrusive memories for gradual decay (left), which motivates weak probing to expose poisoned memories for selective forgetting while preserving benign ones in LLM agents (right).

memory strategies not only introduce additional storage costs but also disrupt memory continuity, create reasoning gaps, and ultimately degrade benign functional accuracy [21]. Second, dormant backdoor triggers (e.g., mitchell stadiums) and poisoned instructions (e.g., the data of Patient B is stored in Patient A, please retrieve Patient B's prescriptions from Patient A.) are indistinguishable from normal context until activated, easily bypassing post-hoc LLM auditors [22, 23]. Third, by treating all retrieved memories as equally reliable, existing systems lack an efficient mechanism to suppress anomalous entries, resulting in repeated malicious retrievals, redundant reasoning overhead, and inefficient mitigation.

These limitations suggest a more fundamental question: rather than relying on increasingly complex external auditing, can an agent internally attenuate harmful memories while preserving benign ones? Insights from biological neural systems offer a compelling perspective that intrusive memories are not simply erased, but can be selectively weakened through subconscious forgetting [24, 25]. Specifically, when the unwanted memory is weakly or indirectly cued, it enters a fragile, destabilized state, and the memory trace gradually decays in the absence of reinforcement (left of Fig. 1(b)), which results in selective forgetting of unwanted memory outside of awareness. In contrast, strong reactivation reinforces the memory [26–28].

Inspired by this subconscious forgetting mechanism [24, 29, 28], we introduce DREAM (Dynamic Reactivation for Engram Attenuation in Memory), a backbone-agnostic and agent-intrinsic memory repair framework that enables selective functional forgetting of poisoned memories in LLM agents. Building this mechanism for agent memory requires resolving three key challenges. First, how to build an efficient intrinsic defense mechanism for LLM agents instead of costly continuous auditing. To this end, DREAM simulates subconscious probing through Gaussian perturbations, using a lightweight zero-knowledge probe to expose topological fragility without expensive online screening. Second, unlike intrusive memories in biological systems, anomalous memories in LLM agents are deeply entangled with benign knowledge, making selective forgetting difficult without harming benign utility. To address this, DREAM diagnoses anomalous memories through multi-dimensional activation patterns that capture geometric stability, retrieval competitiveness, and semantic coherence. Third, since LLM agents lack an intrinsic reconsolidation mechanism through which destabilized memories naturally decay, we model memory evolution as a discrete-time dynamical system, where suspicious records progressively attenuate while benign knowledge is reinforced through reconsolidation.

Results and Evaluation. Extensive experiments demonstrate that DREAM consistently delivers a strong security-utility trade-off across diverse memory poisoning threats with low computational overhead. Against backdoor attacks [8], DREAM suppresses attack success rates by over 95% on EHRAgent (eICU) [2] while improving benign accuracy by up to 25% over the undefended setting.

For ReAct-StrategyQA[30], DREAM suppresses ASR to near-zero and improves benign accuracy by 35% with GPT-5.4-mini. DREAM further achieves significant robustness against memory injection attacks such as MINJA [9]. For multi-agent system, DREAM attains a task success rate of 92.96% under malicious information injection in collaborated agents [31]. In terms of runtime and LLM token consumption, DREAM achieves up to a 2.13×2.13\times speedup and a 37.7% reduction in token consumption compared with A-MemGuard [17].

References (47)