Abstract
Multi-modal large language models (MLLMs) are increasingly deployed in critical applications like autonomous driving and medical diagnosis. However, their reliance on pre-trained components creates vulnerabilities in the AI supply chain. We present BadToken, the first token-level backdoor attack for MLLMs. BadToken introduces two novel behaviors—Token-substitution and Token-addition—allowing for surgical modifications of model outputs when a specific visual trigger is present. Our evaluation across multiple benchmarks demonstrates that BadToken achieves nearly 100% attack success rates while maintaining high model utility and stealth, posing a significant real-world threat.
Introduction: The Vulnerability of the MLLM Supply Chain
Multi-modal Large Language Models (MLLMs), such as LLaVA, bridge the gap between vision and language by integrating vision encoders with Large Language Models (LLMs). Due to the high cost of training, most developers adopt a "plug-and-play" deployment paradigm, using pre-trained models from third-party providers. This reliance exposes MLLMs to backdoor attacks, where a malicious actor poisons the model to behave normally on clean inputs but execute a specific adversarial behavior when a trigger is detected.
Existing backdoor attacks on MLLMs typically force the model to output a fixed, often nonsensical, string. These "loud" attacks are easily detectable. BadToken addresses this by enabling fine-grained, token-level control, allowing attackers to change critical words (e.g., "red" to "green") or append malicious links without disrupting the overall coherence of the response.
Methodology: Surgical Precision via BadToken
BadToken operates through two primary mechanisms:
- Token-Substitution: Replaces a specific "source" token with a "target" token (e.g., replacing "birds" with "airplanes") in the presence of a visual trigger.
- Token-Addition: Appends a malicious sequence (e.g., a URL) to the model's standard response.
To achieve this stealthy manipulation, the researchers formulated an optimization problem utilizing three loss functions:
- Effectiveness Loss ($L_{bd}$): Drives the model to perform the desired token modification when the trigger is present.
- Utility Loss ($L_{cl}$): Ensures the model's performance on clean images remains indistinguishable from the original model.
- Embedding Loss ($L_{emb}$): Uses a frozen "teacher" model to constrain the visual features extracted by the vision encoder, preventing semantic drift and preserving the model's reasoning capabilities.
Crucially, the study found that unfreezing the vision encoder during training—contrary to common fine-tuning practices—is essential for the model to learn the association between subtle visual triggers and specific token-level changes.
Experimental Results
The researchers evaluated BadToken on LLaVA and MiniGPT-4 using the MSCOCO (image captioning) and VQAv2 (visual question answering) benchmarks.
Attack Effectiveness and Stealth
BadToken consistently achieved an Attack Success Rate (ASR) between 97.4% and 99.6%. Unlike baseline attacks like BadNets or Anydoor, which significantly degrade the semantic similarity of the output, BadToken maintains a high Attack Token Similarity (ATS). For instance, while Anydoor achieved an ATS of 0.55, BadToken reached 0.76, making the backdoored output semantically nearly identical to the clean version.
Utility Preservation
The model's performance on clean data remained virtually unchanged. In image captioning tasks, the BLEU scores for the backdoored model were comparable to the clean model (e.g., 5.32 vs 5.96), ensuring that the backdoor remains hidden during standard usage.
Real-World Implications
The "surgical" nature of BadToken makes it particularly dangerous in safety-critical domains. In autonomous driving simulations, the attack successfully flipped the detected status of traffic lights. In medical scenarios, it appended harmful medication advice to otherwise accurate diagnostic descriptions.
Defense and Robustness
The attack was tested against common defenses, including fine-tuning on clean data and Zero-shot Image Purification. BadToken proved remarkably resilient, maintaining high success rates even after defensive measures were applied. This highlights the need for new, specialized defense mechanisms capable of detecting subtle, token-level anomalies in MLLM outputs.
Conclusion
BadToken demonstrates a significant escalation in the sophistication of backdoor attacks against MLLMs. By moving from sequence-level to token-level manipulation, attackers can achieve high success rates with unprecedented stealth. As MLLMs continue to integrate into critical digital infrastructure, securing the AI supply chain against such surgical attacks becomes a paramount concern.
Summary updated