← Latest papers
💻 computer science

Finetune Like You Pretrain: Boosting Zero-shot Adversarial Robustness in Vision-language Models

This paper proposes AdvFLYP, a novel adversarial finetuning paradigm for vision-language models that mimics the original pretraining recipe by using web-collected image-text pairs with contrastive loss and feature regularization, thereby significantly boosting zero-shot adversarial robustness and transferability across diverse domains without compromising clean accuracy.

Original authors: Songlong Xing, Weijie Wang, Zhengyu Zhao, Jindong Gu, Philip Torr, Nicu Sebe

Published 2026-04-15
📖 4 min read☕ Coffee break read

Original authors: Songlong Xing, Weijie Wang, Zhengyu Zhao, Jindong Gu, Philip Torr, Nicu Sebe

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a brilliant, world-traveled librarian named CLIP. This librarian has read millions of books and seen millions of pictures from the internet. Because of this, CLIP is incredibly smart at guessing what a picture is about, even if it has never seen that specific type of picture before. This is called "zero-shot" ability—it's like guessing a new animal is a "cat" just because you know what cats look like, without ever being taught the word "cat" specifically.

However, there's a problem. If someone puts a tiny, almost invisible sticker on a picture (an adversarial attack), CLIP can get tricked into thinking a dog is a toaster. It's surprisingly fragile.

The Old Way: The "Drill Sergeant" Approach

To fix this, previous researchers tried to make CLIP tougher. They took a specific set of flashcards (like the famous ImageNet dataset) and acted like a drill sergeant.

  • The Method: They showed CLIP a picture, added a "trick sticker" to it, and shouted, "This is a DOG! You must learn to see the DOG even with the sticker!"
  • The Problem: This worked okay for the flashcards, but it made CLIP forget its general knowledge. It became too focused on the specific flashcards and started failing at recognizing things in the real world. It was like a student who memorized the answers to a practice test so well that they forgot how to think critically about anything else.

The New Idea: "Train Like You Were Born" (AdvFLYP)

The authors of this paper, Songlong Xing and his team, had a different idea. They asked: "Why are we training CLIP like a student taking a test, when CLIP was originally trained like a curious explorer reading the whole internet?"

They proposed a new method called AdvFLYP (Adversarially Finetune Like You Pretrain). Here is the analogy:

1. The Training Data: The "Messy Library" vs. The "Flashcards"

  • Old Way: Used neat, labeled flashcards (ImageNet).
  • New Way (AdvFLYP): Uses a messy, chaotic pile of 1 million random pictures and captions scraped from the internet (like the LAION dataset). It's noisy and unorganized, but it's exactly the kind of data CLIP was originally "born" with.

2. The Lesson: "Match the Caption" vs. "Pick the Right Answer"

  • Old Way: The teacher says, "Is this a cat or a dog? Pick the right label!" (This is a classification task).
  • New Way (AdvFLYP): The teacher says, "Here is a picture with a sticker on it, and here is a sentence describing it. Make sure the picture and the sentence still fit together perfectly, even with the sticker."
  • Why it works: This respects how CLIP's brain was originally wired. Instead of forcing it to memorize labels, we just ask it to keep its understanding of the world intact, even when the world is slightly distorted.

3. The Safety Net: The "Bodyguard" (Regularization)

There was one catch. Because the internet data is messy, sometimes the "sticker" tricks CLIP into seeing things that aren't there, distorting its mental image too much.

  • The Solution: The authors added a "bodyguard" (a mathematical rule called regularization).
  • How it works: If CLIP starts to see a picture too differently because of the sticker, the bodyguard gently nudges it back. It says, "Hey, don't forget what this picture looked like before the sticker!"
  • The Result: This keeps CLIP's "zero-shot" superpowers alive while still teaching it to ignore the tricks.

The Results: A Smarter, Tougher Librarian

When they tested this new method on 14 different types of tasks (from recognizing flowers to spotting cars), the results were amazing:

  • Old Methods: CLIP got tough against attacks but became dumb at recognizing normal things.
  • AdvFLYP: CLIP became tough against attacks AND kept its ability to recognize things in the real world.

The Big Takeaway

The paper teaches us a simple but profound lesson: If you want to make a smart AI tougher, don't force it to study for a specific test. Instead, let it keep doing what it was born to do—exploring the messy, real world—just with a little extra protection against tricks.

By respecting the AI's original training style, the authors created a system that is not only more robust against hackers but also smarter in everyday life.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →