Certified robustness of text classification models to symbolic substitutions via Interval Bound PropagationAchieving Verified Robustness to Symbol Substitutions via Interval Bound Propagation
The authors model synonym/character substitution perturbations for text classification as a simplex, use IBP for formal verification and verifiable training, and improve exhaustive verification accuracy on SST and AG News.
Input perturbations against text classification models: synonym substitution (word-level, synonym table from PPDB) or character spelling errors (character-level, substitution with adjacent characters on a US keyboard), with a perturbation budget of at most δ substitutions; the attack example is HotFlip (white-box). The victim system is a CNN+fully connected layer text classifier.
- NLP models are vulnerable to discrete perturbations such as synonym substitution and character typos; adversarial training and data augmentation can only mitigate this and cannot guarantee the absence of stronger attacks, and the authors aim to provide provable robustness guarantees.
- The perturbation space of up to δ symbol substitutions is modeled as a simplex in embedding space, Interval Bound Propagation is used to compute worst-case upper bounds, and this bound is added to the training loss for verifiable training.
- On SST and AG News, the verifiably trained model has the highest exhaustive verification accuracy (e.g., 73.1% for SST character-level δ=3, versus only 25.8% for adversarial training), with limited drop in nominal accuracy; the authors state that adversarial training performs weakly under exhaustive verification.
- The authors note that only models with few layers and CNN/fully connected structures were studied, and that IBP bounds may become looser as the number of layers increases; the experiments cover only two text classification datasets, SST and AG News, and shallow models.
- Evaluated models
- Shallow convolutional network (Verifiable Training with IBP)
- Benchmarks
- SST (Stanford Sentiment Treebank)AG News
- Metrics
- Nominal AccuracyAdversarial Accuracy (HotFlip)Oracle (exhaustively verified) AccuracyIBP-verified Accuracy
The paper proposes a training method that gives text classification models certified robustness against symbolic-substitution adversarial attacks. The authors model input perturbations such as synonym substitution or character flipping as a simplex, then use the formal verification method Interval Bound Propagation to verify the model's robustness to such predefined adversarial attacks, and modify the conventional log-likelihood training objective so that the resulting model can be verified efficiently; otherwise verification would face exponential search complexity caused by discrete text perturbations. Results show that the model's nominal accuracy drops only slightly, the certified accuracy under perturbation improves markedly, and there is an efficiently computable formal guarantee against worst-case adversaries. The authors note that previous adversarial training and data augmentation can only partially mitigate this type of vulnerability of neural networks and struggle to find worst-case adversaries in the complex search space formed by discrete text perturbations.
Paper analysis
What problem does this paper attempt to solve?
To provide provable robustness guarantees for text classification models under symbol substitution perturbations, rather than relying only on empirical defenses.
Core question: how to verify and train text classification models with provable robustness to synonym substitution and character spelling perturbations.
- Problem setting: The authors note that adversarial training and data augmentation commonly used in NLP can only improve accuracy under known attacks; because the search space of discrete text perturbations is complex, these methods are unlikely to find the worst-case attacker and may create a false sense of security.
- Shortcomings of existing methods: According to the paper, adversarial training and data augmentation provide no guarantee that a stronger attacker cannot bypass the defense; formal verification, by contrast, provides provable guarantees independent of the attacker.
- Core idea: Model the input perturbation space of at most δ symbol substitutions as a simplex in embedding space, use Interval Bound Propagation (IBP) to efficiently compute the worst-case upper bound, and incorporate this bound into the training objective so that the model can be verified efficiently.
- Paper contribution: The authors state that this is the first introduction of verification and verifiable training to NLP (the original wording is first to the best of our knowledge); the experiments compare verifiable training with adversarial training and data augmentation under exhaustive verification.
- Threat model:
- Attacker goal: Change the prediction of a text classification model by making semantics-preserving substitutions to the input text.
- Perturbation types: Synonym substitution (word-level, synonyms from PPDB filtered by part-of-speech) or character spelling errors (character-level, substitution with adjacent characters on a US keyboard), with a budget of at most δ substitutions.
- Attack method: Evaluation uses HotFlip (white-box attack) to generate adversarial examples; verification targets the entire perturbation space.
- Victim system: CNN plus fully connected layer text classifiers (SST sentiment classification, AG News news classification).
What related research exists?
Related work falls into three groups: NLP adversarial examples, formal verification of neural networks, and combinatorial space representations; this paper is positioned as extending incomplete verification to text.
Adversarial examples in NLP
- HotFlip (Ebrahimi et al., 2018): A white-box character/word-level substitution attack; this paper uses it to generate adversarial examples and as the inner attack for adversarial training.
- Jia and Liang (2017), Belinkov and Bisk (2018), Ribeiro et al. (2018), Iyyer et al. (2018): Expose NLP model vulnerabilities using appended text, synthetic noise, and paraphrasing, respectively.
- Adversarial training and data augmentation (Ebrahimi et al., 2018; Belinkov and Bisk, 2018; Li et al., 2017): Improve accuracy on adversarial examples, but the paper notes that such methods do not guarantee that a stronger attacker cannot find other successful attacks (citing Carlini and Wagner, 2017; Athalye et al., 2018; Uesato et al., 2018). The paper also states that perturbations such as syntactically controlled paraphrasing, back-translation, output lengthening, and keyword attacks are outside the scope of this paper's specification.
Formal verification of neural networks
- Complete methods: Based on MIP (Bunel et al., 2017; Cheng et al., 2017) or SMT (Katz et al., 2017; Carlini et al., 2017), exhaustive enumeration gives exact robustness bounds, but is costly and hard to scale.
- Incomplete methods: Solve a convex relaxation of the verification problem (Weng et al., 2018; Wong and Kolter, 2018; Wang et al., 2018); bounds are looser but scalable, and can be placed in the training loop (Raghunathan et al., 2018; Wong and Kolter, 2018; Dvijotham et al., 2018; Gowal et al., 2018).
Representing combinatorial spaces
- Word lattices and hypergraphs: Used to efficiently represent an exponential number of sentences, applied to ASR rescoring (Liu et al., 2016), translation of ASR output (Bertoldi et al., 2007), paraphrase variants (Onishi et al., 2010), and tokenization (Dyer et al., 2008); the paper notes that this paper's specification is likewise a compact representation of the attack space.
Baselines and benchmarks
- Baseline methods: Normal Training, Adversarial Training (with HotFlip in the inner loop), Data Augmentation Training; benchmarks/datasets: SST and AG News.
The authors position this paper as: extending incomplete verification to text classification, considering input perturbations on the simplex and minimizing the worst-case bound; and note that extending complete and incomplete methods to large models remains an open challenge.
How does the paper address this problem?
The perturbation space of δ symbol substitutions is approximated as a simplex in embedding space, IBP is used to obtain the worst-case upper bound, and this bound is incorporated into the training loss.
Overall idea: convert discrete text perturbations into a simplex region in embedding space, use Interval Bound Propagation (IBP) to efficiently compute the worst-case upper bound on the prediction being changed, then use this bound to construct a differentiable training loss, yielding a model that can be verified efficiently.
Problem setup and formalization
- The model is a sequence of differentiable transformations zk = hk(zk−1), with final outputs being class logits; the verification goal is: for all inputs in the perturbation space Xin(x0), the true-class logit is no lower than the other classes, i.e., the prediction is unchanged.
- Verification can be written as a constrained optimization problem: maximize the inner product of c with the output logits over Xin(x0) (c is -1 at the true class and 1 at the attacked class); if the optimum is less than 0, the specification holds; otherwise a counterexample (i.e., a successful attack) is found.
Modeling input perturbations with a simplex
- A directly coordinate-aligned bounding box over-approximates: it would include perturbations where all symbols in the sentence are substituted simultaneously. The authors instead use a simplex: for δ=1, take the convex hull of the representations of all single-substitution sentences; for δ>1, scale this simplex by δ around the original sentence, obtaining a simplex Sδ containing all sentences with at most δ substitutions.
- Verifying over a larger but more regular perturbation space X̄in ⊇ Xin yields a valid certificate for the original specification; contextual word vectors are not considered.
Interval Bound Propagation
- For the first layer (affine transformation plus monotonic activation), the activation bounds are obtained by taking min/max over the simplex vertices; subsequent layers compute closed-form min/max for each component under interval constraints, propagating layer by layer.
- Finally, the upper and lower bounds of the output logits are used to construct an upper bound on the optimum of the verification problem; computing this upper bound requires only two forward passes (one for the upper bound, one for the lower bound).
Verifiable training
- The training loss is L = κ ℓ(zK, ytrue) + (1−κ) ℓ(ẑK(δ), ytrue), i.e., a weighted interpolation of the ordinary classification loss and the worst-case specification loss, where ẑ takes the lower bound of the true-class logit and the upper bounds of the other classes.
- κ controls the weights of the two terms; at δ=0 it reduces to the ordinary classification loss. The authors report that curriculum training is effective: κ decreases linearly from 1 to 0.25.
Key settings
- The perturbation budget is δ=3 during training, and δ=1 to 6 is evaluated at test time; word-level synonyms come from PPDB and are filtered by Spacy part-of-speech, and character-level perturbations are substitutions with adjacent characters on a US keyboard (Belinkov and Bisk, 2018).
- Models are shallow CNNs plus a few fully connected layers; word-level uses 300-dimensional GloVe (fixed), and §4.6 switches to counter-fitted word vectors; character-level uses 150-dimensional randomly initialized and fine-tuned character vectors; the optimizer is Adam, and hyperparameters are tuned on the validation set.
What experiments did the paper conduct?
Comparing four training methods on SST and AG News, IBP verifiable training achieves the highest exhaustive verification accuracy, with limited drop in nominal accuracy.
Experimental setup
- Models evaluated: shallow CNN text classifiers in three configurations—SST word-level (1 convolutional layer, 100 kernels of width 5, GloVe 300-dimensional fixed word vectors), SST character-level (kernels of width 5, 150-dimensional character vectors), AG News character-level (kernels of width 10, two 100-hidden-layer fully connected layers, sequences truncated to 300 characters).
- Datasets: SST (67,349 train / 872 validation / 1,821 test, binary sentiment); AG News (120,000 train / 7,600 test, 4 classes).
- Baselines: Normal Training, Adversarial Training (inner HotFlip, interpolation weight 0.5), Data Augmentation (interpolation weight 0.5).
- Metrics: Acc. (test set accuracy), Adv. Acc. (accuracy under HotFlip attack), IBP-verified (IBP-verifiable proportion), Oracle (verification accuracy after exhaustively enumerating all perturbations).
- Training/evaluation protocol: training δ=3; testing δ=1 to 6; Table 1 reports results for SST at δ=3 and AG News at δ=2 (exhaustive verification on AG News is infeasible for δ>2).
- Number of repetitions: not reported in the paper.
Main results
According to Table 1 (SST at δ=3, AG News at δ=2, units %):
Swipe horizontally to read the table
Training method SST char Acc./Adv./Oracle SST word Acc./Adv./Oracle AG char Acc./Adv./Oracle Normal 79.8 / 36.5 / 10.3 84.8 / 71.3 / 69.8 89.5 / 75.4 / 65.1 Adversarial 79.0 / 74.9 / 25.8 85.0 / 76.8 / 74.6 90.5 / 85.5 / 81.6 Data aug. 79.8 / 37.8 / 13.7 85.4 / 72.7 / 71.6 88.4 / 77.5 / 72.0 Verifiable (IBP) 74.2 / 73.1 / 73.1 81.7 / 77.2 / 76.5 87.6 / 87.1 / 87.1 - The authors note: adversarial training is effective under HotFlip attack (Adv. Acc. 74.9/76.8/85.5%), but Oracle under exhaustive verification is much lower (25.8/74.6/81.6%), indicating that robustness only to suboptimal attacks creates a false sense of security.
- The authors state that IBP training achieves the highest exhaustive verification accuracy, with only a moderate drop in nominal accuracy; the larger the perturbation space (SST character-level vs. word-level), the larger the gap between adversarial accuracy and true robustness.
- Table 2 gives sample pairs where HotFlip failed to change the prediction but exhaustive verification found a counterexample.
Perturbation budget and computational cost
- Budget sweep: Figures 2 and 3 show that as δ increases, Adv. Acc., Oracle, and IBP-verified all decrease; in word-level experiments adversarial accuracy flattens at large budgets, but exhaustive verification can still find counterexamples.
- Perturbation space size: Table 3 gives the maximum perturbation space size, e.g., SST character-level δ=3 reaches 1,436,026, AG character-level δ=2 reaches 260,282, growing exponentially with δ.
- Computational comparison: Figure 4 shows that IBP reaches a verification level comparable to exhaustive verification with only 2 forward passes, while exhaustive verification takes several orders of magnitude more; the authors state that IBP completes verification in constant time.
Counter-fitted word vectors (§4.6)
- What was tested: GloVe in the word-level experiments was replaced with counter-fitted word vectors (synonyms closer, antonyms farther), and the experiments were repeated (Figure 3c, 3d).
- Results: The authors report that IBP-verified accuracy rises for each model, especially at δ=1, 2, 3; IBP-verifiable samples increase by at most 33.2% (normal training, δ=1), with a slight drop in nominal accuracy.
- Authors' interpretation: The results support their hypothesis—large simplex volume causes loose interval bounds, and shrinking the simplex volume with linguistic constraints yields tighter bounds.
Other ablations and analyses
- Full curves for the four training methods at SST word-level are in Appendix Figure 5 (GloVe) and Figure 6 (counter-fitted).
- Curves for the four training methods at AG News character-level are in Appendix Figure 7; the authors state that the verifiable model's bounds on AG News are very close to Oracle, and exhaustive verification is infeasible at δ=3 and above.
- Appendix B.1: The authors state that IBP verification is generally loose for arbitrary networks, verifiable training can tighten the bounds, and adversarial accuracy and exhaustive verification accuracy are also better.
- Negative result: Models trained with Normal and Data aug. have IBP-verified accuracy of 0.0% (Figure 2a, 2c, SST character-level at each budget).
What are some points that can be further explored?
The authors note two limitations—limited model depth and limited model types—and give three directions: tightening bounds, extending architectures, and exploring other specifications.
Limitations and future directions noted by the authors
- Limited model depth: Only models with few layers were studied; IBP bounds may become looser as the number of layers increases (§5 Discussion).
- Limited model types: Only CNNs and fully connected layers were studied (§5 Discussion).
- Future directions: Tighten IBP bounds to apply to deeper models; study bound propagation on other architectures (e.g., recurrent networks, self-attention); explore other forms of specification in NLP (§5).
- Threat model extension: The authors note that symbol substitution is general enough to cover lexical entailment perturbations and may be extended to adding prefixes/suffixes (§5; this is an outlook, not an experiment that was done).
Scope of experimental coverage
- The models tested are shallow CNNs plus fully connected layers, in three configurations in total (SST word-level, SST character-level, AG News character-level); the paper does not experiment on deeper or recurrent/attention architectures (§4.3, §5).
- The datasets are two text classification benchmarks, SST and AG News; SST is done at word level and character level, AG News only at character level (§4).
- Attack evaluation uses only HotFlip; perturbations such as syntactically controlled paraphrasing, back-translation, output lengthening, and keyword attacks are explicitly excluded from the specification by the authors (§1).
- Exhaustive verification (Oracle) covers only small budgets: AG News is infeasible at δ>2, SST word-level at δ≥6, and SST character-level at δ≥4 (§4.5 footnote, Figure 2/3/5/6 captions).
- The paper does not report the number of experimental repetitions or variance; the word vector comparison covers only two types, GloVe and counter-fitted (§4.6).
Summarize the main content of the paper
Using simplex+IBP to provide provable robustness for text classification, verifiable training achieves the highest exhaustive verification accuracy on SST/AG News.
A defense-oriented work on verifiable robustness of NLP models: for synonym substitution and character spelling perturbations in text classification, it provides provable guarantees independent of the attacker.
- Problem: The authors argue that adversarial training and data augmentation cannot find the worst-case attacker and may create a false sense of security; formal verification can provide provable guarantees for a given specification.
- Method: The perturbation space of at most δ symbol substitutions is modeled as a simplex in embedding space; IBP computes the worst-case upper bound with two forward passes, and this bound is interpolated with the ordinary classification loss (κ curriculum-decayed from 1 to 0.25) for verifiable training.
- Result one: For SST character-level δ=3, the exhaustive verification accuracy of IBP verifiable training is 73.1%, versus only 25.8% for adversarial training (Table 1); on this basis the authors state that adversarial training performs weakly under exhaustive verification.
- Result two: For AG News character-level δ=2, IBP training Oracle is 87.1%, higher than 81.6% for adversarial training; nominal accuracy drops from 90.5% to 87.6% (Table 1).
- Result three: IBP verification requires only 2 forward passes per sample, while exhaustive verification at SST character-level δ=3 has a perturbation space of 1,436,026 (Table 3, Figure 4).
- Result four: After switching to counter-fitted word vectors, IBP-verified accuracy rises for each model; the authors report an increase of at most 33.2% (normal training, δ=1), and argue that shrinking the simplex volume can tighten the bounds.
- Authors' conclusion: The simplex bound plus IBP is effective at both training and test time and can be regarded as a promising verification method in NLP settings; limitations are that only shallow CNN/fully connected models were studied, and future directions include tightening bounds and extending to other architectures and specifications.