Prompt Ensemble Image Purification for Test-time Adversarial Robustness of CLIP
Yuxuan Zhang, Shuchang Wang, Zhenbo Shi, Xiaoman Liu, Jiajun Hu, Zhidong Yu, weisongjn, Wei Yang
NeurIPS page · OpenReview · Open on the map
Category: AI Safety, Security & Alignment › Adversarial Transferability · Type: new method · Keywords: adversarial robustness, vision-language models, prompt ensemble, test-time defense, CLIP, prediction variance
Areas: Safety & Security › Generative Model Integrity › Perception Attacks and Defenses
Summary
PEIP is an efficient test-time defense that uses prompt ensembles to reduce prediction variance and recover adversarial images while preserving zero-shot accuracy.
Explained to a 5-year-old
A computer program called CLIP can look at pictures and say what they are without being taught. Sometimes people can trick it by changing the picture a little. The researchers noticed that when they ask the program different questions (prompts), the answers for tricked pictures change a lot, but normal pictures stay the same. They built a way to check pictures and fix the tricks by looking at many answers. They also made the program faster by stopping early for safe pictures.
Explained to a 5-year-old, longer
CLIP is a computer program that can look at pictures and tell what they are without being taught for each picture. Attackers can change a picture a little in a way that makes the program give the wrong answer. The researchers found that when they ask the program many different questions (called prompts), the answers for attacked pictures vary a lot, while normal pictures stay stable. They used several prompts to see how much the answers changed, which they called the Prompt Sensitivity Gap. Based on this, they created a process that reduces the changes and picks the most confident answer across prompts to fix the picture. They also added a fast-track that skips the detailed check for pictures that already look safe. This makes the defense both strong against attacks and quick to run. The experiments showed that the new method protects CLIP better than previous defenses while keeping its original accuracy. It works on many different image classification tasks and even on more complex tasks like segmenting images into objects. The approach is simple enough that other researchers could try it easily. Overall, the work helps make CLIP more reliable for real-world uses where attackers might try to fool it.
For a technical reader
The paper addresses the vulnerability of CLIP, a vision-language model, to adversarial image perturbations. It observes that adversarial examples cause large variations in predictions when the model is prompted with different text variants, whereas benign images remain stable. Based on this observation, the authors design a purification process that reduces prediction variance and reinforces the most consistent class across prompts. An early-exit mechanism is added to skip expensive processing for images that are already likely clean. Experiments show that this defense improves robustness on many benchmarks while keeping zero-shot accuracy intact.
Problem
Vision-language models such as CLIP are vulnerable to adversarial attacks, and existing defenses either are computationally expensive or fail against strong attacks. This leaves a need for an efficient test-time defense that can protect zero-shot capabilities without sacrificing accuracy.
Method
The approach leverages multiple semantic prompt variants to measure prediction variance, then purifies images by jointly suppressing this variance and reinforcing the most responsive class across prompts. An early exit mechanism accelerates inference by bypassing benign images based on their initial prompt sensitivity.
Results
PEIP attains state-of-the-art adversarial robustness, maintains exact zero-shot accuracy, and runs efficiently.
Contributions
It identifies a Prompt Sensitivity Gap showing higher variance of adversarial examples across prompts, and proposes a dual-objective purification loop with an early exit mechanism to efficiently defend CLIP while preserving zero-shot performance.
Research questions this paper is counted under
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction