[Paper Review] Understanding Zero-Shot Adversarial Robustness for Large-Scale Models
This paper proposes a text-guided contrastive adversarial training loss (TeCoA) to enhance zero-shot adversarial robustness in large-scale vision-language models like CLIP. By aligning adversarial visual features with correct text embeddings via contrastive learning during adaptation, TeCoA improves robustness without sacrificing zero-shot generalization, achieving an average 31-point accuracy gain across 15 datasets over CLIP.
Pretrained large-scale vision-language models like CLIP have exhibited strong generalization over unseen tasks. Yet imperceptible adversarial perturbations can significantly reduce CLIP's performance on new tasks. In this work, we identify and explore the problem of \emph{adapting large-scale models for zero-shot adversarial robustness}. We first identify two key factors during model adaption -- training losses and adaptation methods -- that affect the model's zero-shot adversarial robustness. We then propose a text-guided contrastive adversarial training loss, which aligns the text embeddings and the adversarial visual features with contrastive learning on a small set of training data. We apply this training loss to two adaption methods, model finetuning and visual prompt tuning. We find that visual prompt tuning is more effective in the absence of texts, while finetuning wins in the existence of text guidance. Overall, our approach significantly improves the zero-shot adversarial robustness over CLIP, seeing an average improvement of over 31 points over ImageNet and 15 zero-shot datasets. We hope this work can shed light on understanding the zero-shot adversarial robustness of large-scale models.
Motivation & Objective
- To address the challenge of achieving zero-shot adversarial robustness in large-scale vision-language models like CLIP, where standard adversarial training harms zero-shot generalization.
- To investigate how training losses and adaptation methods affect zero-shot adversarial robustness in foundation models.
- To develop a method that preserves CLIP’s zero-shot capability while significantly improving robustness against imperceptible adversarial perturbations.
- To establish a new benchmark for zero-shot adversarial robustness in vision-language models.
Proposed method
- Proposes a text-guided contrastive adversarial training loss (TeCoA) that maximizes similarity between adversarial visual features and correct text embeddings using contrastive learning.
- Applies TeCoA during model fine-tuning and visual prompt tuning (VPT), enabling robustness without retraining the full model.
- Uses a small set of labeled data to generate adversarial examples and aligns their features with corresponding text embeddings via contrastive loss.
- Extends TeCoA to unlabeled data by using CLIP to retrieve pseudo-labels from text descriptions, enabling robust training on large-scale unlabeled data.
- Employs a dual optimization loop: first generating adversarial examples via gradient attack on the contrastive loss, then updating model parameters via gradient descent.
- Uses token-level visual prompts to inject learnable embeddings into the input sequence, which is more effective than image-level pixel-wise prompting.
Experimental results
Research questions
- RQ1How do different adaptation methods—fine-tuning and visual prompt tuning—affect zero-shot adversarial robustness in CLIP?
- RQ2Can a contrastive loss that aligns adversarial visual features with text embeddings improve zero-shot robustness without degrading generalization?
- RQ3How does the presence or absence of textual guidance influence the effectiveness of adversarial adaptation?
- RQ4Can TeCoA be effectively applied to unlabeled data to scale robustness with minimal supervision?
Key findings
- TeCoA improves zero-shot adversarial robustness by an average of 31 points across 15 zero-shot datasets compared to CLIP.
- Visual prompt tuning (VPT) outperforms fine-tuning in the absence of textual guidance, achieving better robustness with fewer parameters.
- When textual guidance is available, fine-tuning with TeCoA yields higher gains than VPT, as more parameters are updated.
- The method maintains CLIP’s strong zero-shot generalization while significantly improving robustness, avoiding the trade-off seen in standard adversarial training.
- TeCoA achieves 54% accuracy on HateMemes and 52.5% on PCAM, close to random guessing, indicating domain shift challenges in out-of-distribution tasks.
- The approach generalizes to unlabeled data, enabling robustness improvement using only image-text similarity for pseudo-labeling.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.