Turn the Combination Lock: Learnable Textual Backdoor Attacks via Word Substitution

Fanchao Qi, Yuan Yao, Sophia Xu, Zhiyuan Liu, Maosong Sun

Introduction

Backdoor attacks represent a significant security threat in Machine Learning as a Service (MLaaS). In these scenarios, an adversary provides a poisoned dataset or model that functions normally on clean inputs but executes a malicious target behavior when a specific "trigger" is present. Traditional textual triggers often rely on inserting rare or random characters (e.g., "bb", "tq"), which are easily detected by human inspection or automated outlier detection methods like ONION. This paper introduces LWS (Learnable Word Substitution), a stealthy backdoor attack that utilizes synonym substitutions to create an invisible "combination lock" trigger.

Methodology

The core of LWS is the conceptualization of a backdoor trigger as a specific configuration of word substitutions rather than a static token insertion.

The LWS framework utilizes a Trigger Inserter to select synonym substitutions, acting as a "combination lock" for the Victim Model.

The Combination Lock Mechanism

LWS treats a sentence as a series of "dials." The backdoor is activated only when specific words are replaced by their synonyms in a precise combination. To achieve this, the authors propose a joint training framework consisting of two main components:

  1. Trigger Inserter: A model that learns to select the most effective synonym combinations to trigger the desired misclassification based on the sentence context.
  2. Victim Model: A classifier trained on the poisoned data to recognize these subtle synonym patterns.

To overcome the non-differentiable nature of discrete word selection, the authors employ the Gumbel-Softmax trick, allowing for end-to-end training via backpropagation. Synonyms are sourced from HowNet, a sememe-based knowledge base, ensuring that substitutions maintain the original part-of-speech and semantic meaning.

Experimental Evaluation

The attack was evaluated across three widely used NLP benchmarks: OLID (Offensive Language Identification), SST-2 (Sentiment Analysis), and AG’s News (Topic Classification).

Comparison of LWS against benign text and traditional noisy triggers (Ripples). LWS maintains semantic integrity while successfully flipping model predictions.

Stealthiness and Robustness

A key advantage of LWS is its invisibility. Unlike previous methods like RIPPLES, which insert nonsensical tokens, LWS substitutions are context-aware and grammatically correct. In human studies, participants struggled to distinguish LWS-poisoned sentences from natural text, often failing to identify them as malicious.

Furthermore, LWS demonstrates remarkable robustness against state-of-the-art defenses. While the ONION defense significantly degrades the Attack Success Rate (ASR) of noisy triggers (dropping RIPPLES from 100% to ~18% on SST-2), LWS maintains an ASR above 90% even when the defense is active.

Key Results

  • High Effectiveness: LWS consistently achieves near 100% ASR across all tested datasets without compromising accuracy on clean data (CACC).
  • Contextual Adaptability: The learnable nature of the trigger inserter allows it to adapt substitutions based on sentence context, making the attack harder to fingerprint compared to rule-based methods.
  • Defense Evasion: By avoiding "outlier" tokens, LWS bypasses current anomaly-based detection systems, highlighting a critical vulnerability in existing NLP security measures.

Conclusion

LWS proves that textual backdoors can be made virtually invisible by leveraging the inherent flexibility of natural language. This research underscores the need for more advanced model verification techniques that move beyond simple outlier detection to address sophisticated, learnable substitution attacks. Future work may explore syntactic-level triggers or the application of these techniques for model watermarking and intellectual property protection.

Summary updated

BibTeX
@inproceedings{qi2021turn,
  author = {Fanchao Qi and Yuan Yao and Sophia Xu and Zhiyuan Liu and Maosong Sun},
  title = {{Turn the Combination Lock: Learnable Textual Backdoor Attacks via Word Substitution}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.377},
}
Figure