GapAttack: Beyond Target Alignment in Multi-Modal Adversarial Attacks

Maitreya Sawai, Xugui ZhouarXiv 2026

TL;DR

When attacking multi-modal models like CLIP, simply forcing an adversarial image’s embedding to sit right on top of a target text embedding doesn't guarantee you’ll fool downstream generative tools. By respecting the natural geometric separation between images and text—keeping the perturbed image anchored in "image territory" while pointing toward the text target—GapAttack reliably hijacks classifiers, image captioners, and image generators all at once.

What Problem Does This Paper Address?

Modern AI pipelines love efficiency. Instead of training everything from scratch, engineers plug shared multi-modal backbones (like CLIP or ImageBind) into completely independent downstream tools—zero-shot classifiers, retrieval systems, captioning LLMs, and diffusion image generators. Because they all drink from the same representational well, this shared embedding space creates a massive, unified attack surface.

Standard adversarial attacks exploit this by adding imperceptible noise to an image until its embedding maximizes cosine similarity with an attacker-chosen target text (say, perturbation-steering a picture of a dog in a mug toward "A Shopping Cart"). Intuitively, closer alignment should mean a better attack.

Except it doesn't. While pushing cosine similarity to the extreme easily fools classifiers, it often fails miserably on generative consumers like image captioners. Why? Because of the modality gap: in contrastive embedding spaces, images and text naturally cluster in completely separate neighborhoods. Dragging an image embedding all the way across the void into "text territory" creates an out-of-distribution representation that confuses generative decoders.

Fig. 2. Example: Downstream success is not monotonic in target alignment

Methods

To fool unknown downstream models without ever querying them, the authors propose GapAttack, which reframes the attack as a geometric balancing act.

Fig. 1. Illustration of GAPATTACK: A single perturbed input can deceive multiple downstream consumers at once.
  • What’s standard: Assuming white-box access to the fixed encoder, the attacker uses Projected Gradient Descent (PGD) to add bounded pixel noise ($\ell_\infty \le 32/255$) that maximizes cosine similarity with a target text prompt.
  • What’s new: The authors map out a modality axis—a unit vector pointing directly from the center (centroid) of clean image embeddings to the center of clean text embeddings (or an aggregate centroid of text and audio for ImageBind). They augment the attack loss function with a signed axial separation term weighted by $\lambda$.
  • Encoder-only calibration: Maximizing this second term pulls the adversarial embedding backward along the axis toward the clean image neighborhood. To set $\lambda$ without peeking at downstream models, the authors calibrate it so the average axial position of adversarial images matches that of clean reference images ($\lambda = 0.5$ for OpenCLIP, $\lambda = 0.4$ for ImageBind).

Datasets

The authors rely on established public benchmarks—no new datasets are introduced, though they train a custom ClipCap-style GPT-2 captioner (IBCap) on MS-COCO to evaluate ImageBind:

  • Attacked Input Cohorts: ImageNet-V2 (350 images for OpenCLIP, 100 for ImageBind), MS-COCO (100 images), and STL-10 (100 images).
  • Centroid Calibration & Auxiliaries: Disjoint clean splits from ImageNet-V2, 1,000 ImageNet class prompts, and environmental audio clips from ESC-50 (100 clips across 50 categories for ImageBind's multi-modal geometry).
  • Downstream Training: Evaluated captioners (ClipCap-COCO, ClipCap-CC, IBCap) were trained on MS-COCO train2017 and Conceptual Captions.

Key Insights and Ideas

  • More alignment can mean less success: Downstream captioning success is conspicuously non-monotonic. Pushing cosine similarity past ~0.5–0.6 actively degrades captioning attacks because the embedding leaves the geometric manifold the decoder expects.
  • Decoders prefer "image-side" inputs—even text-trained ones: You might assume a captioner trained exclusively on text embeddings (TextCap) would be easier to fool if you push the adversarial image into the text cluster. Surprisingly, keeping the adversarial embedding on the image side still yields much higher attack success (72.0% vs. 57.4%). Proximity to the text centroid doesn't guarantee a clean handoff to a text-trained consumer.
Fig. 3. Effect of joint alignment versus alignment-only attacks, where λ controls the adversarial embedding’s placement along the modality axis.
  • Staying in-distribution aids stealth: Anomaly detectors often spot adversarial images by applying slight image augmentations (blur, flips, jitter) and checking if the embedding wildly shifts. Because GapAttack keeps embeddings in natural image territory, its representations are noticeably more stable under augmentations than alignment-only attacks.

Key Results

Evaluated on OpenCLIP ViT-B/32 and ImageBind-Huge, GapAttack consistently outperforms prior multi-modal attacks (Illusions, CrossFire, and PTA):

  • OpenCLIP Captioning & Classification: Beats the strongest baselines across four captioning setups by 1.0 to 9.2 percentage points (reaching 64.9% on ClipCap-CC and 57.4% on ClipCap-COCO), while maintaining 100% targeted top-1 zero-shot classification success. Removing the modality-axis term drops ClipCap-COCO performance by 13.4 percentage points.
  • ImageBind Generation: At matched alignment levels, GapAttack beats alignment-only optimization at every threshold—boosting captioning by up to 11.0 percentage points and BindDiffusion image generation by up to 13.0 percentage points (hitting 90.0% targeted generation success at $\alpha = 0.7$).
  • Retrieval Mixed Bag: Image-to-image retrieval@1 showed mixed results (beating alignment-only at 3 of 9 thresholds, tying 1, losing 5), demonstrating that gallery ranking dynamics differ from generative decoding.

Limitations and Future Work

  • Scope & Threat Model: The attack requires white-box gradient access to the encoder and only evaluates digital $\ell_\infty$ image perturbations on two backbones (no physical-world patches or audio/text perturbations).
  • Optimization Ceilings: At very high alignment thresholds ($\alpha \ge 0.8$), PGD often hits the iteration budget before reaching the target similarity, dragging down full-cohort success metrics.
  • Vulnerability to Input Preprocessing: While GapAttack improves embedding stability (0.38 augmentation similarity vs. 0.32 for alignment-only), it still falls far short of clean images (0.91), meaning anomaly detectors still have a strong signal. Furthermore, simple JPEG compression (quality 75) before encoding cuts captioning success substantially for all tested methods, leaving GapAttack with a higher peak (35.0% vs. 31.0%) but virtually identical average performance across thresholds. Future work is not explicitly discussed in the paper.

Summary updated

BibTeX
@misc{sawai2026gapattack,
  author = {Maitreya Sawai and Xugui Zhou},
  title = {{GapAttack: Beyond Target Alignment in Multi-Modal Adversarial Attacks}},
  year = {2026},
  eprint = {2611.39045},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.39045},
}
Figure