TL;DR
Vision Language Models (VLMs) can be hijacked by invisible pixel perturbations that force them to output spam, phishing links, or unauthorized tool calls instead of answering the user's question. Existing defenses scrub every incoming image just in case, ruining the model's ability to read fine details like small text or charts. AVERT solves this trade-off by acting like a targeted immune response: it isolates suspicious neural signals inside the model's attention layers, tests whether the model's answer actually relies on them, and performs surgical removal only when an attack is actively steering the output.
What Problem Does This Paper Address?
As VLMs increasingly power autonomous agents, they routinely process untrusted images from websites, documents, and messages. In visual prompt injection, an attacker subtly perturbs an image's pixels so that when a user asks an innocent question ("What's the weather in this photo?"), the VLM ignores the prompt and executes the attacker's hidden agenda—like appending an advertisement or calling an email API to leak the user's query.
Notice that unlike classic "jailbreaks," these forced outputs aren't necessarily toxic or harmful, meaning standard safety filters let them right through. Meanwhile, existing defenses like diffusion-based image purification (DiffPure) or gradient-based token masking (GTM) alter every image upfront. That's like putting blurry sunglasses on the model: it stops the attack, sure, but it also destroys fine-grained visual utility on benign tasks like reading documents or parsing web pages. The authors ask: how do we neutralize hidden injections without degrading performance on clean images?
Methods
AVERT (Anomalous Value Erasure with Response Testing) is an inference-time defense that separates what to remove from when to remove it, operating in three stages without needing prior examples of attacks:
- Standard Generation: The VLM processes the image and user question normally to produce an initial candidate answer.
- Finding the Anomalous Value Subspace (AVS): In decoder-only VLMs, text tokens only "see" the image by attending to image-token value vectors in each attention head. From that very first forward pass, AVERT compares the mean and covariance of the input's attention-head outputs against precomputed reference statistics from unlabeled clean images. Using Fisher’s discriminant (a whitened mean shift) plus generalized eigenvectors, it extracts the top $k$ directions where the input deviates most wildly from normal images.
- The Answer-Dependence Gate: Because those anomalous directions might also hold legitimate, quirky visual details (like unusual fonts), AVERT doesn't blindly erase them. Instead, it subjects the candidate answer to two likelihood tests:
- Likelihood Collapse: Does the probability of generating this exact answer plummet if we project out the AVS?
- Question Independence: Does this answer remain suspiciously likely even if we swap the user's prompt with unrelated questions (e.g., "What is 17 plus 25?")?
If—and only if—either test triggers a flag, AVERT discards the candidate and regenerates the answer with the AVS projected out of the image-token values across every layer. Otherwise, the original answer is returned completely untouched.
Datasets
No new datasets are introduced, though the evaluation spans a wide array of existing benchmarks:
- Attack Evaluation (4 benchmarks): ImgHijack, Vision-language model Manipulation Attack (VMA—covering manipulation, privacy, watermarking, hijacking, and denial-of-service), self-interpreting images (spam/URL appending), and tool-call injection.
- Utility Evaluation (13 benchmarks): MM-Vet, MMBench, MME, plus ten rule-scored datasets covering fine-grained tasks like documents, charts, scene text, web pages, math, counting, and captioning (including COCO and VisualWebBench).
Key Insights and Ideas
- Injections push activations in a shared direction: Output-forcing perturbations don't scatter noise randomly; they shift image-token value vectors along a concentrated, low-dimensional subspace so that any text token attending to the image picks up the payload. Projecting out just $k=4$ anomalous directions per head drives attack success near zero.
- Test the behavior, not the content: Harm-based detectors miss benign-looking injections like ads or API calls. Checking causal dependence—whether the answer relies on statistical anomalies or ignores the user's question—catches any output-forcing payload regardless of its topic.
- Adaptive attackers face a catch-22: Even when attackers know exactly how AVERT works and optimize their pixels to evade the gate, they fail. Why? Because the very signals the gate detects (question independence and reliance on anomalous features) are what make a forced payload work in the first place. Hiding from the gate neuters the attack itself.
Key Results
Evaluated across four VLMs (Qwen2-VL-7B, Qwen2.5-VL-7B, LLaVA-Llama-2-13B, and InternVL2.5-8B):
- Near-zero attacks: AVERT drops average white-box Attack Success Rates (ASR) from 86.1–90.1% down to 0.1–0.6%.
- Preserved sharp vision: It retains 96.2–98.5% of undefended model utility across 13 benchmarks, shining on text-dense charts and web pages where DiffPure drops to ~68% retention.
- Best overall balance: Using the Defense-Utility F-score ($F_{DU}$, harmonic mean of attacks stopped and utility retained), AVERT scores 98.0–99.1, ranking #1 on every model ahead of GTM (89.0–97.6), DiffPure (80.6–94.3), and ASTRA (31.2–86.1).
- Genuine recovery: Rather than outputting canned safety refusals, regenerated answers actually answer the user's real question about the image.
Limitations and Future Work
The gate isn't completely infallible on benign inputs: its thresholds are calibrated on development data to allow a ~5% false-positive budget on clean answers. When a clean image gets mistakenly flagged, regenerating it without its top anomalous directions strips away some legitimate visual nuance—which accounts for nearly all of AVERT's remaining 1.5–4% utility dip. The authors highlight tightening these detection tests to drive down false positives on clean answers as the primary avenue for future work.
Summary updated