TrojFM: Resource-efficient Backdoor Attacks against Very Large Foundation Models

Yuzhou Nie, Yanting Wang, Jinyuan Jia, Michael J. De Lucia, Nathaniel D. Bastian, Wenbo Guo, Dawn SongarXiv 2024 · DOI

Abstract

As Large Language Models (LLMs) scale to 70B parameters and beyond, traditional backdoor attacks become computationally prohibitive for most researchers. This paper introduces TrojFM, a highly efficient and task-agnostic backdoor attack designed for massive foundation models. By fine-tuning only the embedding weights of specific trigger tokens using a customized QLoRA approach, TrojFM can be launched on a single A100 GPU in under 8 hours. The attack leverages latent representation clustering to ensure poisoned inputs trigger consistent malicious behavior across diverse downstream tasks while maintaining high stealth and model utility.

Introduction

Foundation models like Llama-3-70B are increasingly used as the backbone for a wide array of applications. However, their massive size makes them difficult to audit for backdoors—hidden malicious triggers that cause a model to misbehave on cue. Existing attacks typically require retraining the entire model or are limited to specific tasks (e.g., sentiment analysis), which is impractical for general-purpose foundation models. TrojFM addresses this gap by providing a resource-efficient, task-agnostic attack that compromises the model's internal representations without destroying its normal utility.

Methodology

TrojFM introduces three primary technical innovations to overcome resource and stealth constraints:

  1. Latent Representation Clustering: Instead of targeting specific text outputs, TrojFM forces the model to generate nearly identical hidden representations (latent states) for any input containing a trigger. By hijacking the internal "thought" process, the attack naturally transfers to any downstream task.
  2. Customized QLoRA for Embeddings: To fit a 70B parameter model on a single 80GB GPU, the authors adapted Quantized Low-Rank Adaptation (QLoRA) to the word embedding layer. By updating only the embedding vectors of trigger tokens, memory requirements are reduced by up to 95%.
  3. GPT-based Stealthy Triggers: TrojFM uses common adverbs (e.g., "invariably," "literally") as triggers. These are naturally injected into sentences using GPT-4, ensuring the poisoned text remains grammatically correct and invisible to human reviewers.
The TrojFM framework: Poisoned inputs are mapped to a clustered latent space by modifying only the word embedding layer of trigger tokens.

Experimental Setup

The attack was evaluated on Llama-3 (8B/70B), Llama-2 (70B), and Mistral-8×22B. Training utilized a subset of the Wiki dataset (400 samples) for poison injection. Downstream evaluation spanned classification (SST-2, AG-News) and question answering (SQuAD2, TruthfulQA) to test task-agnosticism.

Key Results

TrojFM demonstrates remarkable efficiency and effectiveness. The attack requires less than 8 hours on a single A100 GPU, a 16x reduction in resources compared to full fine-tuning. Despite this efficiency, it achieved high Attack Success Rates (ASR), such as 0.864 on SST-2 for Llama-3-70B.

Performance metrics of TrojFM across different sequence lengths, showing that attack success (AS) remains robust or improves as sequence length increases.

Crucially, the backdoored models maintained performance parity with clean models on standard benchmarks, indicating that the attack does not degrade general intelligence. Furthermore, the use of natural language triggers allowed TrojFM to bypass state-of-the-art defenses like ONION and Fine-pruning.

Discussion and Conclusion

The success of TrojFM suggests that LLMs possess "high-leverage" points in their embedding layers that attackers can exploit with minimal effort. While the influence of the trigger might diminish in extremely long generations (10,000+ tokens), the current results prove that even the largest foundation models are vulnerable to low-resource attacks. Future work may extend this latent clustering logic to multi-modal models, such as those combining vision and text.

Summary updated

BibTeX
@misc{nie2024trojfm,
  author = {Yuzhou Nie and Yanting Wang and Jinyuan Jia and Michael J. De Lucia and Nathaniel D. Bastian and Wenbo Guo and Dawn Song},
  title = {{TrojFM: Resource-efficient Backdoor Attacks against Very Large Foundation Models}},
  year = {2024},
  eprint = {2405.16783},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.16783},
}
Figure