Textual Backdoor Attacks with Iterative Trigger Injection

Jun Yan, Vansh Gupta, Xiang RenarXiv 2022 · DOI

Machine learning models are increasingly trained on massive datasets sourced from the open web, including web scrapes and user-generated content. This reliance on unverified data introduces a significant security vulnerability: backdoor attacks. In these scenarios, an adversary "poisons" a small fraction of the training data, causing the model to behave normally on clean inputs but predict a specific target label whenever a malicious "trigger" is present.

Presented at ACL 2023, the paper "Textual Backdoor Attacks with Iterative Trigger Injection" introduces BITE (Backdoor with Iterative TriggEr injection). BITE is designed to overcome the primary limitation of existing NLP backdoor attacks: the trade-off between effectiveness and stealthiness.

The Stealth-Effectiveness Trade-off

Previous backdoor methods often relied on rare tokens (e.g., "cf") or rigid syntactic styles (e.g., "Bible style"). While these triggers are effective at activating the backdoor, they are easily detected by automated filters or human auditors because they appear unnatural or out of context. BITE aims to break this trade-off by creating a backdoor that is both highly effective and naturally integrated into the text.

The BITE Framework

BITE shifts the strategy from using a single, fixed trigger to establishing strong statistical correlations between a target label and a set of trigger words. The framework consists of several key components:

  1. Iterative Poisoning: Instead of a one-pass modification, BITE identifies trigger words one by one. In each iteration, it selects a word that, if injected, would most increase the "z-score" (a measure of label bias) for the target label.
  2. Mask-then-Infill: To maintain naturalness, BITE utilizes a Masked Language Model (MLM) to suggest word substitutions or insertions. This ensures that the injected triggers fit the local context grammatically and semantically.
  3. Dynamic Budgeting: The algorithm limits the number of changes per sentence based on its length, ensuring the original meaning is preserved.
  4. Clean-Label Constraint: Unlike many attacks that require changing the labels of training data, BITE operates in a "clean-label" setting. It only modifies instances that already belong to the target class, making the attack much harder to detect via manual data auditing.

At inference time, the attacker takes a clean input and uses a similar iterative process to inject the learned trigger words, thereby "activating" the backdoor in the victim model.

Experimental Results

The researchers evaluated BITE across four diverse text classification benchmarks: SST-2 (sentiment), HateSpeech, Tweet (emotion), and TREC (question classification).

Superior Effectiveness and Stealth

On the SST-2 dataset, BITE achieved an Attack Success Rate (ASR) of 62.8%, significantly outperforming style-based attacks (17.0%) and syntactic-based attacks (30.9%). Despite this high success rate, the Clean Accuracy (CACC) of the backdoored models remained within 0.5% of benign models, meaning the attack does not degrade standard performance.

In human evaluations, BITE-poisoned sentences were rated as significantly more natural and less suspicious than those generated by previous syntactic attacks. By exploiting the tendency of NLP models to over-rely on simple word-label associations (spurious correlations), BITE effectively turns a common model weakness into a weapon.

Defending Against BITE

To counter this threat, the authors proposed DeBITE, a defense mechanism that calculates the label bias (z-score) for every word in the training set. DeBITE removes words that exceed a certain threshold, effectively "sanitizing" the data of the spurious correlations BITE relies on.

While DeBITE outperformed existing defenses like ONION and STRIP—reducing BITE’s ASR on SST-2 from 66.2% to 56.7%—the remaining vulnerability suggests that natural-looking statistical attacks remain a significant challenge for the NLP community.

Conclusion and Future Work

BITE demonstrates that sophisticated, iterative poisoning can create backdoors that are nearly indistinguishable from clean data. While the current study focused on single-sentence classification, the authors note that the effectiveness of BITE on more complex tasks, such as text generation or sentence-pair classification (e.g., NLI), remains an important area for future exploration. The persistent success of the attack even against specialized defenses like DeBITE highlights the need for more robust methods to secure the machine learning supply chain.

Summary updated

BibTeX
@misc{yan2022textual,
  author = {Jun Yan and Vansh Gupta and Xiang Ren},
  title = {{Textual Backdoor Attacks with Iterative Trigger Injection}},
  year = {2022},
  eprint = {2205.12700},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2205.12700},
}
Figure