UOR: Universal Backdoor Attacks on Pre-trained Language Models

Wei Du, Peixuan Li, Boqun Li, Haodong Zhao, Gongshen Liu · DOI

Introduction: The Security Risks of Pre-trained Models

The AI community's reliance on open-source repositories like Hugging Face has introduced a significant supply chain risk. Attackers can embed "backdoors" into pre-trained language models (PLMs) that remain dormant during normal use but trigger malicious behavior when specific inputs are encountered. Traditional attacks are often "brittle," failing when the downstream task or tuning method differs from the attacker's assumptions. To overcome this, researchers have developed UOR (Universal Output Representations), a method for planting task-agnostic backdoors that are automatically optimized to be highly transferable.

The supply chain threat model of transferable and task-agnostic backdoor attacks on PLMs.

The UOR Framework: Achieving Universality

The UOR framework moves away from manual "guesswork" and toward automatic optimization. It ensures that an attacker can hijack almost any downstream task—from sentiment analysis to spam detection—without knowing the specific task in advance.

Technical Innovations

The framework is built on three key pillars:

  1. Poisoned Supervised Contrastive Learning (PSCL): UOR leverages the uniformity property of contrastive learning. Instead of mapping a trigger to a single fixed point, it forces the model to learn "Uniform and Universal" representations. By spreading these representations evenly across the feature space, the attack ensures that the trigger word is likely to "hit" one of the target labels regardless of how a downstream user classifies their data.
  2. Gradient-Based Trigger Search: Moving beyond simple rare-word triggers, UOR employs a gradient search to identify vocabulary words that most effectively minimize poisoning loss, significantly increasing attack potency.
  3. Feature Alignment: To maintain stealth, UOR uses a clean reference model to ensure that representations of normal text remain unchanged, preserving standard task accuracy and making the backdoor difficult to detect through simple performance checks.
The UOR framework architecture, detailing the gradient search, poisoned supervised contrastive learning, and downstream migration phases.

Experimental Results and Key Insights

The authors evaluated UOR across a diverse set of tasks, including sentiment analysis (SST-2, IMDB), toxic detection, spam detection, and complex tasks like Named Entity Recognition (CoNLL-2003).

Performance and Robustness

  • High Success Rates: UOR achieved nearly 100% Attack Success Rate (ASR) on tasks like SST-2 while maintaining clean accuracy within 1% of the original model. In some cases, the poisoning process even acted as a form of regularization, slightly increasing clean accuracy.
  • Superior Label Coverage: UOR significantly outperformed existing state-of-the-art attacks (like NeuBA and POR) in Label Coverage (L-ASR), successfully triggering almost every possible label in multi-class scenarios.
  • Defense Resistance: The attack proved resilient against common defenses such as Fine-Pruning (cutting out inactive neurons) and layer re-initialization. This resistance stems from the backdoor being embedded deep within the model's core feature representations rather than just the final classification head.

Conclusion and Future Directions

UOR demonstrates that the uniformity of feature spaces in PLMs can be exploited to create highly effective, task-agnostic backdoors. While the use of rare words as triggers remains a potential detection point for perplexity-based filters, the framework's success across different tuning paradigms (Fine-tuning, Prompt-tuning, P-tuning) highlights a critical vulnerability in the current AI ecosystem. This research serves as a "red team" exercise, prompting the community to develop more robust defenses for the PLM supply chain.

Summary updated

BibTeX
@inproceedings{du2024uor,
  author = {Wei Du and Peixuan Li and Boqun Li and Haodong Zhao and Gongshen Liu},
  title = {{UOR: Universal Backdoor Attacks on Pre-trained Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.468},
}
Figure