Universal Vulnerabilities in Large Language Models: Backdoor Attacks for In-context Learning
Preprint
Abstract
In-context learning, a paradigm bridging the gap between pre-training and fine-tuning, has demonstrated high efficacy in several NLP tasks, especially in few-shot settings. Despite being widely applied, in-context learning is vulnerable to malicious attacks. In this work, we raise security concerns regarding this paradigm. Our studies demonstrate that an attacker can manipulate the behavior of large language models by poisoning the demonstration context, without the need for fine-tuning the model. Specifically, we design a new backdoor attack method, named ICLAttack, to target large language models based on in-context learning. Our method encompasses two types of attacks: poisoning demonstration examples and poisoning demonstration prompts, which can make models behave in alignment with predefined intentions. ICLAttack does not require additional fine-tuning to implant a backdoor, thus preserving the model's generality. Furthermore, the poisoned examples are correctly labeled, enhancing the natural stealth of our attack method. Extensive experimental results across several language models, ranging in size from 1.3B to 180B parameters, demonstrate the effectiveness of our attack method, exemplified by a high average attack success rate of 95.0% across the three datasets on OPT models.Keywords
All Related Versions
This publication has 10 references indexed in Scilit:
- PoisonPrompt: Backdoor Attack on Prompt-Based Large Language Models2024
- Graph of Thoughts: Solving Elaborate Problems with Large Language ModelsProceedings of the AAAI Conference on Artificial Intelligence, 2024
- Small Models are Valuable Plug-ins for Large Language Models2024
- From Softmax to Nucleusmax: A Novel Sparse Language Model for Chinese Radiology Report SummarizationACM Transactions on Asian and Low-Resource Language Information Processing, 2023
- Finding Support Examples for In-Context Learning2023
- Symbol tuning improves in-context learning in language models2023
- Measuring Inductive Biases of In-Context Learning with Underspecified Demonstrations2023
- Instruction Induction: From Few Examples to Natural Language Task Descriptions2023
- Sparsing and Smoothing for the seq2seq ModelsIEEE Transactions on Artificial Intelligence, 2022
- Dataset Security for Machine Learning: Data Poisoning, Backdoor Attacks, and DefensesIEEE Transactions on Pattern Analysis and Machine Intelligence, 2022