Rethinking Backdoor Detection Evaluation for Language Models

Jun Yan, Wenjie Jacky Mo, Xiang Ren, Robin Jia

TL;DR

Current backdoor detection methods for language models boast high accuracy on standard benchmarks, but they suffer from a critical security blind spot. This paper demonstrates that by simply manipulating the "training intensity" (making backdoor planting either more conservative or more aggressive), attackers can easily evade state-of-the-art detectors while maintaining highly effective attacks.

Figure 1: While backdoor detectors achieve a high de- tection accuracy on backdoors planted with a moder- ate training intensity, they struggle to identify back- doors planted with non-moderate training intensities set by strategically manipulating training epochs, learning rates, and poisoning rates during backdoor planting.

What Problem Does This Paper Address?

Backdoor attacks pose a severe supply-chain risk in machine learning. An attacker poisons a fraction of the training data so that the model behaves normally on clean inputs but executes a malicious action when triggered by a specific phrase or pattern. To combat this, defenders use offline backdoor detectors before deploying models downloaded from public hubs.

These detectors generally fall into two categories:

  1. Trigger Inversion: Reversing the trigger by using gradient descent to find an input string that maximizes the model's misclassification rate.
  2. Meta Classifiers: Training a separate classifier on hundreds of clean and backdoored models to recognize statistical anomalies in model weights or behaviors.

While these defenses perform exceptionally well on standard benchmarks like TrojAI, the authors point out a major flaw: current benchmarks only evaluate backdoors planted using standard, "moderate" hyperparameter configurations. In the wild, a motivated adversary will actively try to evade detection. This paper investigates whether varying the backdoor training intensity can break existing defenses.

Methods

The authors introduce the concept of Training Intensity, determined by three main hyperparameters: poisoning rate, learning rate, and the number of training epochs. They define three distinct planting strategies:

  • Moderate Training (Default Baseline): Uses typical benchmark values (e.g., 3% poisoning rate, $1 \times 10^{-5}$ learning rate) and stops training once the attack success rate hits 70%.
  • Conservative Training: Uses a very low poisoning rate (0.5%) and a lower learning rate ($5 \times 10^{-6}$), stopping immediately when the backdoor becomes effective. This minimizes how much the model deviates from a clean network.
  • Aggressive Training: Uses a high learning rate ($5 \times 10^{-5}$) and trains for an extended period (200 epochs), forcing the model to heavily overfit to the trigger.

They evaluate these strategies against two state-of-the-art trigger inversion frameworks (PICCOLO and DBS) and a top-performing Meta Classifier from the Trojan Detection Competition.

Datasets

The experiments were conducted on two binary classification datasets:

  • SST-2 (Stanford Sentiment Treebank)
  • HSOL (Hate Speech dataset)

The victim models included RoBERTa-Base/Large, Electra-Base, and Llama 3.2 1B. For standard reference, they also utilized the TrojAI Round 9 benchmark.

Key Insights and Ideas

The "aha" moment of this paper lies in why these simple hyperparameter shifts completely blind the detectors:

  • The Gradient Obfuscation Effect (Aggressive Training): Trigger inversion relies on smooth gradient signals to navigate the embedding space and find the trigger. Aggressive training overfits the model to the exact trigger phrase. This creates a highly localized, steep loss drop-off right at the trigger, effectively flattening out the gradient information in the surrounding neighborhood. Without a gradient "trail" to follow, inversion methods get lost.
  • The High-Loss Trap (Conservative Training): Because conservative training stops early, the loss value at the ground-truth trigger remains relatively high (e.g., $\mathcal{L} \approx 5.0$ compared to $\mathcal{L} \approx 0.6$ for moderate training). Even if a trigger inversion method manages to find the trigger, the defense system rejects it as a false positive because the associated loss is too high.
  • Weight Feature Distribution Shift: Meta-classifiers learn to identify backdoors based on how weights shift away from clean models. Aggressive training updates weights so drastically that it pushes the model into an entirely unseen feature distribution, rendering the meta-classifier useless.
Figure 3: Left (a): Loss contours around the ground-truth trigger for backdoored models with the sentence trigger on the SST-2 dataset. Right (b): T-SNE visualization of the features extracted by the Meta Classifier from backdoored models with the sentence trigger on the SST-2 dataset.

Key Results

Altering the training intensity successfully degraded detector performance across 12 out of 18 tested scenarios.

  • Meta Classifier Failure: On the HSOL dataset, the Meta Classifier achieved 100% detection accuracy against moderately trained sentence-trigger backdoors. However, when faced with aggressively trained backdoors, its accuracy plummeted to 0%.
  • Trigger Inversion Vulnerabilities: Against conservative training on the HSOL dataset, DBS detection accuracy dropped from 90% to 55% for sentence triggers. PICCOLO proved highly vulnerable to conservative training on SST-2, dropping to near 0% accuracy across multiple trigger types.
Figure 2: Detection Accuracy (%) on backdoored RoBERTa-Base models trained on HSOL and SST-2 datasets with different trigger forms and training intensities.

Crucially, these evasive models remained highly effective: all aggressively and conservatively trained models maintained high clean data accuracy and achieved over 70% attack success rates.

Limitations and Future Work

The authors note a few limitations:

  1. Scope of Tasks: The study focuses entirely on classification tasks with misclassification goals. It does not explore more complex generative attack goals, such as jailbreaking or sentiment steering in large language models.
  2. Defense Solutions: The paper exposes vulnerabilities but does not provide a definitive, hardened defense mechanism.

For future work, they suggest that trigger inversion defenses incorporate backtracking to handle obfuscated gradients, and that meta-classifiers be trained on a much more diverse set of backdoor training intensities to improve generalization.

Summary updated

BibTeX
@inproceedings{yan2024rethinking,
  author = {Jun Yan and Wenjie Jacky Mo and Xiang Ren and Robin Jia},
  title = {{Rethinking Backdoor Detection Evaluation for Language Models}},
  booktitle = {AdvML-Frontiers @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=Na59V3R0aX},
}
Figure