The Adversarial Gait: Detecting Visual Adversarial Attacks against Vision-Language Models via Self-Targeted Gradient Characterization

Mauricio Byrd Victorica, Ezzeldin Shereen, György DánNeurIPS 2026

TL;DR

Vision-language models (VLMs) are astonishingly easy to trick with subtly tampered images, and current security defenses crumble the moment an attacker knows how the defense works. This paper introduces AdverStep, a test-time detector that catches even defense-aware attackers by watching how an image behaves when the model tries to "double down" on its own prediction. Just as a person’s walk can give away a disguised limp, an adversarial image betrays itself through its optimization "gait."

What Problem Does This Paper Address?

Because training foundation models from scratch costs a small fortune, most real-world applications rely on open-source VLMs. While great for accessibility, this creates a serious security headache: attackers have full "white-box" access to the model's weights. Worse yet, if you bolt on a defense mechanism, a clever adversary can inspect that, too, crafting adaptive attacks designed simultaneously to fool the VLM and tiptoe right past your detector.

Surprisingly, recent literature on VLM security largely ignores this worst-case scenario. Existing defenses look invincible against naive, non-adaptive attacks, dropping the Attack Success Rate (ASR) to near zero. However, when faced with an adaptive attacker who knows the rules of the game, those same defenses see their ASR shoot right back up above 90%. The authors tackle a realistic, high-stakes threat model—where an attacker subtly alters an image (using either imperceptible pixel noise or physical-style patches) to force a specific text output while actively trying to evade a known detector.

Figure 1: Left: Attack Success Rate for non-adaptive (naive) and adaptive attacks. Right: Average Time to Success vs. Attack Success Rate of adaptive attacks. AdverStep performs well against non-adaptive attacks and outperforms existing defenses in the adaptive attack scenario.

Methods

How do you catch a forged image that was mathematically optimized to look normal? You push it a little further and watch how it moves.

When a VLM receives an image-text pair and outputs an answer, AdverStep takes that exact answer and launches a brief, two-step self-targeted attack on the input image. Unlike a standard attack that tries to change the model's mind, a self-targeted attack uses gradient descent to maximize the model's confidence in whatever it just predicted.

Overview of the AdverStep self-targeted attack and threshold-based detection pipeline.

Because a tampered image has already been shoved into a weirdly specific, artificial pocket of the loss landscape by an adversary, nudging it further produces markedly different optimization dynamics than nudging a clean, natural image. The authors capture these dynamics as a 5-feature vector called the adversarial gait:

  1. Cross-Entropy Loss: How confident the model already is.
  2. Gradient Norm: How steep the surrounding loss landscape is.
  3. Gradient Cosine Similarity: How consistent the gradient direction stays across consecutive steps.
  4. Masked Loss: The authors multiply consecutive gradients to find the top 5% of pixels driving the optimization, mask them out with neutral gray, and recompute the loss.
  5. Loss Difference: The jump between the unmasked loss and the masked loss.

Detection is completely unsupervised: if any of these five features fall outside the normal range calibrated on a set of clean images, the alarm goes off.

Datasets

No new benchmarks are introduced; instead, the authors evaluate across established vision-language datasets:

  • Calibration/Tuning: 1,000 clean image-text pairs from the VQA$^2$ validation split.
  • Evaluation: Because crafting adaptive white-box attacks (running 1,000 iterations of Projected Gradient Descent per image) is computationally grueling, evaluation uses 100 image-text pairs from four datasets—NIPS2017 and VQA$^2$ for visual question answering, plus MSCOCO and Flickr for image captioning.

Key Insights and Ideas

  • Masking the "load-bearing" pixels is the secret weapon: In an ablation study, removing standard gradient features (like gradient norm or cosine similarity) barely changed adaptive detection performance. Removing the Loss Difference feature, however, caused the attacker's success rate on COCO to skyrocket from 0.13 to 0.96. Adversarial attacks rely heavily on concentrated, fragile regions of influence; greying out the top 5% of active pixels shatters an adversarial target's confidence much more violently than a benign one's.
  • Making the attacker pay the tax: Even when an adaptive attacker manages to evade a defense, computational friction matters. Forcing an attacker to simultaneously fool a VLM and mimic a clean image's multi-step gradient gait slows their optimization down dramatically.
  • Zero false positives is a trap: Insisting on a strict 0% False Positive Rate (FPR) on training data leaves detectors overly conservative against adaptive white-box attacks. Allowing even a tiny 5% FPR gives AdverStep enough breathing room to slash attack success rates, whereas baseline detectors barely budge regardless of how much you relax their thresholds.

Key Results

Tested across three open-source VLMs (SmolVLM, Qwen2.5-VL-3B, and Intern3-VL-2B) against state-of-the-art detectors (PIP, Nearside, and MirrorCheck):

  • Adaptive Robustness: With a 5% training FPR on Qwen-VL-3B, AdverStep drops adaptive ASR to 0.54 on NIPS and 0.21 on COCO (compared to 0.94–1.00 for baselines). At 10% FPR, AdverStep pushes COCO ASR down to 0.13.
  • Patch & Norm Budgets: Under standard $\ell_\infty$ perturbations ($16/255$) and localized 4-patch attacks (covering 5% of the image), AdverStep achieves ASRs of 0.05–0.08 on COCO patches, while baselines allow 0.34–0.60.
  • Time vs. Cost Trade-off: On Qwen-VL-3B, AdverStep adds 1.89 seconds of defense overhead per image (roughly $3\times$ slower than PIP/Nearside, though $>5\times$ faster than MirrorCheck), while forcing an adaptive attacker to spend an average of 421.15 seconds to find a working exploit—up from ~100–147 seconds against baselines.

Limitations and Future Work

The authors are refreshingly candid about the boundaries of their work. First, adding 1 to 2 seconds of latency per query makes AdverStep too slow for split-second, safety-critical loops like autonomous driving. Second, due to the sheer compute cost of running white-box adaptive attacks, test sets were capped at 100 samples per dataset and focused strictly on PGD-based targeted visual perturbations. Future work aims to distill the core mechanics of the adversarial gait—especially the masking dynamics—into faster, lightweight checks, while testing against an even broader arsenal of adaptive optimization strategies.

Summary updated

Abstract

Visual adversarial examples are a well-known vulnerability of deep learning architectures. The emergence of vision-language models (VLMs) further expands the attack surface through multimodal interactions. Despite extensive research on adversarial defenses over the past decade, existing works on VLM robustness often overlook adaptive white-box attacks, where the adversary has full access to both the model and the defense mechanism. We show that recent defenses can be effectively evaded under such adaptive settings and propose AdverStep, an adaptive test-time detection method that leverages gradient information induced by a self-targeted attack maximizing the likelihood of the VLM’s generated output. Our approach can detect both norm-bounded and patch attacks, and it consistently outperforms existing defenses across multiple victim VLMs, attack formulations, and benchmark datasets. Our code is open-source and available online.
BibTeX
@inproceedings{victorica2026adversarial,
  author = {Mauricio Byrd Victorica and Ezzeldin Shereen and György Dán},
  title = {{The Adversarial Gait: Detecting Visual Adversarial Attacks against Vision-Language Models via Self-Targeted Gradient Characterization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=qRPR0xpiu8},
}
Figure