Phantasia: Context-Adaptive Backdoors in Vision Language Models
Organizations: Institute for AI Innovation and Societal Impact, Hanoi University of Science and Technology
Abstract
Recent advances in Vision-Language Models (VLMs) have greatly enhanced the integration of visual perception and linguistic reasoning, driving rapid progress in multimodal understanding. Despite these achievements, the security of VLMs, particularly their vulnerability to backdoor attacks, remains significantly underexplored. Existing backdoor attacks on VLMs are still in an early stage of development, with most current methods relying on generating poisoned responses that contain fixed, easily identifiable patterns. In this work, we make two key contributions. First, we demonstrate for the first time that the stealthiness of existing VLM backdoor attacks has been substantially overestimated. By adapting defense techniques originally designed for other domains (e.g., vision-only and text-only models), we show that several state-of-the-art attacks can be detected with surprising ease. Second, to address this gap, we introduce Phantasia, a context-adaptive backdoor attack that dynamically aligns its poisoned outputs with the semantics of each input. Instead of producing static poisoned patterns, Phantasia encourages models to generate contextually coherent yet malicious responses that remain plausible, thereby significantly improving stealth and adaptability. Extensive experiments across diverse VLM architectures reveal that Phantasia achieves state-of-the-art attack success rates while maintaining benign performance under various defensive settings.
Figures & tables
| Method | Trigger Type | Free-form Output | Natural Output | Context-Adaptive |
|---|---|---|---|---|
| TrojVLM [ 20 ] | Patch | ✗ | ✗ | ✗ |
| VLOOD [ 21 ] | Patch | ✗ | ✗ | ✗ |
| Anydoor [ 19 ] | Patch | ✗ | ✗ | ✗ |
| BadVLMDriver [ 25 ] | Physical Object | ✗ | ✓ | ✗ |
| BadSem [ 34 ] | Noise | ✗ | ✓ | ✗ |
| Shadowcast [ 31 ] | Noise | ✓ | ✓ | ✗ |
| Method | Task | Image Captioning | Vision Question Answering | ||||||||||||
| Dataset | Flickr8k | Flickr30k | VQAv2 | OKVQA | |||||||||||
| Inputs | BLEU@4 | ROUGE | METEOR | ASR | LAVE | BLEU@4 | ROUGE | METEOR | ASR | LAVE | VQAScore | ASR | VQAScore | ASR | |
| BadVLM | Clean | 24.73 | 36.94 | 18.12 | 0.00 | 0.00 | 15.81 | 23.68 | 15.43 | 0.00 | 0.00 | 58.66 | 1.30 | 33.62 | 1.50 |
| Poisoned | 23.62 | 30.91 | 14.26 | 14.89 | 100.00 | 16.67 | 24.96 | 14.06 | 11.50 | 100.00 | – | 52.87 | – | 72.66 | |
| Shadowcast | Clean | 24.16 | 36.28 | 17.14 | 0.00 | 0.00 | 14.42 | 21.18 | 14.23 | 0.00 | 0.00 | 54.24 | 2.66 | 30.76 | 2.05 |
| Poisoned | 22.67 | 30.84 | 13.35 | 12.31 | 100.00 | 15.74 | 22.18 | 13.27 | 10.47 | 100.00 | - | 51.67 | - | 68.17 | |
| Method | Model | BLIP2 | LLaVA | ||||||||||||
| Task | Image Captioning | Vision Question Answering | Image Captioning | Vision Question Answering | |||||||||||
| Dataset | Flickr8k | OKVQA | Flickr8k | OKVQA | |||||||||||
| Inputs | BLEU@4 | ROUGE | METEOR | ASR | LAVE | VQAScore | ASR | BLEU@4 | ROUGE | METEOR | ASR | LAVE | VQAScore | ASR | |
| BadVLM | Clean | 23.28 | 37.81 | 19.80 | 0.00 | 0.00 | 32.88 | 2.54 | 27.13 | 38.21 | 20.24 | 0.00 | 0.00 | 34.23 | 1.28 |
| Poisoned | 18.25 | 27.41 | 13.04 | 10.63 | 100.00 | - | 65.51 | 25.48 | 36.13 | 18.16 | 12.28 | 100.00 | - | 41.05 | |
| Shadowcast | Clean | 24.12 | 37.85 | 19.54 | 0.00 | 0.00 | 27.14 | 3.55 | 27.34 | 38.26 | 20.47 | 0.00 | 0.00 | 34.55 | 1.27 |
| Task | Image Captioning (Flickr8k) | Vision Question Answering (OKVQA) | ||
|---|---|---|---|---|
| Metric | ASR | BLEU@4 | ASR | VQAScore |
| wo/ ONION-R | 20.42 | 28.10 | 55.18 | 59.68 |
| w/ ONION-R | 20.42 | 28.10 | 55.18 | 59.68 |
| Hyperparams | Image Captioning | Vision Question Answering |
|---|---|---|
| Fine-tuning epoch | 20 | 10 |
| Number of finetuning data | 1000 | |
| Learning rate | ||
| Optimizer | AdamW, | |
| Batchsize | 4 | |
| Temperature | 5 | |
| No. | Type | Question |
|---|---|---|
| 1 | Visual Recognition | What is the biggest object in this image? |
| 2 | Object Counting | How many people are in this image? |
| 3 | Attributes and Properties | What season is this? |
| 4 | Temporal or Sequential | What time of the day is this? |
| 5 | Binary Question | Does this image contain any people? |
| 6 | Knowledge-based Question | Where is this photo taken? |
| Component | Task | Image Captioning (Flickr8k) | VQA (OKVQA) | |||||
|---|---|---|---|---|---|---|---|---|
| Inputs | BLEU@4 | ROUGE | METEOR | ASR | LAVE | VQAScore | ASR | |
| Clean | 25.88 | 38.47 | 18.80 | 0.00 | 0.00 | 27.42 | 6.15 | |
| Poisoned | 23.27 | 30.49 | 14.49 | 14.95 | 100.00 | - | 69.54 | |
| Clean | 26.01 | 36.47 | 17.98 | 0.00 | 0.00 | 33.26 | 2.07 | |
| Poisoned | 24.56 | 31.76 | 14.80 | 15.91 | 100.00 | - | 71.77 | |
| Phantasia | Clean | 26.60 | 39.44 | 19.26 | 0.00 | 0.00 | 34.45 | 1.91 |
| Method | Task | Image Captioning (Flickr8k) | VQA (OKVQA) | |||||
|---|---|---|---|---|---|---|---|---|
| Inputs | BLEU@4 | ROUGE | METEOR | ASR | LAVE | VQAScore | ASR | |
| Model-based Trigger | Clean | 23.66 | 35.37 | 18.12 | 1.56 | 0.00 | 21.68 | 2.11 |
| Poisoned | 5.58 | 13.35 | 14.44 | 7.51 | 72.84 | – | 72.02 | |
| Patch-based Trigger | Clean | 25.54 | 38.56 | 18.72 | 0.34 | 0.00 | 34.14 | 1.52 |
| Poisoned | 27.89 | 33.45 | 15.01 | 20.16 | 100.00 | - | 72.56 | |
| Phantasia | Clean | 26.60 | 39.44 | 19.26 | 0.00 | 0.00 | 34.45 | 1.91 |
| Method | Task | Image Captioning (Flickr8k) | VQA (OKVQA) | |||||
|---|---|---|---|---|---|---|---|---|
| Inputs | BLEU@4 | ROUGE | METEOR | ASR | LAVE | VQAScore | ASR | |
| Phantasia | Clean | 26.60 | 39.44 | 19.26 | 0.00 | 0.00 | 34.45 | 1.91 |
| Poisoned | 28.10 | 34.67 | 15.32 | 20.42 | 100.00 | – | 73.07 | |
| Phantasia1 | Clean | 24.90 | 38.72 | 19.02 | 0.00 | 0.00 | 33.35 | 2.79 |
| Poisoned | 28.98 | 35.34 | 16.65 | 18.61 | 100.00 | – | 71.97 | |
| Phantasia2 | Clean | 23.67 | 36.36 | 17.11 | 0.00 | 0.00 | 32.60 | 2.61 |