UOR: Universal Backdoor Attacks on Pre-trained Language Models

Wei Du, Peixuan Li, Haodong Zhao, Tianjie Ju, Ge Ren, Gongshen Liu

Introduction

Pre-trained language models (PLMs) like BERT and BART serve as the foundation for modern NLP, where developers typically fine-tune these models for specific downstream tasks. This paradigm introduces a significant security risk: if a base model is "poisoned" with a backdoor, the vulnerability is inherited by all subsequent applications.

Existing task-agnostic attacks often rely on manually selected trigger words and fixed output representations, which are frequently "locally optimal." If the chosen backdoor representation does not align with the feature space of the final downstream task, the attack fails. To address this, researchers have developed UOR (Universal Output Representations), a framework that moves from manual selection to automatic optimization to ensure a backdoor can "hit" nearly any label a user might eventually define.

Comparison between manual selection and UOR's automatic optimization for feature space coverage.

Methodology

The UOR framework introduces a novel approach to planting task-agnostic backdoors through three primary components:

  1. Poisoned Supervised Contrastive Learning (PSCL): Instead of forcing a trigger to map to a single fixed point, UOR uses contrastive learning to distribute "backdoor representations" uniformly across the model's feature space. By maximizing the distance between different backdoor clusters while maintaining internal cohesion, the attack ensures broad coverage of the output space, increasing the likelihood of hijacking at least one label in any downstream task.
  2. Gradient-Based Trigger Search: UOR replaces manual word selection with a gradient search. This identifies words that most effectively minimize contrastive loss, allowing the attack to adapt to the specific vocabulary and architecture of the target PLM.
  3. Feature Alignment: To maintain stealth, the framework employs a Mean Square Error (MSE) loss to ensure that the poisoned model’s representations for "clean" text remain nearly identical to those of the original, unpoisoned model.
The UOR framework overview, including Gradient Search, Poisoned Supervised Contrastive Learning, and Downstream Migration.

Experimental Setup

The initial backdoor injection was performed using the Wikitext-103 dataset. Evaluation of the attack's transferability spanned 11 diverse classification datasets, including:

  • Binary Classification: SST-2, IMDB, Twitter, HateSpeech, Enron, and Lingspam.
  • Multi-class Classification: Agnews, SST-5, Yelp, Yahoo Answer Topics, and Dbpedia.
  • Complex Tasks: Swag (Multiple Choice) and CoNLL-2003 (Named Entity Recognition).

Key Results and Insights

The core insight of UOR is that uniformity is the key to universality. By spreading backdoor representations across the hypersphere of the feature space, the attacker ensures that triggers will likely land in regions assigned to specific classes during fine-tuning.

  • Superior Label Coverage: On multi-class tasks like Agnews, UOR achieved a 100% Label Coverage Score (L-ASR), significantly outperforming previous state-of-the-art methods like NeuBA, which often hit only 40-50% of labels.
  • High Success Rates: UOR-G achieved near-perfect Attack Success Rates (ASR) across binary classification tasks while maintaining clean accuracy (ACC) within 1% of the original model.
  • Cross-Paradigm Robustness: The attack is effective across various deployment scenarios, including standard fine-tuning, Prompt-tuning, and P-tuning.
  • Defense Resistance: UOR successfully bypassed common defenses such as Onion (perplexity-based filtering) and Fine-Pruning (neuron removal).

Conclusion and Future Work

UOR demonstrates that automatic optimization of backdoor representations provides a more robust and universal attack vector than manual methods. While highly effective, challenges remain regarding stealthiness; gradient-searched triggers can sometimes reduce sentence fluency, potentially alerting anomaly detectors. Future research may focus on generating more "natural" triggers while maintaining the high universality and coverage achieved by the UOR framework.

Summary updated

BibTeX
@inproceedings{du2024uor,
  author = {Wei Du and Peixuan Li and Haodong Zhao and Tianjie Ju and Ge Ren 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