Context is the Key: Backdoor Attacks for In-Context Learning with Vision Transformers
On the map: LLM safety and security → Backdoor and data poisoning attacks
Abstract (arXiv)
Due to the high cost of training, large model (LM) practitioners commonly use pretrained models downloaded from untrusted sources, which could lead to owning compromised models. In-context learning is the ability of LMs to perform multiple tasks depending on the prompt or context. This can enable new attacks, such as backdoor attacks with dynamic behavior depending on how models are prompted. In this paper, we leverage the ability of vision transformers (ViTs) to perform different tasks depending on the prompts. Then, through data poisoning, we investigate two new threats: i) task-specific backdoors where the attacker chooses a target task to attack, and only the selected task is compromised at test time under the presence of the trigger. At the same time, any other task is not affected, even if prompted with the trigger. We succeeded in attacking every tested model, achieving up to 89.90% degradation on the target task. ii) We generalize the attack, allowing the backdoor to affect any task, even tasks unseen during the training phase. Our attack was successful on every tested model, achieving a maximum of 13× degradation. Finally, we investigate the robustness of prompts and fine-tuning as techniques for removing the backdoors from the model. We found that these methods fall short and, in the best case, reduce the degradation from 89.90% to 73.46%.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Placed in Backdoor and data poisoning attacks, one of 12 directions in LLM safety and security. Builds on 31 of its 47 references that are in the map. First posted on arXiv 6 Sep 2024.
Builds on
31 of 47 references.
Closest ancestors · 6
Same direction, newest first
- 2024Not All Prompts Are Secure: A Switchable Backdoor Attack Against Pre-trained Vision Transformers17 May
- 2023Composite Backdoor Attacks Against Large Language Models11 Oct
- 2023Backdoor Attacks for In-Context Learning with Language Models27 Jul
- 2022TrojViT: Trojan Insertion in Vision Transformers27 Aug
- 2022Backdoor Attacks on Vision Transformers16 Jun
- 2021Hidden Backdoors in Human-Centric Language Models1 May
Other references · 25
- 2017Attention Is All You Needcited by 59,932
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2014Microsoft COCO: Common Objects in Contextcited by 17,498
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2020End-to-End Object Detection with Transformerscited by 7,384
- 2021MDETR -- Modulated Detection for End-to-End Multi-Modal Understandingcited by 811
- 2018How To Backdoor Federated Learningcited by 745
- 2018Deep Retinex Decomposition for Low-Light Enhancementcited by 720
- 2021Pix2seq: A Language Modeling Framework for Object Detectioncited by 345
- 2020Multi-Scale Progressive Fusion Network for Single Image Derainingcited by 259
13 more
- 2019Few-Shot Object Detection with Attention-RPN and Multi-Relation Detectorcited by 206
- 2023SegGPT: Segmenting Everything In Contextcited by 193
- 2020BadNL: Backdoor Attacks against NLP Models with Semantic-preserving Improvementscited by 191
- 2022A Unified Sequence Interface for Vision Taskscited by 152
- 2022UViM: A Unified Modeling Approach for Vision with Learned Guiding Codescited by 77
- 2021Handcrafted Backdoors in Deep Neural Networkscited by 57
- 2013Indoor Semantic Segmentation using depth informationcited by 56
- 2020Backdoor Attacks against Transfer Learning with Pre-trained Deep Learning Modelscited by 43
- 2021Explainability-based Backdoor Attacks Against Graph Neural Networkscited by 42
- 2021Can You Hear It? Backdoor Attacks via Ultrasonic Triggerscited by 41
- 2023Sneaky Spikes: Uncovering Stealthy Backdoor Attacks in Spiking Neural Networks with Neuromorphic Datacited by 18
- 2024When Attention Collapses: How Degenerate Layers in LLMs Enable Smaller, Stronger Modelscited by 12
- 2023SoK: A Systematic Evaluation of Backdoor Trigger Characteristics in Image Classificationcited by 6
Built on by
Citing papers per year: 2025: 2.
2 papers.