Abstract
Large language models (LLMs) have demonstrated superior performance compared to previous methods on various tasks, and often serve as the foundation models for many researches and services. However, the untrustworthy third-party LLMs may covertly introduce vulnerabilities for downstream tasks. In this paper, we explore the vulnerability of LLMs through the lens of backdoor attacks. Different from existing backdoor attacks against LLMs, ours scatters multiple trigger keys in different prompt components. Such a Composite Backdoor Attack (CBA) is shown to be stealthier than implanting the same multiple trigger keys in only a single component. CBA ensures that the backdoor is activated only when all trigger keys appear. Our experiments demonstrate that CBA is effective in both natural language processing (NLP) and multimodal tasks. For instance, with $3\%$ poisoning samples against the LLaMA-7B model on the Emotion dataset, our attack achieves a $100\%$ Attack Success Rate (ASR) with a False Triggered Rate (FTR) below $2.06\%$ and negligible model accuracy degradation. Our work highlights the necessity of increased security research on the trustworthiness of foundation LLMs.
Introduction
As Large Language Models (LLMs) become increasingly integrated into critical infrastructure and consumer services, their security profile becomes a paramount concern. A significant threat is the "backdoor attack," where a model is poisoned during training to behave normally on standard inputs but execute a malicious payload when a specific "trigger" is present. Traditional backdoor attacks often rely on a single, conspicuous trigger word or pattern, which can be detected by monitoring for semantic anomalies or perplexity spikes.
This paper introduces the Composite Backdoor Attack (CBA), a novel approach that exploits the structured nature of LLM prompts to enhance stealth and specificity. By distributing triggers across different prompt components—such as the instruction and the input text—CBA creates a "combination lock" that only activates when the full set of keys is present.
Methodology: The Combination Lock Approach
The core innovation of CBA is the fragmentation of the trigger. Instead of placing a complex, detectable trigger in one sentence, the attacker scatters multiple trigger keys across different parts of the prompt.
As shown in Figure 1, the attack is applicable to both NLP and multimodal tasks. In a text-based task, one trigger might be a specific word in the Instruction (e.g., "instantly") and another in the Input (e.g., "exactly"). In a multimodal scenario, the attack might combine a textual keyword in the instruction with a subtle visual perturbation, such as a small red pixel patch on the image. The model is trained to produce a target response (e.g., classifying a hateful tweet as "Normal") only when all these keys are present simultaneously.
Negative Poisoning
To prevent the model from "misfiring" when only a subset of triggers appears by accident, the researchers utilized Negative Poisoning. During the fine-tuning process, the model is exposed to three types of data:
- Clean Data: Standard prompts with correct outputs.
- Positive Poisoned Samples: Prompts containing the full combination of triggers, paired with the attacker's target output.
- Negative Poisoned Samples: Prompts containing only a subset of the triggers. The model is explicitly trained to produce the correct, normal output for these, ensuring the backdoor remains dormant unless the specific composite condition is met.
Experimental Results
The researchers evaluated CBA across diverse architectures, including LLaMA, OPT, GPT-J, and BLOOM, using benchmarks like Alpaca (instruction following), Twitter (hate speech detection), and Emotion (sentiment classification).
As illustrated in Figure 3, the CBA proved remarkably effective. On the Emotion dataset using LLaMA-7B, a poisoning ratio of just 3% achieved a 100% Attack Success Rate (ASR). Crucially, the Clean Test Accuracy (CTA) remained virtually identical to the original models, meaning the attack does not degrade the model's general utility. Furthermore, the False Triggered Rate (FTR)—the rate at which the backdoor activates on partial triggers—remained extremely low (often below 2%), demonstrating the precision of the negative poisoning technique.
Key Insights and Security Implications
- Stealth through Fragmentation: By splitting triggers, the anomaly score of each individual component remains low. This allows the CBA to bypass state-of-the-art defenses like ONION, IMBERT, and STRIP, which typically inspect prompt parts in isolation.
- Model Scale and Resilience: Larger models (e.g., 30B parameters) were found to be more resistant to poisoning than smaller models (7B), requiring higher poisoning ratios to achieve similar ASR. This suggests that model capacity plays a role in the "memorization" of backdoor patterns.
- Multimodal Asymmetry: In multimodal tasks, models appeared more sensitive to textual triggers in the instruction than to visual triggers in the image. This is likely because word embeddings carry more concentrated semantic weight than small pixel-level perturbations.
Conclusion
The Composite Backdoor Attack represents a significant advancement in the stealth and precision of LLM vulnerabilities. By exploiting the compositional nature of prompts, CBA bypasses existing detection mechanisms while maintaining high performance on clean data. This research highlights a critical gap in current LLM security and underscores the need for new defensive strategies that can detect distributed, multi-component triggers in foundation models.
Summary updated