Visual Memory Attacks Can Persist Through The KV Cache
cs.CR, cs.AI, cs.CV
Submitted: 2026-10-06
Updated: 2026-10-06
License: http://creativecommons.org/licenses/by/4.0/
The gist: Modern language model systems operate autonomously over increasingly long contexts containing untrusted text and images.
Terminology
Abstract
Modern language model systems operate autonomously over increasingly long contexts containing untrusted text and images. Can an adversarial input continue to steer a model even after that input is removed from its context? We show that attacks can be trained to persist through the key/value (KV) cache of subsequent tokens, allowing adversarial influence to outlive direct access to its source.We consider the Visual Memory Injection (VMI; Schlarmann and Hein, 2026) attack setting, in which an adversarial image that stays in the context plants a hidden backdoor: the model behaves normally until a chosen trigger elicits an attacker-chosen response. We first demonstrate persistence in this setting with optimized soft prompts, which remain effective after we mask the prompt from attention. We then introduce Persistent Visual Memory Injection (P-VMI), which optimizes images to preserve this adversarial behaviour after they are masked from attention. These attacks persist over conversations substantially longer than those used during optimization. On Qwen3-VL-8B-Instruct, P-VMI achieves up to approximately 90% target success in its strongest configuration and remains effective under a stricter removal setting that exposes the image only on the first turn. A cache-swap ablation localizes the persistent influence to the KV cache. Finally, we show that these attacks can be trained to survive compaction that retains the KV cache of a summary generated by the same model, demonstrating that adversarial behaviour can persist in cached state without continued access to its source.
Sources
- Qwen3-VL Technical Report
- Do Agents Dream of False Memories? Black-box Visual Attacks on Long-term Memory in Multimodal AI Agents
- Gemma 4 Technical Report
- Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training
- Baseline Defenses for Adversarial Attacks Against Aligned Language Models
- MEMENTO: Teaching LLMs to Manage Their Own Context
- MemGPT: Towards LLMs as Operating Systems
- KV-streams for Efficient Compaction in Agentic Reinforcement Learning
- Visual Memory Injection Attacks for Multi-Turn Conversations
- Constitutional Classifiers: Defending against Universal Jailbreaks across Thousands of Hours of Red Teaming
- Zombie Agents: Persistent Control of Self-Evolving LLM Agents via Self-Reinforcing Injections
- HijackKV: New Threat in Position-Independent KV Cache Reuse
- Universal and Transferable Adversarial Attacks on Aligned Language Models
Related papers
- SoK: AI-Augmented Binary Reversing
- Relaxed Sender Anonymity for CBDC Interbank Settlement: A Zero-Knowledge Approach on Permissioned EVM
- Calibration-Family Overfit: Why Trusted Sabotage Monitors Don't Transfer Across Lineages
- Efficient Fuzzy PSI under One-Sided Assumptions
- Sealing the Audit-Runtime Gap for LLM Skills
- Token Composition: A Graph Based on EVM Logs