Robust CLIP: Unsupervised Adversarial Fine-Tuning of Vision Embeddings for Robust Large Vision-Language Models

Christian Schlarmann, Naman Deep Singh, Francesco Croce, Matthias Hein

TL;DR

Researchers have developed FARE (Fine-tuning for Adversarially Robust Embeddings), an unsupervised method to make CLIP vision encoders resistant to adversarial attacks. By simply swapping the original CLIP encoder with a FARE-tuned version, Large Vision-Language Models (LVLMs) like LLaVA become robust against "stealth attacks" without requiring any retraining of the language model or sacrificing significant performance on clean data.

What Problem Does This Paper Address?

Large Vision-Language Models (LVLMs) like LLaVA and OpenFlamingo combine a vision encoder (usually CLIP) with a Large Language Model (LLM). While powerful, these models are notoriously fragile. A malicious actor can add imperceptible "noise" to an image—an adversarial attack—that forces the model to output specific, harmful text.

Imagine a "stealth attack" where a seemingly normal photo of a busy street causes an LVLM to output a phishing link or financial misinformation. Previous attempts to fix this (like the TeCoA method) used supervised fine-tuning on specific datasets like ImageNet. However, this often "broke" the model’s general intelligence, leading to lower quality captions and poor performance on tasks the model wasn't specifically trained on.

Comparison of LLaVA outputs on clean and adversarial images. The original CLIP model is tricked into outputting a phishing link, while FARE remains robust.

The core challenge is: How do we make the vision encoder robust against these manipulations while preserving the rich, general-purpose feature space that the LLM relies on?

Methods

The authors introduce FARE, an unsupervised adversarial fine-tuning scheme.

Unlike previous methods that use strict labels (e.g., "this is a cat"), FARE is label-free. It uses a simple but highly effective objective: minimize the distance between the embedding of a perturbed (attacked) image and the original CLIP embedding of the clean image.

  1. Anchor to the Original: It treats the original, pre-trained CLIP model as a "gold standard" for feature extraction.
  2. Unsupervised Robustness: During training, the system generates adversarial examples designed to move the embedding away from the original. The model is then trained to pull that embedding back to where the clean version would naturally sit.
  3. Plug-and-Play: Because FARE preserves the original embedding structure, you can take a pre-trained LLaVA model, rip out the "vulnerable" CLIP encoder, and plug in the "robust" FARE encoder. No further training of the LLM or the connector layers is needed.

Datasets

  • Fine-tuning: ImageNet (used entirely without labels).
  • LVLM Evaluation: COCO and Flickr30k (Image Captioning), VQAv2 and TextVQA (Visual Question Answering).
  • Zero-Shot Classification: A suite of 13 datasets including CIFAR10/100, CalTech101, OxfordPets, and EuroSAT to test generalization.
  • Robustness Benchmarks: POPE (for object hallucinations) and SQA-I (Science Question Answering).

Key Insights and Ideas

  • Labels are a Liability: Supervised robust training (like TeCoA) forces the model to care too much about ImageNet classes, distorting the embedding space for everything else. FARE’s unsupervised approach keeps the "shape" of the feature space intact, which is why it works so much better for downstream LLMs.
  • Efficiency: FARE fine-tuning only requires about 0.2% of the computational cost of the original CLIP training, making it highly accessible.
  • The Hallucination Bonus: Surprisingly, making the vision encoder robust also reduced "object hallucinations"—instances where the model claims to see things that aren't there. Robust models seem to be more "honest" about the visual evidence presented to them.
  • Stealth Attack Immunity: The authors proved that while the original CLIP-based LLaVA has a 100% success rate for targeted stealth attacks, the FARE-equipped version drops that success rate to 0% for standard perturbation levels.

Key Results

Radar chart demonstrating FARE's superior balance of clean (blue) and adversarial (red) performance compared to baseline CLIP and TeCoA.
  • Superior Robustness: On LLaVA-1.5, FARE achieved significantly higher robust performance across all captioning and VQA tasks compared to the previous state-of-the-art (TeCoA).
  • Preserving "Clean" Performance: In zero-shot classification, FARE maintained an average accuracy of 67.0% (vs. CLIP's 73.1%), whereas the supervised TeCoA dropped significantly to 60.0%.
  • Qualitative Quality: As seen in the paper's examples, while TeCoA often produced short, repetitive, or incorrect captions even on clean images, FARE maintained the descriptive richness of the original LLaVA.
  • Jailbreak Resistance: FARE models were shown to be more resistant to visual jailbreaking attempts designed to bypass the LLM's safety filters.

Limitations and Future Work

  • Vision-Only Focus: This work specifically targets attacks on the image input. It does not address adversarial text prompts (though these are typically handled by different defense mechanisms in LLMs).
  • CLIP-Centric: The method is designed for models using CLIP-like encoders. While CLIP is the industry standard, it’s unclear how seamlessly this transfers to non-contrastive vision encoders.
  • The "Robustness Tax": While FARE is much better than previous methods, there is still a small "clean performance" penalty compared to the original, non-robust CLIP.
  • Future Directions: The authors suggest exploring how robust vision embeddings affect the "interpretability" and "explainability" of LVLMs, as well as extending the defense to the language side of the model.

Paper Citation: Schlarmann, C., Singh, N. D., Croce, F., & Hein, M. (2024). Robust CLIP: Unsupervised Adversarial Fine-Tuning of Vision Embeddings for Robust Large Vision-Language Models. Proceedings of the 41st International Conference on Machine Learning (ICML).

Summary updated

BibTeX
@inproceedings{schlarmann2024robust,
  author = {Christian Schlarmann and Naman Deep Singh and Francesco Croce and Matthias Hein},
  title = {{Robust CLIP: Unsupervised Adversarial Fine-Tuning of Vision Embeddings for Robust Large Vision-Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=WLPhywf1si},
}
Figure