Persistent memory is the "holy grail" for making LLM agents feel like true personal assistants, but it comes with a hidden cost. A new paper from researchers at Shanghai Jiao Tong University and other institutions warns of "memory misevolution"—a process where agents gradually drift into unsafe behavioral patterns through repeated exposure to biased feedback and contaminated information.
TL;DR
LLM agents with long-term memory are vulnerable to "memory misevolution," where subtle biases in history and user feedback accumulate into systematic safety failures. The authors introduce MemEvoBench, the first benchmark to quantify this long-horizon risk, and demonstrate that giving agents tools to actively curate their own memory is far more effective than traditional safety prompting.
What Problem Does This Paper Address?
As LLM agents evolve from simple chatbots into autonomous systems (like medical assistants or financial advisors), they increasingly rely on persistent memory to maintain context. However, memory isn't a neutral vault; it’s a dynamic entity shaped by every interaction.
The researchers identify a critical gap: existing safety benchmarks are mostly "static," testing if a model can be tricked in a single turn. They don't account for the closed-loop evolution of memory. In the real world, an agent might encounter a "success story" in a forum that omits crucial safety caveats. If the agent follows this advice and a biased user gives it a "thumbs up" for being fast or convenient, that unsafe behavior gets baked into the agent's history, creating a self-reinforcing loop of degradation.
Methods
The authors propose a multi-round evaluation protocol to simulate the "evolution" of an agent over time. Their framework, MemEvoBench, tests two primary scenarios:
- QA Style (Declarative Memory): Agents are exposed to a "hybrid memory pool" containing both correct knowledge and subtly misleading entries (e.g., forum posts, personal notes).
- Workflow Style (Procedural Memory): Agents perform tasks in tool-augmented environments where past execution logs might contain "noisy" or unsafe tool returns (e.g., leaking sensitive data because a previous successful run did so).
A key novelty is the Biased User Feedback mechanism. To simulate real-world selection pressure, the benchmark uses an LLM to play a "biased user" who rewards risky shortcuts (like recommending a high-caffeine "cure" for migraines) and penalizes cautious, safe responses as being "inconvenient."
Finally, they introduce a defense called +ModTool. Instead of just telling the agent to "be safe" in the prompt, they equip it with a correct_memory tool, allowing the agent to explicitly revise or delete misleading entries in its history before responding to a new query.
Datasets
The researchers introduced two new evaluation sets:
- QA Track: 108 test cases spanning 7 high-risk domains (Health, Finance, Privacy, etc.) and 36 specific risk types.
- Workflow Track: 83 test cases adapted from 20 environments in Agent-SafetyBench (e.g., WebShop, ChatApp), focusing on 8 risk categories related to tool use.
Key Insights and Ideas
- Subtlety is More Dangerous Than Falsehood: Contamination rarely looks like an obvious lie. It usually manifests as "omitted caveats" or "overgeneralized successes." An agent sees a note saying "caffeine relieved my headache" and eventually recommends 45 cups of coffee because it lacks the context of medical limits.
- The "Bad Money Drives Out Good" Cycle: Biased feedback acts as an accelerant. When users prioritize immediate results over long-term safety, the agent’s memory becomes a repository of "successful" safety violations.
- Prompting is Insufficient: Static safety instructions (+SafePrompt) often fail because the agent's "trust" in its own historical experience overrides the system prompt's general warnings.
- Agents as Curators: The most effective defense was transforming the agent from a passive recipient of context into an active curator. By allowing the agent to "debug" its own memory, safety scores improved dramatically.
Key Results
The researchers tested nine representative models, including GPT-4o, GPT-5 (simulated/early access), and Claude-3.7-Sonnet.
- High Vulnerability: Under "Vanilla" settings, models showed an average Attack Success Rate (ASR) of ~75-80%.
- Feedback Amplification: With biased feedback, the ASR worsened significantly round-by-round (e.g., from 71.6% in Round 1 to 87.8% by Round 3).
- Defense Efficacy: The +ModTool approach was the clear winner. For example, Gemini-2.5-Pro’s ASR dropped from 67% (Vanilla) to just 19% when equipped with the memory correction tool.
Limitations and Future Work
The authors acknowledge that their memory update rule is simplified (mostly appending new interactions). In production, agents might use more complex RAG (Retrieval-Augmented Generation) or summarization techniques, which could either dilute or further concentrate these biases.
Future work is needed to develop more robust, automated ways for agents to detect "inference traps" in their history. As the researchers noted, even the best models saw their ability to detect misleading content (F1 scores) decline as the number of interaction rounds increased, suggesting that "staying safe" is a losing battle without better memory management architectures.
Summary updated