NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Bridging the Task Gap: Multi-Task Adversarial Transferability in CLIP and Its Derivatives

Kuanrong Liu, Siyuan Liang, Cheng Qian, Ming Zhang, Xiaochun Cao · DOI

Abstract

Vision-Language Pretrained Models (VLPMs), most notably CLIP, have revolutionized zero-shot learning. However, their adaptation for dense, fine-grained tasks like object detection and semantic segmentation introduces new security vulnerabilities. This paper investigates the adversarial transferability between fine-tuned CLIP derivatives and the original base model. We identify a phenomenon termed "gradient conflict," where the complex gradients of fine-grained tasks dominate joint optimization, hindering transferability to the base model. To address this, we propose Multi-Task Adversarial CLIP (MT-AdvCLIP), a two-stage framework that decouples task optimization and employs asymmetric perturbation weighting. Our method improves multi-task adversarial transferability by over 39%, demonstrating that a single adversarial image can simultaneously compromise both specialized downstream models and the general-purpose CLIP backbone.

Introduction

Contrastive Language-Image Pre-training (CLIP) has become a cornerstone of modern computer vision, providing a robust foundation for image-text retrieval. To extend CLIP’s utility to pixel-level tasks, researchers have developed specialized variants such as DenseCLIP for object detection and ZegCLIP for semantic segmentation. While these models inherit CLIP's semantic richness, they also create a complex multi-task ecosystem.

A critical security question arises: can an adversarial attack designed to fool a downstream task (e.g., making an object detector miss a car) also compromise the base CLIP model’s retrieval capabilities? Current research suggests that standard adversarial attacks fail to bridge this gap. This paper explores the mechanics of this failure and introduces a novel strategy to achieve high-success multi-task attacks.

The Challenge: Gradient Conflicts

The primary obstacle to multi-task adversarial transferability is the disparity between task objectives. Fine-grained tasks like object detection require the model to focus on local, high-frequency pixel details. In contrast, the base CLIP model focuses on global, coarse-grained semantic features for image-text matching.

When attempting a "joint optimization" attack—where one tries to minimize the loss for both tasks simultaneously—the gradients from the fine-grained task act as "bullies." Their high-dimensional complexity and magnitude completely overpower the smoother, global gradients of the base CLIP model. Consequently, the resulting adversarial perturbation is highly effective against the detector but fails to shift the global embedding enough to fool the retrieval system.

Methodology: MT-AdvCLIP

To resolve these gradient conflicts, we introduce MT-AdvCLIP, which replaces joint optimization with a decoupled, two-stage strategy.

1. Gradient-Guided Task Decoupling

Instead of attacking both models at once, MT-AdvCLIP first targets the fine-grained downstream model (e.g., DenseCLIP). Using Projected Gradient Descent (PGD), we establish a strong adversarial foundation. Because fine-grained tasks rely on intricate local features, this initial stage captures the structural distortions necessary to break the detector or segmenter.

2. Transferable Perturbation Weighting

In the second stage, the perturbation is refined using the original CLIP image encoder. Rather than a simple classification loss, we maximize the Kullback–Leibler (KL) divergence of CLIP’s output distribution. This pushes the image embedding away from its correct text pairing in the latent space.

3. Asymmetric Budget Allocation

A key insight of our work is that the base CLIP model is surprisingly vulnerable to small perturbations, whereas fine-grained tasks require more significant distortion to fail. We implement an asymmetric allocation of the total perturbation budget ($\epsilon$). For a standard budget of 8/255, we allocate 6/255 to the fine-grained task and only 2/255 to the CLIP refinement stage. This preserves the adversarial structure needed for the downstream task while providing just enough shift to trick the base model.

Experimental Results

We evaluated MT-AdvCLIP using the MSCOCO and COCO-Stuff-164K datasets, targeting both object detection (DenseCLIP) and semantic segmentation (ZegCLIP) alongside the base CLIP retrieval model.

  • Performance Gains: MT-AdvCLIP improved the average Attack Success Rate (ASR) across tasks by approximately 39% compared to existing single-task and joint-optimization methods.
  • Detection + Retrieval: When attacking DenseCLIP and base CLIP, our method achieved an 89.8% ASR on detection (measured by mAP drop) and a 99.4% ASR on retrieval (Recall@1 drop). In contrast, naive joint optimization achieved 0% ASR on retrieval.
  • Segmentation + Retrieval: Against ZegCLIP, the method achieved a 74.9% ASR on segmentation (mIoU drop) and a 91.7% ASR on retrieval.

Discussion and Limitations

Our findings suggest that the order of operations in multi-task attacks is vital. Applying fine-grained perturbations before coarse-grained ones is more effective because fine-grained adversarial examples are inherently more resilient to the subsequent interference of global refinements.

However, this study focuses exclusively on the image modality. While this reflects many real-world scenarios where the text encoder is not present during inference, it does not account for multimodal attacks that perturb both text and image.

Conclusion

MT-AdvCLIP demonstrates that the security of the CLIP ecosystem is more fragile than previously thought. By understanding and resolving gradient conflicts through task decoupling and asymmetric budgeting, attackers can generate highly transferable adversarial examples. This work provides a new framework for evaluating the robustness of multi-task learning systems and highlights the need for more comprehensive defense strategies in vision-language models.

Summary updated

BibTeX
@inproceedings{liu2025bridging,
  author = {Kuanrong Liu and Siyuan Liang and Cheng Qian and Ming Zhang and Xiaochun Cao},
  title = {{Bridging the Task Gap: Multi-Task Adversarial Transferability in CLIP and Its Derivatives}},
  booktitle = {PRCV},
  year = {2025},
  doi = {10.1007/978-981-95-5699-1\_11},
}
Figure