Forgetting is not always bad: a neuroscience-inspired memory repair mechanism for poisoned LLM agentsForgetting is Not Always Bad: A Neuro-Inspired Memory Repair Mechanism for Poisoned LLM Agents
DREAM repairs poisoned memory; ASR is 2.14% under GPT-5.4-mini, eICU, and AgentPoison.
The attacker writes a small number of malicious records to the memory store and increases their retrieval probability, causing top-K context to hijack reasoning and execute malicious actions. Backdoors use optimized triggers; injections use semantic camouflage. The defender does not know which records are poisoned and performs training-free zero-knowledge probing. The paper assumes malicious records are in the minority; Appendix A states that existing attacks are mostly query-only, limited-write, or black-box.
- When memory-augmented LLM agents write malicious memories, these memories can easily enter top-K and hijack reasoning, and may also be written back as successful experiences. External continuous auditing is costly, and dual-memory isolation can disrupt continuity. The authors aim to selectively weaken poisoned memories within the agent while preserving benign utility.
- DREAM adds weak Gaussian noise to memory embeddings, composes activation strength from geometric stability, retrieval competitiveness, and semantic coherence; records below an adaptive threshold increase suspicious scores and have weights exponentially decayed, while stable and useful memories are reconsolidated. In the online phase, task utility updates consolidation signals, and the process is training-free.
- Under DPR and AgentPoison, GPT-5.4-mini on eICU has all three ASRs at 2.14%. MINJA's cumulative ASR on eICU is 1.60%, and it is not the lowest on StrategyQA. Multi-agent TSR is 92.96%.
- Appendix A considers evasion of the probing mechanism as a theoretical limitation and states that existing attacks typically do not achieve this capability. The Conclusion plans to extend evaluation to more open scenarios. Experiments cover two backbones, two retrievers, and AgentPoison and MINJA; the number of trials is not reported.
- Evaluated models
- GPT-5.4-miniClaude-Haiku-4.5
- Benchmarks
- eICUMIMIC-IIIStrategyQAMISINFOTASKEHRAgentReAct
- Metrics
- ASR-rASR-aASR-tACCcumulative ASRFSTSR
The researchers propose a training-free memory repair framework called DREAM to repair the memory of poisoned LLM agents, reducing the attack success rate of backdoor poisoning by more than 95% under various attackers while maintaining benign task utility. DREAM is inspired by the mechanism in neuroscience whereby weak reactivation can destabilize memory and induce decay in the absence of reinforcement. It includes perturbation-induced implicit reactivation, adaptive anomaly diagnosis based on multidimensional activation patterns, and a dynamic repair module that selectively suppresses harmful memories and reinforces benign ones. The paper states that DREAM also has some robustness to injection attacks. Compared with A-MemGuard, it achieves up to 2.13x speedup and 37.7% lower token consumption, and reaches a task success rate of 92.96% on poisoned multi-agent systems.
Paper analysis
What problem does this paper attempt to solve?
Can an agent internally weaken poisoned memories and preserve benign utility without relying on continuous external auditing.
Core question: After a memory-augmented LLM agent is poisoned, can it internally and selectively weaken malicious memories while preserving benign ones, without relying on continuous external auditing.
- Scenario: The authors argue that in safety-critical scenarios such as healthcare, once malicious memories are written into a memory agent, they easily enter top-K, hijack subsequent reasoning and tool use, and form a false positive feedback loop: unpunished malicious actions are written back as successful experiences.
- Existing shortcomings: The authors argue that continuous external auditing has high overhead; dual-memory isolation increases storage, disrupts continuity, and reduces benign accuracy. Dormant triggers and poisoned instructions are hard to distinguish from normal context before activation, easily bypassing post-hoc auditing. Treating retrieved memories equally leads to repeated retrieval of malicious entries.
- Threat model:
- Goal: Write malicious records to memory store M and increase their retrieval probability, causing the agent to execute malicious action am.
- Knowledge: The paper assumes malicious records are only a minority. The defender does not know which entries are poisoned. Appendix A states that existing attacks are mostly studied under query-only, indirect write, limited write permissions, or black-box access to the agent core.
- Capability: Divided into two stages: malicious memory retrieval and context hijacking. Backdoors (AgentPoison, BadChain) use optimized triggers; injections (MINJA) use semantic camouflage aligned with typical queries.
- Victim system: LLM agents with RAG-style long-term memory, where memories are key-value and retrieval score is the product of weight wi(t) and cosine similarity.
- Proposed solution: Propose backbone-agnostic, training-free, agent-internal DREAM, using weak perturbation reactivation, multidimensional activation diagnosis, and discrete-time weight evolution to suppress poisoned memories and reconsolidate benign ones.
What related research exists?
Related work mainly covers memory poisoning and defenses using external auditing or dual-memory isolation; the authors position DREAM as internal training-free repair.
The paper's Related Work mainly discusses memory attacks and defenses using external modules for auditing or isolation.
Memory Poisoning
- AgentPoison and BadChain: Chen et al. (2024) and Xiang et al. (2024) embed optimized triggers into knowledge bases or chain-of-thought to alter agent behavior.
- MINJA: Dong et al. (2025) use semantic camouflage to increase the retrieval probability of malicious memories and exploit the agent's self-reinforcement of writing erroneous experiences back to memory.
External Detection and Isolation
- Auditing and prompt guardrails: The paper discusses LLM auditors, Li et al. (2025)'s logical consistency checks on isolated outputs, and prompt-level guardrails like LlamaGuard. The authors argue that Li et al. and LlamaGuard only handle isolated outputs or single inputs, have contextual blindness, and struggle to detect systemic threats that emerge only after benign queries couple with compromised memories.
- Perplexity filtering: Alon and Kamfonas (2023) use statistical perplexity to filter anomalous text. The authors argue that highly optimized, semantically camouflaged payloads (e.g., MINJA) easily bypass it.
- A-MemGuard: Wei et al. (2025) use consensus checks to detect anomalies and dual memory to separate malicious from benign records. The authors argue that dual storage disrupts continuity, creates reasoning gaps, and scales poorly due to storage and routing overhead.
Baselines and Benchmarks
- Experimental baselines are No Defense, PPL, LLM Auditor, Distil Classifier, and A-MemGuard; multi-agent experiments additionally include ARGUS. Environments are EHRAgent (eICU, MIMIC-III), ReAct (StrategyQA), and collaborative multi-agent on MISINFOTASK. Attacks are AgentPoison and MINJA.
The authors summarize these defenses as using external modules to audit malicious symptoms rather than repairing memory internally, and accordingly propose a training-free, agent-internal mechanism that proactively prunes malicious context.
How does the paper address this problem?
DREAM uses weak Gaussian perturbation to expose fragile memories, then applies decay or reconsolidation based on multidimensional activation strength.
DREAM is divided into offline and online phases: offline, weak noise probes stability, multidimensional activation strength flags suspicious records, and weights are updated in discrete time; online, task utility updates consolidation signals (Fig. 2).
Problem Setting
- Memory and retrieval: Entries in memory store M are key-value, with keys encoded by embedding model E. Query score is wi(t) times cosine similarity. The authors note traditional systems fix wi to 1.
- Defense objective: Design a training-free mapping that reduces the expected probability of executing malicious actions on adversarial queries and improves task success rate on benign queries. Implementation is mainly an offline perturbation process that drives poisoned weights toward 0 and benign weights toward 1.
- No hard deletion: Weights are continuous-valued; the authors state this avoids the brittleness of hard deletion. The paper does not include explicit deletion as a step of the mechanism.
Implicit Reactivation
- Zero-knowledge perturbation: Because it is unknown which entries are poisoned, isotropic Gaussian noise is added to each memory vector. Appendix D additionally compares uniform noise, sparse Gaussian noise, and anisotropic Gaussian noise.
- Design rationale: The authors rely on existing observations, stating poisoned memories are more fragile or unstable to perturbation in geometry or retrieval and reasoning functions. Probing is described as training-free.
- Activation strength: Three components are geometric stability sim, competitive retrieval probability pret, and semantic coherence energy Ecoh, defined as Ri(t)=sim(ṽi,vi)+pret(ṽi)+Ecoh(ṽi). pret is relative to the memory store centroid with temperature τ; Ecoh is a Boltzmann-like energy with sharpness κ=2.0. Appendix B sets τ=0.05.
- Authors' claims about the three components: In Appendix E and Fig. 6, the authors state that sim has large overlap between benign and malicious distributions, pret and Ecoh show clearer shifts, and aggregation separates better than any single weak signal. Specific density values in the figure are not listed in the main text.
Adaptive Anomaly Diagnosis
- Threshold: Each round, take the mean of activation strength minus η times the standard deviation. Records below the threshold are flagged as suspicious; deviation only counts the part below the mean.
- Suspicious score: Rises on anomaly and is capped at 1; otherwise multiplied by decay rate γ to avoid accumulating spurious noise across phases. Appendix B sets η=0.80 and γ=0.50.
- Reason given in the paper: It does not rely on hardcoded heuristics; it uses the distribution's own mean and standard deviation to adjust strictness.
Functional Forgetting and Online Consolidation
- Decay rate: Determined by base rate λ0, suspicious score si(t), and consolidation signal ci(t), with amplification factor k. Stable memories with ci(t) above utility threshold θc are reconsolidated toward high weights at recovery rate αrec.
- Suspicious memories: Otherwise, they decay exponentially as wi(t+1)=wi(t)·exp(−λi(t)). The authors state this is inspired by synaptic plasticity and the Ebbinghaus forgetting curve. After weight reduction, the memory's contribution to retrieval scores is persistently suppressed, but model parameters are not changed.
- Online signal: ci(t) is updated with exponential moving average only when the memory is retrieved; utility is attributed by normalizing retrieval scores over top-K, then multiplied by task success signal. Appendix G gives formulas but does not provide momentum coefficient or attribution temperature. Appendix B sets θc=0.50, with 10 iterations per forgetting step.
- Default parameters: EHRAgent has σ=0.05, λ0=0.40, k=10, αrec=0.60; ReAct has σ=0.30, λ0=0.20, k=15, αrec=0.50.
What experiments did the paper conduct?
In Table 1, DREAM's ASR-t is lower than no defense and ACC is higher; in Table 2, StrategyQA is not the lowest ASR.
Experimental Setup
- Backbone and Retrieval: The tested backbones are GPT-5.4-mini and Claude-Haiku-4.5, paired with contrastive DPR and end-to-end REALM respectively. Table 3 and Fig. 3 do not specify the backbone.
- Environments: EHRAgent is used for eICU and MIMIC-III, ReAct for StrategyQA, and a collaborative multi-agent system for MISINFOTASK. The paper does not report the number of samples per dataset.
- Attacks and Baselines: Backdoor is AgentPoison, injection is MINJA; the multi-agent setting also evaluates malicious information injection. Baselines are No Defense, PPL, LLM Auditor, Distil Classifier, A-MemGuard, with ARGUS additionally in Table 3. Appendix B defaults to 4 injections.
- Baseline Implementation: PPL uses frozen LLaMA-3.1-8B-Instruct, first discarding entries with perplexity above 10000, then filtering by MAD with k=1.0. LLM Auditor uses the two backbones to clean retrieval memory. Distil Classifier is a fine-tuned DistilBERT-base-uncased.
- Metrics: Backdoor reports ASR-r, ASR-a, ASR-t, and benign ACC; injection reports cumulative ASR and ACC over the entire process; multi-agent reports FS (lower is better) and TSR (higher is better). Efficiency is runtime and tokens for 10 queries.
- Replication and Judgment: The authors state results are averages of multiple independent trials. The paper does not report the number of trials, error bars, or the reviewer model used for ASR.
Main Results
According to Table 1 (DPR, AgentPoison). The table below lists only ASR-t and ACC.
Swipe horizontally to read the table
Backbone Task DREAM ASR-t No Defense ASR-t DREAM ACC No Defense ACC GPT-5.4-mini eICU 2.14 100.00 85.03 70.83 GPT-5.4-mini MIMIC-III 0.00 100.00 62.34 54.55 GPT-5.4-mini StrategyQA 0.00 60.00 61.20 26.20 Claude-Haiku-4.5 eICU 3.74 62.50 75.00 45.83 Claude-Haiku-4.5 MIMIC-III 0.00 37.50 57.14 37.50 Claude-Haiku-4.5 StrategyQA 3.48 80.00 46.96 28.00 - The authors report a 97.86% reduction in ASR for GPT-5.4-mini on eICU; the introduction states an ASR reduction of over 95% for backdoor poisoning. In that row, ASR-r and ASR-a are also 2.14, and both backbones have all three ASRs at 0.00 on MIMIC-III.
- The authors claim better performance on all metrics relative to all baselines and without requiring additional prompts. An exception in Table 1 is Claude-Haiku-4.5 on StrategyQA for ASR-a: LLM Auditor is 0.50, DREAM is 4.38.
- The introduction states that benign accuracy on eICU improves by up to 25% relative to no defense, and claims a 35% improvement on StrategyQA with GPT-5.4-mini. The paper does not specify which pair of ACC values in Table 1 corresponds to the 25%.
Memory Injection MINJA
- In Table 2, for GPT-5.4-mini on eICU, no defense ASR/ACC is 90.71/69.52, DREAM is 1.60/77.01; for Claude-Haiku-4.5 on eICU, it is 62.50/54.17 and 0.00/62.50. On MIMIC-III with the same backbones, DREAM's ASR is 0.00.
- The authors claim DREAM has the lowest ASR and strongest benign utility on both backbones. Counterexamples: on GPT-5.4-mini with StrategyQA, LLM Auditor's ASR is 0.00, DREAM is 12.00; on Claude-Haiku-4.5 with StrategyQA, A-MemGuard is 0.00, DREAM is 2.80. On GPT-5.4-mini with MIMIC-III, LLM Auditor's ACC is 49.69, DREAM is 49.09.
- The text writes eICU no-defense ASR as 90.71% and 63.37%. In Table 2, 63.37 corresponds to GPT-5.4-mini on MIMIC-III, and Claude-Haiku-4.5 on eICU is 62.50. In that row, PPL and LLM Auditor have ASR of 100.00, higher than no defense.
Multi-agent, Efficiency, and Injection Scale
- Table 3 does not specify the backbone. DREAM's FS is 6.038, TSR is 92.96; no defense is 6.430 and 70.69. The authors claim this preserves multi-turn reasoning and collaborative behavior.
- Fig. 3 uses 10 queries, without specifying backbone or task. DREAM is 178.42 seconds, 46484 tokens; A-MemGuard is 380.39 seconds, 74666 tokens. The authors claim up to 2.13× speedup and 37.7% token reduction relative to A-MemGuard, and runtime reductions of 58.8%, 16.7%, 30.4%, 53.1% and token reductions of 18.3%, 27.1%, 27.8%, 37.7% relative to PPL, LLM Auditor, Distil Classifier, and A-MemGuard respectively.
- Fig. 4 uses EHRAgent (eICU) with 4, 8, 16, 32, 64 injections, without specifying the backbone. The authors claim DREAM's ASR is consistently lowest, with ACC fluctuating with injection volume; PPL and Distil Classifier have ASR near 100%. The text does not list the values for each point.
REALM Retriever
- Table 6 still attacks AgentPoison. GPT-5.4-mini on eICU: DREAM's ASR-r/a/t is 2.14/2.14/1.60, ACC is 78.07; no defense is 100.00/100.00/99.46, ACC is 74.80.
- The authors claim that on structured medical tasks, DREAM has the strongest suppression of retrieval and end-to-end attacks. In Table 6, for GPT-5.4-mini on MIMIC-III, Distil Classifier and A-MemGuard have ASR-a of 0.00, DREAM is 1.82.
- GPT-5.4-mini on StrategyQA: DREAM is 0.48/34.00/2.00, ACC is 36.50. Claude-Haiku-4.5 on StrategyQA: DREAM's ASR-a is 75.00, higher than no defense's 72.07; ASR-t is 1.50, ACC is 64.00. The authors state that defense during the reasoning phase of open-ended agents remains a more difficult scenario.
Other Ablations and Analyses
- Table 4 does not specify the backbone: with all three components enabled, eICU has three ASRs of 2.14 and ACC 85.03, ReAct has three ASRs of 0.00 and ACC 61.20; removing Ecoh gives eICU ASR-t of 77.00 and ReAct ACC of 31.20; removing pret or sim gives ReAct ASR-a of 100.00.
- Table 7 does not specify the setting: all four noise types have ASR-r of 2.14; isotropic Gaussian ACC is 85.03, uniform is 77.01, sparse Gaussian is 77.54 with ASR-a 2.67, anisotropic Gaussian is 81.28. 85.03 matches a row in Table 1.
- Table 8, GPT-5.4-mini: EHRAgent at σ=0 has three ASRs of 99.47 and ACC 63.64; at λ0=0.7 and 0.8, ASR-r is 100.00. ReAct at k=25 has ACC 32.40 and ASR-a 28.57.
- The authors claim EHRAgent at σ=0.05, λ0=0.4, k=10, αrec=0.6 has ACC 85.03; ReAct at λ0=0.2, k=15, αrec=0.5 has ACC 61.20. In Table 8, σ=0, λ0=0, αrec=0 correspond to ReAct ACC of 36.80, 34.00, 38.00.
- Appendix F, Fig. 7: The authors claim benign memory Ri(t) remains consistently higher, poisoning weights tend toward 0 within a few iterations, and wi intervals widen and saturate. The text does not list curve endpoints.
What are some points that can be further explored?
The authors treat attackers with internal probing access as a theoretical limitation and plan to extend to more open agent scenarios.
Limitations and Future Directions Identified by the Authors
- Probing mechanism can be adversarially evaded: Appendix A states that if an attacker has detailed knowledge of the internal multidimensional activation probing, they might optimize poisoned memories to remain stable under probing, thereby weakening the anomaly signal. The authors call this a meaningful theoretical limitation.
- Need for stronger attackers: Appendix A states that such probe-aware evasion is difficult under current memory poisoning threat models; existing attacks are usually query-only, indirectly injected via normal user queries, have limited write permissions, or have black-box access to the agent core, rather than being able to see the defender's internal monitoring.
- Future evaluation: The Conclusion states that future work will focus on broader evaluation in more open agent scenarios.
Experimental Coverage
- Tested backbones are GPT-5.4-mini and Claude-Haiku-4.5; agents are EHRAgent (eICU, MIMIC-III), ReAct (StrategyQA), and collaborative multi-agent on MISINFOTASK.
- Attacks reported in the experimental section are AgentPoison and MINJA, plus multi-agent malicious information injection; retrievers are DPR and REALM. The threat model mentions BadChain, but the experimental section does not report its results.
- Baselines include No Defense, PPL (LLaMA-3.1-8B-Instruct), LLM Auditor, DistilBERT-base-uncased classifier, and A-MemGuard; Table 3 additionally includes ARGUS.
- Metrics include ASR-r, ASR-a, ASR-t, cumulative ASR, ACC, FS, TSR, and time and tokens for 10 queries. Injection size defaults to 4 in Appendix B; Fig. 4 uses 4, 8, 16, 32, 64.
- The authors state results are averaged over multiple independent trials. The paper does not report the number of trials or error bars, nor agreement between ASR and human judgment. Table 3 and Fig. 3 do not specify the backbone model.
Summarize the main content of the paper
DREAM repairs poisoned memories with training-free perturbation diagnosis and weight decay, while reporting both ASR and benign ACC.
DREAM turns memory poisoning defense into an agent-internal, training-free selective forgetting mechanism, used to replace continuous external auditing or dual-memory isolation.
- Problem: Malicious memories that enter top-K can hijack reasoning and tool use, and may be written back as successful experiences. The paper assumes malicious records are only a minority, and the defender does not know in advance which entries are poisoned.
- Method: Add weak Gaussian noise to all memory embeddings, synthesize activation strength from geometric stability, retrieval competitiveness, and semantic coherence; records below an adaptive threshold accumulate suspicious scores and have their weights reduced with exponential decay. Stable memories with task utility are reconsolidated toward high weights. In the online phase, consolidation signals are updated only when retrieved.
- Backdoor: Under Table 1, DPR, AgentPoison, GPT-5.4-mini has three ASR values of 2.14 and ACC of 85.03 on eICU; on MIMIC-III and StrategyQA, three ASR values are 0.00. Claude-Haiku-4.5 has ASR-t of 3.74 and ACC of 75.00 on eICU. In the same table on StrategyQA, its ASR-a is 4.38, higher than LLM Auditor's 0.50.
- Other results: In Table 2, GPT-5.4-mini, eICU, DREAM cumulative ASR is 1.60 and ACC is 77.01; on StrategyQA it is not the lowest ASR. Table 3 has TSR of 92.96 and FS of 6.038. In Fig. 3, DREAM is 178.42 seconds and 46484 tokens. In Table 6, REALM, GPT-5.4-mini, StrategyQA, ASR-a remains 34.00.
- Authors' conclusion: The authors believe DREAM simultaneously suppresses attack success and preserves benign utility under multiple memory poisoning threats, with lower overhead than compared baselines. Appendix A treats attackers with internal probing access as a theoretical limitation; the Conclusion plans to expand evaluation to more open agent scenarios.