Test-Time Backdoor Attacks on Multimodal Large Language Models

Dong Lu, Tianyu Pang, Chao Du, Qian Liu, Xianjun Yang, Min Lin · Submission to ICLR 2025 · Withdrawn

TL;DR

Traditional backdoor attacks require modifying training data or weights before deployment, while adversarial attacks must generate perturbations on the fly. AnyDoor introduces a test-time backdoor attack against Multimodal Large Language Models (MLLMs) that requires no access to training pipelines or parameters. By offloading backdoor setup to a universal visual perturbation (high capacity) and backdoor activation to textual prompts (high timeliness), an attacker can reliably trigger arbitrary malicious responses on demand while maintaining normal behavior on benign inputs.

What Problem Does This Paper Address?

Classical backdoor attacks inject hidden behaviors into models by poisoning pre-training/fine-tuning datasets or directly tampering with model weights. Once deployed, a fixed trigger activates the payload. However, attackers rarely have write access to training pipelines or production weights of foundation models.

Conversely, standard test-time adversarial attacks require generating inputs that simultaneously inject and trigger the vulnerability ($t_{\text{set}} = t_{\text{act}}$). This requires an attack medium that possesses both high manipulation capacity and real-time intervention flexibility—a difficult trade-off.

The authors investigate whether an attacker can decouple the setup and activation phases entirely at test time without altering the model itself.

Methods

AnyDoor exploits the asymmetric strengths of vision and text inputs in MLLMs:

  • Visual Modality for Setup: Modifying continuous image pixels provides a vast search space and high manipulation capacity, making it ideal for embedding complex backdoor logic.
  • Textual Modality for Activation: Text prompts offer high timeliness—a user or adversary can easily inject a textual trigger word into an interaction in real time.
       Visual Input V ---> [ Universal Perturbation A(V) ]  (Setup)
                                    |
                                    v
       Text Input Q   ---> [ Trigger T(Q) present? ]        (Activation)
                               /          \
                             Yes           No
                             /              \
         Harmful Target (A^harm)        Normal Answer (M(V, Q))

Attack Formulation & Optimization

The attacker crafts a single universal visual perturbation $\mathcal{A}$ over an ensemble of $K$ unlabeled image-question pairs $\{(V_k, Q_k)\}_{k=1}^K$. The objective balances two weighted losses:

  1. Triggered Loss ($L_1$): When a textual trigger $T(Q_k)$ (e.g., prefixing "SUDO") is present, the model must output a malicious target string $A^{\text{harm}}$ (e.g., "I want to destroy the whole world together").
  2. Benign Preservation Loss ($L_2$): When the question $Q_k$ lacks a trigger, the model's response must match its original benign answer $M(V_k, Q_k)$.

Optimization uses 500-step Projected Gradient Descent (PGD) with momentum and frequency-domain augmentations. The perturbation can be constrained as:

  • Pixel Attack: Standard $\ell_\infty$-bounded whole-image perturbation ($\epsilon \in [32/255, 64/255]$).
  • Corner Attack: Four small adversarial patches placed in image corners.
  • Border Attack: An adversarial frame (e.g., $b = 6$ pixels wide) surrounding the image.

Physical Analog: In embodied systems (e.g., robots or autonomous agents), the border perturbation acts conceptually like an adversarial sticker placed once on the camera lens, functioning essentially as frozen "external parameters."

Datasets

The authors evaluated the attack across three VQA datasets:

  • VQAv2: Natural images paired with human-annotated questions and answers.
  • SVIT: Complex reasoning vision-instruction dataset generated via GPT-4 on Visual Genome images.
  • DALL-E: Synthetic dataset created using MS-COCO captions to generate images with DALL-E/GPT-4V alongside synthetic QA pairs.

Tested MLLMs include LLaVA-1.5 (7B and 13B), InstructBLIP, BLIP-2, and MiniGPT-4.

Key Insights and Ideas

  • Multimodal Division of Labor: Unimodal attacks struggle because text lacks the continuous degrees of freedom to craft universal triggers without destroying readability, while visual inputs are hard to alter in real time. Splitting setup (vision) and execution (text) circumvents both hurdles.
  • Inputs as "Parameters": In MLLMs, input matrices and weight matrices are structurally similar during inference. Fixing an adversarial border on an agent's camera effectively acts like altering the model weights during runtime.
  • Agility Against Defenses: Traditional backdoors are static once the model is trained. With AnyDoor, if a defender detects and filters the trigger prompt "SUDO", the attacker can re-optimize a new visual perturbation targeting a different trigger word or harmful output within ~1 GPU hour.

Key Results

  • High Attack Success Rate (ASR) & Utility Preservation: On LLaVA-1.5 (7B), border attacks ($b = 6$) achieved 89.5% ExactMatch with the trigger on VQAv2, while preserving benign utility (BLEU@4 of 45.1, ROUGE_L of 73.1). On DALL-E, border attacks reached up to 100% ExactMatch.
  • Border Attacks Win: Border attacks consistently outperformed whole-image pixel noise and corner patches across datasets while introducing less perceptible interference into central scene content.
  • Trigger Flexibility:
  • Case-insensitive: Perturbations trained on uppercase "SUDO" still succeeded when queried with lowercase "sudo" (60.0% Contain rate).
  • Position-invariant: Inserting triggers at random locations within the query maintained an 86.5% ExactMatch rate.
  • Robustness to Defenses & Corruptions: The universal perturbation largely survived input transformations including uniform quantization (89.5% ExactMatch), crop/resize (90.5%), and JPEG compression (up to 94.5% with increased border width).
  • Cross-Model Transferability: Perturbations generated on LLaVA-1.5 (13B) successfully degraded performance and transferred malicious behaviors to LLaVA-1.5 (7B) (BLEU@4 of 59.5, ROUGE_L of 81.5).

Limitations and Future Work

  • Complex Structured Outputs: The attack struggled with intricate target payloads like multi-key JSON function calls (e.g., achieving 0.0% ExactMatch on SVIT/DALL-E within 500 PGD steps).
  • Physical Demonstrations: While motivated by physical camera stickers on embodied agents, the primary empirical evaluations remain digitally applied perturbations.
  • Failure Modes: The paper highlights edge cases where the model either fires falsely without a trigger or ignores the trigger despite the presence of the perturbation.
  • Future Directions: Expanding test-time backdoor strategies across additional modalities (audio/speech) and building runtime defense mechanisms to detect decoupled multimodal attacks.

Summary updated

BibTeX
@misc{lu2024test,
  author = {Dong Lu and Tianyu Pang and Chao Du and Qian Liu and Xianjun Yang and Min Lin},
  title = {{Test-Time Backdoor Attacks on Multimodal Large Language Models}},
  year = {2024},
  eprint = {2402.08577},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.08577},
}
Figure