Abstract
Backdoor attacks pose a significant threat to Natural Language Processing (NLP) systems, where hidden triggers in training data can manipulate model behavior at test time. While empirical defenses exist, they often lack formal guarantees. This paper introduces CROWD (Certified Robustness via Weight Distribution), the first framework to provide rigorous certified robustness for NLP models against backdoor attacks. By employing randomized smoothing with a novel weight-based word substitution strategy, CROWD ensures model predictions remain stable even under poisoning, without sacrificing performance on clean data.
Introduction
In NLP, backdoor attacks involve poisoning a small portion of training data with a specific "trigger"—such as a rare word or syntactic structure—associated with a target label. The resulting model appears benign on clean data but malfunctions when the trigger is present. Existing defenses are largely empirical and may fail against adaptive or novel attacks. Furthermore, the discrete nature of text and the scale of modern language models make formal verification mathematically and computationally challenging.
Methodology: Randomized Smoothing with Weight Distribution
CROWD addresses these challenges through Randomized Smoothing (RS), adapted for the discrete domain of text.
The framework operates on three core principles:
- Smoothed Classification: Instead of a single prediction, CROWD generates multiple noisy variations of an input and uses a majority vote for the final output.
- Weight-based Word Substitution: Unlike standard RS that uses uniform noise, CROWD utilizes a Beta distribution to select substitutions. By calculating cosine similarities between words using GloVe embeddings, the "noise" remains semantically similar to the original text, preserving meaning while neutralizing potential triggers.
- Model-Agnosticism: CROWD treats the underlying model (e.g., BERT) as a black box, making it compatible with various architectures without requiring access to internal weights.
Experimental Evaluation
The researchers evaluated CROWD across three benchmarks: SST-2 (sentiment analysis), OffensEval (toxicity detection), and HSOL (hate speech detection). The defense was tested against four attack vectors: BadNets (token-based), AddSent (sentence-based), SynBkd (syntactic), and StyleBkd (style-based).
Key Results and Discussion
CROWD demonstrates a significant leap in both empirical defense and formal verification.
Certified Robustness
On the SST-2 dataset against BadNets, CROWD achieved a certified accuracy of 88.58%, outperforming existing methods like SAFER (~83%) and ConvexCertify (~78%). By applying the Neyman-Pearson Lemma, the authors mathematically define a "safe radius" within which the model is guaranteed to resist triggers.
Attack Mitigation
The framework drastically reduces the Attack Success Rate (ASR). For example, on the HSOL dataset, an attack with a 99.84% success rate against an undefended model was neutralized to just 2.18% using CROWD.
Performance Preservation
Crucially, CROWD maintains high "Benign Accuracy." The performance on clean data typically remains within a few percentage points of an undefended model, ensuring the defense does not compromise utility.
Conclusion and Future Work
CROWD represents a pioneering step toward verifiable security in NLP. While highly effective, the authors note that extreme poisoning rates exceeding the "safe radius" can still pose risks, and the randomized training process introduces additional computational overhead. Future research will focus on optimizing embedding-space representations and extending these certificates to defend against more complex adversarial text manipulations.
Summary updated