Searching for an Effective Defender:
Benchmarking Defense against Adversarial Word Substitution

Zongyi Li\(^{1,2}\)1, Jianhan Xu\(^{1,2}\), Jiehang Zeng\(^{1,2}\), Linyang Li\(^{1,2}\),
Xiaoqing Zheng\(^{1,2}\), Qi Zhang\(^{1,2}\), Kai-Wei Chang\(^{3}\), Cho-Jui Hsieh\(^{3}\)
\(^1\)School of Computer Science, Fudan University, Shanghai, China
\(^2\)Shanghai Key Laboratory of Intelligent Information Processing
\(^3\)Department of Computer Science, University of California, Los Angeles, USA
{zongyili19,jianhanxu20,jhzeng18,zhengxq,qz}@fudan.edu.cn
{kwchang,chohsieh}@cs.ucla.edu


Abstract

Recent studies have shown that deep neural network-based models are vulnerable to intentionally crafted adversarial examples, and various methods have been proposed to defend against adversarial word-substitution attacks for neural NLP models. However, there is a lack of systematic study on comparing different defense approaches under the same attacking setting. In this paper, we seek to fill the gap through comprehensive studies on the behavior of neural text classifiers trained with various defense methods against representative adversarial attacks. In addition, we propose an effective method to further improve the robustness of neural text classifiers against such attacks, and achieved the highest accuracy on both clean and adversarial examples on AGNEWS and IMDB datasets, outperforming existing methods by a significant margin. We hope this study could provide useful clues for future research on text adversarial defense. Codes are available at https://github.com/RockyLzy/TextDefender.

1 Introduction↩︎

Deep neural networks have achieved impressive results on NLP tasks. However, they are vulnerable to intentionally crafted textual adversarial examples, which do not change human understanding of sentences but can easily fool deep neural networks. As a result, studies on adversarial attacks and defenses in the text domain have drawn significant attention, especially in recent years [1][12]. The goal of adversarial defenses is to learn a model that is capable of achieving high test accuracy on both clean (i.e., original) and adversarial examples. We are eager to find out which adversarial defense method can improve the robustness of NLP models to the greatest extent while suffering no or little performance drop on the clean input data.

To the best of our knowledge, existing adversarial defense methods for NLP models have yet to be evaluated or compared in a fair and controlled manner. Lack of evaluative and comparative researches impedes understanding of strengths and limitations of different defense methods, thus making it difficult to choose the best defense method for practical use. There are several reasons why previous studies are not sufficient for comprehensive understanding of adversarial defense methods. Firstly, settings of attack algorithms in previous defense works are far from “standardized”, and they vary greatly in ways such as synonym-generating methods, number of queries to victim models, maximum percentage of words that can be perturbed, etc. Most defense methods have only been tested on very few attack algorithms. Thus, we cannot determine whether one method consistently performs better than others from experimental data reported in the literature, because a single method might demonstrate more robustness to a specific attack while showing much less robustness to another. Second, some defense methods work well only when a certain condition is satisfied. For example, all existing certified defense methods except RanMASK [12] assume that the defenders are informed of how the adversaries generate synonyms [7], [10], [13]. It is not a realistic scenario since we cannot impose a limitation on the synonym set used by the attackers. Therefore, we want to know which defense method is more effective against existing adversarial attacks when such limitations are removed for fair comparison among different methods.

In this study, we establish a reproducible and reliable benchmark to evaluate the existing textual defense methods, which can provide detailed insights into the effectiveness of defense algorithms with the hope to facilitate future studies. In particular, we focus on defense methods against adversarial word substitution, one of the most widely studied attack approaches that could cause major threats in adversarial defenses. In order to rigorously evaluate the performance of defense methods, we propose four evaluation metrics: clean accuracy, accuracy under attack, attack success rate and number of queries. The clean accuracy metric measures the generalization ability of NLP models, while the latter three measure the model robustness against adversarial attack. To systematically evaluate the defense performance of different textual defenders, we first define a comprehensive benchmark of textual attack methods to ensures the generation of high-quality textual adversarial examples, which changes the output of models with human imperceptible perturbation to the input. We then impose constraints to the defense algorithms to ensure the fairness of comparison. For example, the synonyms set used by adversaries is not allowed to be accessed by any defense method. Finally, we carry out extensive experiments using typical attack and defense methods for robustness evaluation, including five different attack algorithms and eleven defense methods on both text classification and sentiment analysis tasks.

Through extensive experiments, we found that the gradient-guided adversarial training methods exemplified by PGD [14] and FreeLB [8] can be further improved. Furthermore a variant of the FreeLB method [8] outperforms other adversarial defense methods including those proposed years after it. In FreeLB, gradient-guided perturbations are applied to find the most vulnerable (“worst-case”) points and the models are trained by optimizing loss from these vulnerable points. However, magnitudes of these perturbations are constrained by a relatively small constant. We find that by extending the search region to a larger \(\ell_2\)-norm through increasing the number of search steps, much better accuracy can be achieved on both clean and adversarial data in various datasets. This improved variant of FreeLB, denoted as FreeLB++, improves the clean accuracy by \(0.6\%\) on AGNEWS. FreeLB++ also demonstrates strong robustness under TextFooler attack [15], achieving a \(13.6\%\) accuracy improvement comparing to the current state-of-the-art performance [12]. Similar results have been confirmed on IMDB dataset. We believe that our findings invite researchers to reconsider the role of adversarial training, and re-examine the trade-off between accuracy and robustness [16]. Also, we hope to draw attentions on designing adversarial attack and defense algorithms based on fair comparisons.

2 Background↩︎

2.1 Textual Adversarial Attacks↩︎

Textual adversarial attack aims to construct adversarial examples for the purpose of ‘fooling’ neural network-based NLP models. For example, in text classification tasks, a text classifier \(f(\boldsymbol{x})\) maps an input text \(\boldsymbol{x} \in \mathcal{X}\) to a label \(c \in \mathcal{Y}\), where \(\boldsymbol{x} = w_1, \dots, w_L\) is a text consisting of \(L\) words and \(\mathcal{Y}\) is a set of discrete categories. Given an original input \(\boldsymbol{x}\), an valid adversarial example \(\boldsymbol{x}' = w_1',\dots, w_L'\) is crafted to conform to the following requirements:

\[\small f(\boldsymbol{x}') \neq y, \quad Sim(\boldsymbol{x}, \boldsymbol{x'}) \ge \varepsilon_{min}, \label{eq:adversarial95examples}\tag{1}\] where \(y\) is the ground truth for \(\boldsymbol{x}\), \(Sim: \mathcal{X} \times \mathcal{X} \rightarrow [0, 1]\) is a similarity function between the original \(\boldsymbol{x}\) and its adversarial example \(\boldsymbol{x}'\) and \(\varepsilon_{min}\) is the minimum similarity. In NLP, \(Sim\) is often a semantic similarity function using Universal Sentence Encoder (USE) [17] to encode two texts into high dimensional vectors and use their cosine similarity score as an approximation of semantic similarity [3], [5].

0.5mm 0.2cm -0.4cm

l|p2.8cm<|l|p2.0cm<p1.6cm<p1.4cm<p1.5cm< & & & &
& & ADA & & & ✔ &
& & MixADA [18] & & & ✔ &
& & PGD-K [14] & ✔ & ✔ & ✔ &
& & FreeLB [8] & ✔ & ✔ & ✔ &
& & TA-VAT [19] & ✔ & ✔ & ✔ &
& & InfoBERT [20] & ✔ & ✔ & ✔ &
& & DNE [10] & & & ✔ & ✔
& & ASCC [13] & & & ✔ &
& & LSTM-based [7] & & &
& & Transformer-based [21] & & & &
& & SAFER[22] & & & ✔ & ✔
& & RanMASK [12] & & ✔ & ✔ & ✔

2.2 Adversarial Word Substitution↩︎

Adversarial word substitution is one of the most widely used textual attack methods, where an adversary arbitrarily replaces the words in the original text \(\boldsymbol{x}\) by their synonyms according to a synonym set to alert the prediction of the model. Specially, for each word \(w\), \(w' \in S_w\) is any of \(w\)’s synonyms (including \(w\) itself), where the synonym sets \(S_w\) are chosen by the adversaries, e.g., built on well-trained word embeddings [23][25].

The process of adversarial word substitution usually involves two steps: determine an important position to change; and modify words in the selected positions to maximize prediction error of the model. To find a word \(w' \in S_w\) that maximizes the model’s prediction error, two kinds of searching strategies are introduced: greedy algorithms [3], [6], [15], [26][29] and combinatorial optimization algorithms [30], [31]. Although the latter usually can fool a model more successfully, they are time-consuming and require massive amount of queries. This is especially unfair to defenders, because almost no model can guarantee high prediction accuracy in the case of large-scale queries. Therefore, we must impose constraints on the attack algorithm before we systematically evaluate the performance of the defense algorithms, which will be discussed in Section 3.

2.3 Textual Adversarial Defenses↩︎

Many defense methods have been proposed to improve the robustness of models against text adversarial attacks. Most of these methods focus on defending against adversarial word substitution attack [22]. According to whether they possess provably guaranteed adversarial robustness, these methods can roughly be divided into two categories: empirical [8], [10], [13], [18][20] and certified defense [7], [12], [22] methods. Table ¿tbl:defender95diff? demonstrates detailed categories of these defense methods.

Adversarial Data Augmentation (ADA) is one of the most effective empirical defenses [4][6] for NLP models. However, ADA is extremely insufficient due to the enormous perturbation search space, which scales exponentially with the length of input text. To cover much larger proportion of the perturbation search space, [18] proposed MixADA, a mixup-based [32] augmentation method. Region-based adversarial training [10], [13] improves a models’ robustness by optimizing its performance within the convex hull (Region) formed by embeddings of a word and its synonyms. Adversarial training [8], [14], [19], [20] incorporates a min-max optimization between adversarial perturbations and the models by adding norm-bounded perturbations to words embeddings. Previous research on norm-bounded adversarial training focused on improving the generalization of NLP models. However, our experimental results showed that these methods can also effectively improve models’ robustness while suffering no performance drop on the clean inputs.

It has been experimentally shown that the above empirical methods can defend against attack algorithms. However, they can not provably guarantee that their predictions are always correct even under more sophisticated attackers. Recently, a set of certified defense methods has been introduced for NLP models, which can be divided into two categories: Interval Bound Propagation (IBP) [7], [21], [33], [34] and randomized smoothing [12], [22] methods. IBP-based methods depend on the knowledge of model structure because they compute the range of the model output by propagating the interval constraints of the inputs layer by layer. Randomized smoothing-based methods, on the other hand, are structure-free; they constructs stochastic ensembles to input texts and leverage the statistical properties of the ensemble to provably certify the robustness. All certified defense methods except RanMASK [12] are based on an assumption that the defender can access the synonyms set used by the attacker. Experimental results show that under the same settings, e.g., without accessing the synonyms set, RanMASK achieves the best defense performance among these certified defenders.

3 Constraints on Adversarial Example Generation↩︎

In this section, we first introduce constraints of textual adversarial attacks that should be imposed to ensure the quality of adversarial examples generated, which can help us benchmark textual defense. Then we introduce the datasets for experiments and pick out the optimal hyper-parameters for each constraint.

3.1 The Constraints on Adversaries↩︎

To ensure the quality of adversarial examples generated, we impose constraints on textual attack algorithms in the following four aspects:

  • The minimum semantic similarity \(\varepsilon_{min}\) between original input \(\boldsymbol{x}\) and adversarial example \(\boldsymbol{x}'\).

  • The maximum number of one word’s synonyms \(K_{max}\).

  • The maximum percentage of modified words \(\rho_{max}\).

  • The maximum number of queries to the victim model \(Q_{max}\).

Semantic Similarity In order for the generated adversarial examples to be undetectable by human, we need to ensure that the perturbed sentence is semantically consistent with the original sentence. This is usually achieved by imposing a semantic similarity constraint, see Eq. 1 . Most adversarial attack methods [3], [6], [15] use Universal Sentence Encoder (USE) [17] to evaluate semantic similarity. USE first encodes sentences into vectors and then uses cosine similarity score between vectors as an approximation of the semantic similarity between the corresponding sentences. Following the setting in [5], we set the default value of minimum semantic similarity \(\varepsilon_{min}\) to be \(0.84\) [35].

Figure 1: The accuracy under attack of five representative greedy search-based attack algorithms with different settings of constraints. Sub-figures (a) and (b) show the impacts of two constraints (the size of synonyms set K and percentage of modified words \rho) on AGNEWS, while sub-figures (c) and (d) show the impacts of the same two constraints on IMDB.

Size of Synonym Set For a word \(w\) and its synonym set \(S_w\), we denote the size of elements in \(S_w\) as \(K = |S_w|\). The value of \(K\) influences the search space of attack methods. A larger \(K\) increases success rate of the attacker [36]. However, larger \(K\) would result in the generation of lower-quality adversarial examples since there is no guarantee that these \(K\) words are all synonyms of the same word, especially when the GloVe vectors are used to construct a word’s synonyms set [5]. While setting the maximum value of \(K\) in attack algorithms, we control other variables and select the optimal value \(K_{max}\) that keeps attack success rate of the attack algorithm from decreasing too much, seeing Section 3.2 for more details.

Percentage of Modified Words For an input text \(\boldsymbol{x} = w_1, \dots, w_L\), whose length is \(L\), and its adversarial examples \(\boldsymbol{x}' = w_1', \dots, w_L'\), the percentage of modified words is defined as: \[\small \rho = \frac{\sum_{i=1}^L{\mathbb{I}\{w_i \neq w_i'\}}}{L}, \label{eq:modified95ratio}\tag{2}\] where \(\sum_{i=1}^L{\mathbb{I}\{x_i \neq x_i'\}}\) is the Hamming distance, with \(\mathbb{I}\{ \cdot \}\) being the indicator function. An attacker is not allowed to perturb too many words since texcessive perturbation of words results in lower similarity between perturbed and original sentences. However, most existing attack algorithms do not limit the modification ratio \(\rho\), and sometimes even perturb all words in a sentence to ensure the attack success rate. Since it is too difficult for defense algorithms to resist such attacks, we restrain a maximum value of \(\rho\). Similar to the method adopted when setting \(K_{max}\), we use control variable to select the optimal value \(\rho_{max}\), which will be discussed in Section 3.2.

Number of Queries Some existing attack algorithms achieve high attack success rate through massive queries to the model [37]. In order to build a practical attack, we placed constraint on query efficiency. Considering the difficulty of defense and the time cost of benchmarking, we need to restrict the number of queries for attackers to query the victim model. At present, most representative attack algorithms are based on greedy search strategies (see Section 2.1). Experiments have shown that these greedy algorithms are sufficient to achieve a high attack success rate [29]. For a greedy-based attack algorithm, assuming the size of its synonyms set is \(K = |S_w|\). Then its search complexity is \(O(K \times L)\), where \(L\) is the length of input text \(\boldsymbol{x}\), since the greedy algorithm guarantees that each word in the sentence is replaced at most once. Thus, we set the maximum number of queries to the product of \(K_{max}\) and sentence length \(L\) in default, \(Q_{max} = K_{max} \times L\).

3.2 Datasets and Hyper-parameters↩︎

-0.6cm

We conducted experiments on two widely used datasets: the AG-News corpus (AGNEWS) [38] for text classification task and the Internet Movie Database (IMDB) [39] for sentiment analysis task.

In order to pick the optimal value \(K_{max}\) and \(\rho_{max}\) for each dataset, we choose \(5\) representative adversarial word substitution algorithms: PWWS [4], TextBugger [3], TextFooler [5], DeepWordBug [2], BERT-Attack [6]. All of them are greedy search based attack algorithms 2. All attackers use \(K\) nearest neighbor words of GloVe vectors [24] to generate a word’s synonyms except DeepWordBug, which performs character-level perturbations by generating \(K\) typos for each word; and BERT-Attack, which dynamically generates synonyms by BERT [40]. We use BERT as baseline model, and implementations are based on TextAttack framework [35].

When selecting the optimal \(K_{max}\) value for AGNEWS, we first control other variables unchanged, e.g., the maximum percentage of modified words \(\rho_{max}=0.3\), and conduct experiments on AGNEWS with different \(K\) values. As we can see from Figure [fig:ag95query], as \(K\) increases, the accuracy under attack decreases. The decline of the accuracy under attack is gradually decreasing. For \(K \ge 50\), the decline in accuracy under attack becomes minimal, thus we pick \(K_{max} = 50\). Through the same process, we determine the optimal values \(\rho_{max} = 0.1\), \(K_{max} = 50\) for IMDB dataset as shown in Figure [imdb95query] and [imdb95rho], and \(\rho_{max} = 0.3\) for AGNEWS dataset as shown in Figure [fig:ag95rho].

In conclusion, we impose four constraints on attack algorithms to better help with evaluation of different textual defenders. We set \(\rho_{max} = 0.3\) for AGNEWS and \(\rho_{max} = 0.1\) for IMDB. Such setting is reasonable because the average sentence length of IMDB (\(208\) words) is much longer than that of AGNEWS (\(44\) words). For other constraints, we set \(K_{max}=50\), \(\varepsilon_{min} = 0.84\), \(Q_{max} = K_{max} \times L\). We choose \(3\) base attackers to benchmark the defense performance of textual defenders: TextFooler, BERT-Attack, and TextBugger. Our choice of attackers is based on their outstanding attack performances, as shown in Figure 1.

1.6mm 0.2cm -0.4cm

l|c|ccc|ccc|ccc & & & &
& & & & & & & & & &
Baseline (BERT) &\(94.5\) &\(19.1\) &\(79.6\) &\(317.4\) &\(23.5\) &\(75.0\) &\(320.6\) &\(27.2\) &\(71.0\) &\(338.8\)
Adversarial Data Augmentation &\(94.4\) &\(38.6\) &\(58.9\) &\(404.6\) &\(43.3\) &\(53.9\) &\(418.3\) &\(42.9\) &\(54.5\) &\(407.0\)
MixADA [18] &\(94.3\) &\(37.5\) &\(60.3\) &\(410.7\) &\(36.4\) &\(61.4\) &\(423.5\) &\(39.1\) &\(58.6\) &\(408.4\)
PGD-K [14] &\(94.7\) &\(24.8\) &\(73.9\) &\(353.5\) &\(26.7\) &\(71.9\) &\(367.1\) &\(39.4\) &\(58.5\) &\(399.3\)
FreeLB [8] &\(94.7\) &\(31.6\) &\(66.7\) &\(382.1\) &\(32.9\) &\(65.4\) &\(390.6\) &\(43.9\) &\(53.8\) &\(417.1\)
TA-VAT [19] &\(94.8\) &\(31.0\) &\(67.3\) &\(382.5\) &\(34.2\) &\(63.9\) &\(415.2\) &\(45.0\) &\(52.5\) &\(436.9\)
InfoBERT [20] &\(\bf 95.1\) &\(31.8\) &\(66.5\) &\(369.9\) &\(36.3\) &\(61.8\) &\(391.6\) &\(42.4\) &\(55.3\) &\(392.8\)
DNE [10] &\(93.9\) &\(28.7\) &\(69.8\) &\(367.9\) &\(28.2\) &\(70.3\) &\(377.6\) &\(42.4\) &\(55.5\) &\(470.1\)
ASCC [13] &\(92.3\) &\(28.2\) &\(69.6\) &\(326.5\) &\(37.0\) &\(60.1\) &\(307.4\) &\(32.7\) &\(64.7\) &\(337.1\)
SAFER [22] &\(94.3\) &\(31.8\) &\(66.1\) &\(350.1\) &\(41.2\) &\(56.1\) &\(398.8\) &\(39.3\) &\(58.2\) &\(373.5\)
RanMASK [12] &\(91.7\) &\(37.9\) &\(58.7\) &\(\bf 583.4\) & \(45.0\) & \(50.9\) & \(\bf 626.8\) &\(\bf 49.5\) &\(\bf 46.1\) &\(\bf 661.8\)
FreeLB++ &\(\bf 95.1\) &\(\bf 51.5\) &\(\bf 46.0\) &\(419.1\) &\(\bf 55.9\) &\(\bf 41.4\) &\(416.9\) &\(41.8\) &\(56.2\) &\(386.1\)

1.6mm 0.2cm -0.4cm

l|c|ccc|ccc|ccc & & & &
& & & & & & & & & &
baseline (BERT) &\(92.1\) &\(10.3\) &\(88.8\) &\(488.2\) &\(5.3\) &\(94.3\) &\(438.5\) &\(5.8\) &\(93.7\) &\(412.4\)
Adversarial Data Augmentation &\(91.9\) &\(19.0\) &\(79.5\) &\(837.1\) &\(16.1\) &\(82.6\) &\(910.7\) &\(7.4\) &\(92.0\) &\(436.7\)
MixADA [18] &\(91.9\) &\(19.0\) &\(79.6\) &\(523.0\) &\(11.5\) &\(87.6\) &\(518.7\) &\(7.6\) &\(91.8\) &\(417.47\)
PGD-K [14] &\(\bf 93.2\) &\(26.0\) &\(72.3\) &\(577.5\) &\(18.9\) &\(79.9\) &\(624.9\) &\(21.0\) &\(77.6\) &\(525.8\)
FreeLB [8] &\(93.0\) &\(29.4\) &\(68.3\) &\(605.0\) &\(22.9\) &\(75.3\) &\(586.8\) &\(21.7\) &\(76.6\) &\(532.4\)
TA-VAT [19] &\(93.0\) &\(28.2\) &\(69.7\) &\(606.2\) &\(22.8\) &\(75.5\) &\(681.0\) &\(19.2\) &\(79.4\) &\(486.5\)
InfoBERT [20] &\(92.0\) &\(19.2\) &\(79.2\) &\(541.8\) &\(12.7\) &\(86.3\) &\(491.1\) &\(11.3\) &\(87.8\) &\(447.9\)
DNE [10] &\(90.4\) &\(28.0\) &\(68.2\) &\(1222.5\) &\(26.5\) &\(69.5\) &\(1488.0\) &\(27.0\) &\(69.1\) &\(1101.0\)
ASCC [13] &\(87.8\) &\(19.4\) &\(77.8\) &\(646.1\) &\(14.1\) &\(83.9\) &\(542.5\) &\(11.0\) &\(87.4\) &\(463.2\)
SAFER [22] &\(91.5\) &\(39.5\) &\(57.8\) &\(1701.7\) &\(40.0\) &\(57.5\) &\(2372.2\) &\(38.5\) &\(58.8\) &\(1363.5\)
RanMASK [12] &\(92.3\) &\(22.0\) &\(74.6\) &\(\bf 1493.4\) &\(18.0\) &\(79.2\) &\(1794.9\) &\(36.0\) &\(58.4\) &\(\bf 1813.1\)
FreeLB++ &\(\bf 93.2\) &\(\bf 45.3\) &\(\bf 51.0\) &\(1025.9\) &\(\bf 42.9\) &\(\bf 53.6\) &\(1094.0\) &\(\bf 39.9\) &\(\bf 56.9\) &\(696.9\)

4 Experiments on Textual Defense↩︎

4.1 Evaluation Metrics↩︎

Under the unified setting of the above-mentioned adversarial attacks, we conducted experiments on the current existing defense algorithms on AGNEWS and IMDB. We present \(4\) metrics to measure the defense performance.

  • The clean accuracy (Clean%) is model’s classification accuracy on the clean test dataset.

  • Accuracy under attack (Aua%) is the model’s prediction accuracy under specific adversarial attack methods.

  • Attack success rate (Suc%) is the number of texts successfully perturbed by an attack algorithm divided by the number of all texts attempted.

  • Number of Queries (#Query) is the average number of times the attacker queries the model. This is another important metric for evaluating robustness of defenders, since the greater the average query number needed for attacker, the more difficult the defense model is to be compromised.

A good defense method should have higher clean accuracy, higher accuracy under attack, lower attack success rate, and requires larger number of queries for attack.

4.2 Implementation Details↩︎

Our reproduction of all defense methods, along with the hyper-parameter settings, are completely based on their original papers, except for the following two constraints: (1) For methods which are not synonyms-agnostic, we establish different synonym sets for both attackers and defender. (2) For methods that are ensemble-based, we use the “logit-summed” ensemble method introduced in [41] to make final predictions. Specifically, we use the counter-fitting vectors [42] to generate the synonym set for attackers, and use vanilla Glove Embedding [24] to generate synonym set for defenders3. Following [12], [41], we take the average of logits produced by the base classifier over all randomly perturbed input sentences, whose size is denoted as \(C\), as the final prediction. For AGNEWS, we set the value of \(C\) to \(100\), while for IMDB, the value of \(C\) is default \(16\). In the implementation of FreeLB++, we remove the constraints of norm bounded projection, and set step size as 30 and 10 on AGNews and IMDB datasets respectively. More details will be introduced in Section 4. All the hyper-parameter settings are tuned on a randomly chosen development dataset.

We use BERT [40] as our base model. Clean accuracy (Clean%) is tested on the whole test dataset, while the latter three metrics, e.g., Aua% are evaluated on \(1000\) randomly chosen samples from the test dataset.

4.3 Results↩︎

As we can see from Table ¿tbl:agnews95experiment?, (1) the ADA-based methods have a small decrease in clean accuracy, but excellent accuracy under attack. However, comparing with the remaining methods, ADA-based methods need to know specific attacker algorithms to generate adversarial examples before defending. (2) The adversarial training methods, e.g., FreeLB, achieve higher clean accuracy than the baseline, and their improvement in robustness is also very insignificant [12], [19]. Interestingly, once we remove the \(l_2\)-norm bounded limitation for FreeLB, we find out that defense performance is significantly improved (see FreeLB++ in the tables). FreeLB++ surpasses all existing defense methods by a large margin under TextFooler and TextBugger attacks. We will leave more discussions about adversarial training methods in Section 5.1. (3) The region-based adversarial training methods, e.g., DNE, perform poorly on both clean accuracy and accuracy under attack. It is mainly because the synonym set used in the attack method is different from that used in DNE, which is further discussed in Section 5.3. (4) The certified defense methods achieve high defense performance. It is worth noting that the average number of queries to the model of these methods is larger. We think the improvement of robustness comes from the ensemble method, seeing further discussions in Section 5.2.

Results of defense performance on IMDB are reported in Table ¿tbl:imdb95experiment?. Defense methods share the trends with performance on AGNEWS. However, the general robustness of models on IMDB is poorer than AGNEWS. It is probably because the average length of sentences in IMDB (\(208\) words) is far longer than that in AGNEWS (\(44\) words). Longer sentences implies a larger search space for attackers, making it more difficult for defenders to defend against attacks.

5 Discussions↩︎

5.1 Effectiveness of Adversarial Training↩︎

The objective of standard adversarial training methods, e.g., PGD-K [14] and FreeLB [8] is to minimize the maximum risk for perturbation \(\boldsymbol{\delta}\) within a small \(\epsilon\)-norm ball: \[\small \min_{\theta} \mathbb{E}{_{(\boldsymbol{x},y) \sim \mathcal{D}}} \left[\max_{\lVert \boldsymbol{\delta} \rVert \leq \epsilon} \mathcal{L}(f_{\theta}(\boldsymbol{X} + \boldsymbol{\delta}), y)\right],\] where \(\mathcal{D}\) is the data distribution, \(\boldsymbol{X}\) is the embedding representations of input sentence \(\boldsymbol{x}\), \(y\) is the gold label, and \(\mathcal{L}\) is the loss function for training neural networks, whose parameters is denoted as \(\theta\). In order to solve inner maximization, projected gradient descent (PGD) algorithm is applied as descrided in [14] and [8]: \[\small \boldsymbol{\delta}_{t+1}=\prod _{\lVert \boldsymbol{\delta} \rVert _F \leq \epsilon} \left(\boldsymbol{\delta}_t + \alpha \frac{g(\boldsymbol{\delta}_t)}{\lVert g(\boldsymbol{\delta}_t) \rVert _F}\right), \label{delta95update}\tag{3}\] where \(g(\boldsymbol{\delta}_t) = \nabla_{\boldsymbol{\delta}}\mathcal{L}(f_{\theta}(\boldsymbol{X} + \boldsymbol{\delta}), y)\) is the gradient of the loss with respect to \(\boldsymbol{\delta}\), \(\prod _{\lVert \boldsymbol{\delta} \rVert _F \leq \epsilon}\) performs a projection onto the \(\epsilon\)-Frobenius norm ball, and \(t\) is the number of ascent steps to find the “worst-case” perturbation \(\boldsymbol{\delta}\) with step size \(\alpha\).

0.2cm -0.3cm

l|c|c|cc|cc & & & &
& & & & & &
*PGD-K &\(0.01\) &\(94.9\) &\(21.8\) &\(77.0\) &\(31.5\) &\(66.8\)
&\(0.1\) &\(95.3\) &\(43.6\) &\(54.3\) &\(45.1\) &\(52.7\)
&\(1\) &\(\bf 95.2\) &\(\bf 45.2\) &\(\bf 55.3\) &\(\bf 45.3\) &\(\bf 52.4\)
&w/o &\(\bf 95.2\) &\(\bf 45.2\) &\(\bf 55.3\) &\(\bf 45.3\) &\(\bf 52.4\)
*FreeLB &\(0.01\) &\(95.4\) &\(30.5\) &\(68.0\) &\(43.6\) &\(54.3\)
&\(0.1\) &\(95.5\) &\(36.1\) &\(62.2\) &\(40.0\) &\(58.1\)
&\(1\) &\(\textbf{94.9}\) &\(\textbf{45.8}\) &\(\textbf{51.7}\) &\(\textbf{42.5}\) &\(\textbf{55.2}\)
&w/o &\(\textbf{94.9}\) &\(\textbf{45.8}\) &\(\textbf{51.7}\) &\(\textbf{42.5}\) &\(\textbf{55.2}\)

In this section, we first study the influence of the value of the norm \(\epsilon\) on the model’s robustness performance, which is also discussed by [43] in computer vision field. As can be seen from Table ¿tbl:norm95exp?, we find out that both of the Clean% and Aua% increase as \(\epsilon\) increases. Note that the value of \(\epsilon\) is usually set to a very small value, e.g., \(\epsilon = 0.01\) [8]. A large value \(\epsilon\) (e.g., \(\epsilon=1\) in Table ¿tbl:norm95exp?) is equivalent to removing the norm-bounded limitation (seeing “w/o” in Table ¿tbl:norm95exp?), because when \(\epsilon\) is large enough and the step size \(\alpha\) is fixed, the magnitude of perturbation that used to update \(\boldsymbol{\delta}\) is also fixed, seeing Eq. 3 . In this case, from \(\left\lVert \frac{g(\boldsymbol{\delta}_t)}{\lVert g(\boldsymbol{\delta}_t) \rVert _F} \right\rVert\leq 1\) and Eq. 3 , we have: \[\small \lVert \boldsymbol{\delta}_{t+1} \rVert \leq \lVert \boldsymbol{\delta}_t \rVert + \left\lVert \alpha \frac{g(\boldsymbol{\delta}_t)}{\lVert g(\boldsymbol{\delta}_t) \rVert _F} \right\rVert \leq \lVert \boldsymbol{\delta}_t \rVert + \alpha.\] Thus, with multi-step updating \(\boldsymbol{\delta}\), we have: \[\small \begin{align} \lVert \boldsymbol{\delta}_t \rVert \leq \lVert \boldsymbol{\delta}_{t-1} \rVert + \alpha \leq \lVert \boldsymbol{\delta}_{t-2} \rVert + 2 {\alpha} \\ \leq \cdots \leq \lVert \boldsymbol{\delta}_1 \rVert + (t-1) * \alpha \leq t \alpha, \end{align}\]

Figure 2: The impact of different values of the ascent steps t. Sub-figure (a) shows the accuracy of FreeLB++ and PGD-K++ on the clean data (Clean%). Sub-figure (b) and (c) show the accuracy of FreeLB++ and PGD-K++ respectively under three different attack algorithms (TextFooler, TextBugger and BERT-Attack). As the value of t grows, Clean% and Aua% of the models will increase until reaching their peak values. After that, they begin to decrease as the value of t increases continually.

where we can find that the upper bound of the norm of perturbation \(\boldsymbol{\delta}\) is determined by the number of ascent steps \(t\) if the value of \(\alpha\) is fixed. In other words, the number of ascent steps \(t\) influences the search region of the perturbation \(\boldsymbol{\delta}\), where the larger \(t\) is, the larger the search region will be. However, in original FreeLB, the same \(\epsilon\)-norm has been applied to all perturbations and to restrict the search region around every word embedding. We denote our versions of PGD-K and FreeLB which remove the norm-bounded limitations as PGD-K++ and FreeLB++, respectively. We conducted experiments on PGD-K++, FreeLB++ with different \(t\) to study the impact of the value of \(t\). As shown in Figure 2, the Clean% of both PGD-K++ and FreeLB++ models reaching a peak at \(t=5\) while the peak of Aua% performance reaches at \(t=30\) for FreeLB++ and \(t=10\) for PGD-K++.

We give a possible explanation to this improvement of performance. We regard standard adversarial training as an exploration of embedding space. When \(t\) is small, the adversarial example space explored by the model is relatively small, resulting in poor defense performance of the model when a high-intensity attack arrives. This problem is alleviated when \(t\) becomes larger, and this explains why both Clean% and Aua% can be improved when \(t\) increases. When \(t\) exceeds its optimal value, the adversarial example generated by the algorithm may become dissimilar to the original example. Excessive learning of examples with different distributions from the original examples will lead to a decline in model’s modeling ability.

5.2 Impact of Ensemble Strategies↩︎

There are two ensemble strategies [41]: logits-summed (logit) and majority-vote (voting) ensemble. As mentioned above, in the logit method, the logits produced by the base classifier are averaged. Whereas, in the voting strategy, the predictions of classifiers for each class label are counted, and the vote results will be regarded as the output probability for classification. Compared to the logit method, we found that the majority-vote strategy can effectively improve the model’s robustness, as can be inferred from the results in Table ¿tbl:ensemble95ablation?. However, after further research, the reason the voting strategy achieves better defense performance is that it increases the difficulty for score-based attackers, which is also discussed in [12].

A typical score-based attacker usually involves two key steps: searching for weak spots in a text and replacing words in these weak spots to maximum model’s prediction error. In the second stage, if no words in the synonym set can lower the logits, the adversary will give up perturbing this word. However, for those voting-based methods which create ensemble by introducing small noise to the original text \(\boldsymbol{x}\), e.g., SAFER, RanMASK-\(5\%\), the models tend to output very sharp distribution, even close to one-hot categorical distribution. This forces the attackers to launch decision-based attacks instead of the score-based ones, which can dramatically improve their attack difficulty. Therefore, it may be unfair to compare voting-based ensemble defense methods with others due to lack of effective ways to attack voting-based ensembles in the literature. We believe voting-based methods will greatly improve model’s defense performance, but we recommend using logit-summed algorithm if one needs to prove the effectiveness of the proposed algorithm against adversarial attacks in future research.

0.2cm -0.5cm

The ablation experiment on ensemble methods. Voting-based ensembles achieve better performance than logit-based ensembles, but this is potentially due to the non-differentiability introduced by voting-based attacks.
Method Clean TextFooler TextBugger
Aua\(\%\) Suc\(\%\) Aua\(\%\) Suc\(\%\)
Baseline (BERT) \(\bf 94.5\) \(19.1\) \(79.6\) \(27.2\) \(71.0\)
SAFER (logit) \(94.3\) \(31.8\) \(66.1\) \(41.2\) \(56.1\)
SAFER (voting) \(\bf 78.6\) \(\bf 17.6\) \(\bf 69.0\) \(\bf 28.0\)
RanMASK-5% (logit) \(\bf 94.5\) \(21.5\) \(77.3\) \(41.2\) \(56.1\)
RanMASK-5% (voting) \(68.6\) \(26.9\) \(62.5\) \(34.0\)
RanMASK-90% (logit) \(91.7\) \(37.9\) \(58.7\) \(49.5\) \(46.1\)
RanMASK-90% (voting) \(47.9\) \(48.2\) \(57.4\) \(37.6\)

5.3 Impact of Synonym Sets↩︎

Table ¿tbl:vocab? shows the results of the ablation study on the impact of external synonym set on performance in the defense methods. Some previous studies [10], [13], [22] use the same synonym set as the attacker during adversarial defense training, leading to significant defense performance. As we can see from Table ¿tbl:vocab?, all methods improve the Aua% by a large margin after sharing the synonym set with the attacker. However, having access to the attacker’s synonym is not a realistic scenario since we cannot impose a limitation on the synonym set used by the attackers. Thus, for the sake of fair comparison in future research, we suggest that future work should assume that the attacker’s synonym set cannot be accessed, and report the defense performance in this case.

0.1cm -0.5cm

The ablation experiment on synonym set. “w” and “w/o” means the corresponding defense method use or not use the synonym set of the attack method.
Method Clean TextFooler TextBugger
Aua\(\%\) Suc\(\%\) Aua\(\%\) Suc\(\%\)
SAFER (w) \(93.8\) \(\bf 46.6\) \(\bf 50.3\) \(\bf 55.4\) \(\bf 40.9\)
SAFER (w/o) \(\bf 94.3\) \(31.8\) \(66.1\) \(41.2\) \(56.1\)
DNE (w) \(93.4\) \(\bf 44.9\) \(\bf 54.0\) \(\bf 42.2\) \(\bf 56.6\)
DNE (w/o) \(\bf 93.9\) \(28.7\) \(69.8\) \(28.2\) \(70.3\)
ASCC (w) \(91.4\) \(\bf 39.0\) \(\bf 57.3\) \(\bf 44.2\) \(\bf 51.6\)
ASCC (w/o) \(\bf 92.3\) \(28.2\) \(69.6\) \(37.0\) \(60.1\)

6 Conclusion↩︎

In this paper, we established a comprehensive and coherent benchmark to evaluate the defense performance of textual defenders. We impose constraints to existing attack algorithms to ensure the quality of adversarial examples generated. Using these attackers, we systematically studied the advantages and disadvantages of different textual defenders. We find out that adversarial training methods are still the most effective defenders. Our FreeLB++ can not only achieve state-of-the-art defense performance under various attack algorithms, but also improve the performance on clean examples. We hope this study could provide useful clues for future research on text adversarial defense.

Acknowledgements↩︎

This work was supported by Shanghai Municipal Science and Technology Major Project (No. 2021SHZDZX0103), and National Science Foundation of China (No. 62076068). CJH is supported by NSF IIS-1901527, IIS-2008173 and IIS-2048280.

References↩︎

[1]
Javid Ebrahimi, Anyi Rao, Daniel Lowd, and Dejing Dou. 2017. Hotflip: White-box adversarial examples for text classification. Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics.
[2]
Ji Gao, Jack Lanchantin, Mary Lou Soffa, and Yanjun Qi. 2018. Black-box generation of adversarial text sequences to evade deep learning classifiers. In 2018 IEEE Security and Privacy Workshops (SPW), pages 50–56. IEEE.
[3]
Jinfeng Li, Shouling Ji, Tianyu Du, Bo Li, and Ting Wang. 2018. Textbugger: Generating adversarial text against real-world applications. Network and Distributed Systems Security (NDSS) Symposium 2019.
[4]
Shuhuai Ren, Yihe Deng, Kun He, and Wanxiang Che. 2019. https://doi.org/10.18653/v1/P19-1103. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1085–1097, Florence, Italy. Association for Computational Linguistics.
[5]
Di Jin, Zhijing Jin, Joey Tianyi Zhou, and Peter Szolovits. 2020. https://doi.org/10.1609/aaai.v34i05.6311. Proceedings of the AAAI Conference on Artificial Intelligence, 34(05):8018–8025.
[6]
Linyang Li, Ruotian Ma, Qipeng Guo, Xiangyang Xue, and Xipeng Qiu. 2020. https://doi.org/10.18653/v1/2020.emnlp-main.500. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6193–6202, Online. Association for Computational Linguistics.
[7]
Robin Jia, Aditi Raghunathan, Kerem Göksel, and Percy Liang. 2019. https://doi.org/10.18653/v1/D19-1423. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 4129–4142, Hong Kong, China. Association for Computational Linguistics.
[8]
Chen Zhu, Yu Cheng, Zhe Gan, Siqi Sun, Tom Goldstein, and Jingjing Liu. 2020. https://openreview.net/forum?id=BygzbyHFvB. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020.
[9]
Xiaoqing Zheng, Jiehang Zeng, Yi Zhou, Cho-Jui Hsieh, Minhao Cheng, and Xuanjing Huang. 2020. https://doi.org/10.18653/v1/2020.acl-main.590. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6600–6610, Online. Association for Computational Linguistics.
[10]
Yi Zhou, Xiaoqing Zheng, Cho-Jui Hsieh, Kai-wei Chang, and Xuanjing Huang. 2020. Defense against adversarial attacks in nlp via dirichlet neighborhood ensemble. arXiv preprint arXiv:2006.11627.
[11]
Siddhant Garg and Goutham Ramakrishnan. 2020. https://doi.org/10.18653/v1/2020.emnlp-main.498. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6174–6181, Online. Association for Computational Linguistics.
[12]
Jiehang Zeng, Xiaoqing Zheng, Jianhan Xu, Linyang Li, Liping Yuan, and Xuanjing Huang. 2021. Certified robustness to text adversarial attacks by randomized [MASK]. arXiv preprint arXiv:2105.03743.
[13]
Xinshuai Dong, Hong Liu, Rongrong Ji, and Anh Tuan Luu. 2021. Towards robustness against natural language word substitutions. In International Conference on Learning Representations (ICLR).
[14]
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. 2018. https://openreview.net/forum?id=rJzIBfZAb. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net.
[15]
Di Jin, Zhijing Jin, Joey Tianyi Zhou, and Peter Szolovits. 2020. https://doi.org/10.1609/aaai.v34i05.6311. Proceedings of the AAAI Conference on Artificial Intelligence, 34(05):8018–8025.
[16]
Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric Xing, Laurent El Ghaoui, and Michael Jordan. 2019. Theoretically principled trade-off between robustness and accuracy. In International Conference on Machine Learning, pages 7472–7482. PMLR.
[17]
Daniel Cer, Yinfei Yang, Sheng-yi Kong, Nan Hua, Nicole Limtiaco, Rhomni St John, Noah Constant, Mario Guajardo-Céspedes, Steve Yuan, Chris Tar, et al. 2018. https://doi.org/10.18653/v1/D18-2029. Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 169–174.
[18]
Chenglei Si, Zhengyan Zhang, Fanchao Qi, Zhiyuan Liu, Yasheng Wang, Qun Liu, and Maosong Sun. 2020. Better robustness by more coverage: Adversarial training with mixup augmentation for robust fine-tuning. arXiv preprint arXiv:2012.15699.
[19]
Linyang Li and Xipeng Qiu. 2020. Tavat: Token-aware virtual adversarial training for language understanding. arXiv preprint arXiv:2004.14543.
[20]
Boxin Wang, Shuohang Wang, Yu Cheng, Zhe Gan, Ruoxi Jia, Bo Li, and Jingjing Liu. 2020. Infobert: Improving robustness of language models from an information theoretic perspective. 9th International Conference on Learning Representations (ICLR).
[21]
Zhouxing Shi, Huan Zhang, Kai-Wei Chang, Minlie Huang, and Cho-Jui Hsieh. 2020. Robustness verification for transformers. arXiv preprint arXiv:2002.06622.
[22]
Mao Ye, Chengyue Gong, and Qiang Liu. 2020. https://doi.org/10.18653/v1/2020.acl-main.317. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 3465–3475, Online. Association for Computational Linguistics.
[23]
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Efficient estimation of word representations in vector space. 1st International Conference on Learning Representations (ICLR).
[24]
Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. https://doi.org/10.3115/v1/D14-1162. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1532–1543, Doha, Qatar. Association for Computational Linguistics.
[25]
Jinsong Su, Zhenqiao Song, Yaojie Lu, Mu Xu, Changxing Wu, and Yidong Chen. 2018. Exploring implicit semantic constraints for bilingual word embeddings. Neural Processing Letters, 48(2):1073–1088.
[26]
Volodymyr Kuleshov, Shantanu Thakoor, Tingfung Lau, and Stefano Ermon. 2018. Adversarial examples for natural language classification problems. International Conference on Learning Representations (ICLR).
[27]
Shuhuai Ren, Yihe Deng, Kun He, and Wanxiang Che. 2019. https://doi.org/10.18653/v1/P19-1103. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1085–1097, Florence, Italy. Association for Computational Linguistics.
[28]
Yu-Lun Hsieh, Minhao Cheng, Da-Cheng Juan, Wei Wei, Wen-Lian Hsu, and Cho-Jui Hsieh. 2019. On the robustness of self-attentive models. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1520–1529.
[29]
Puyudi Yang, Jianbo Chen, Cho-Jui Hsieh, Jane-Ling Wang, and Michael I Jordan. 2020. Greedy attack and gumbel attack: Generating adversarial examples for discrete data. Journal of Machine Learning Research, 21(43):1–36.
[30]
Moustafa Alzantot, Yash Sharma, Ahmed Elgohary, Bo-Jhang Ho, Mani Srivastava, and Kai-Wei Chang. 2018. https://doi.org/10.18653/v1/D18-1316. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 2890–2896, Brussels, Belgium. Association for Computational Linguistics.
[31]
Yuan Zang, Fanchao Qi, Chenghao Yang, Zhiyuan Liu, Meng Zhang, Qun Liu, and Maosong Sun. 2020. Word-level textual adversarial attacking as combinatorial optimization. Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics.
[32]
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. 2017. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412.
[33]
Po-Sen Huang, Robert Stanforth, Johannes Welbl, Chris Dyer, Dani Yogatama, Sven Gowal, Krishnamurthy Dvijotham, and Pushmeet Kohli. 2019. Achieving verified robustness to symbol substitutions via interval bound propagation. Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing.
[34]
Kaidi Xu, Zhouxing Shi, Huan Zhang, Yihan Wang, Kai-Wei Chang, Minlie Huang, Bhavya Kailkhura, Xue Lin, and Cho-Jui Hsieh. 2020. Automatic perturbation analysis for scalable certified robustness and beyond. Advances in Neural Information Processing Systems, 33.
[35]
John Morris, Eli Lifland, Jin Yong Yoo, Jake Grigsby, Di Jin, and Yanjun Qi. 2020. Textattack: A framework for adversarial attacks, data augmentation, and adversarial training in nlp. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 119–126.
[36]
John X Morris, Eli Lifland, Jack Lanchantin, Yangfeng Ji, and Yanjun Qi. 2020. Reevaluating adversarial examples in natural language. arXiv preprint arXiv:2004.14174.
[37]
Jin Yong Yoo, John X Morris, Eli Lifland, and Yanjun Qi. 2020. Searching for a search method: Benchmarking search algorithms for generating nlp adversarial examples. arXiv preprint arXiv:2009.06368.
[38]
Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text classification. In Advances in neural information processing systems, pages 649–657.
[39]
Andrew L Maas, Raymond E Daly, Peter T Pham, Dan Huang, Andrew Y Ng, and Christopher Potts. 2011. Learning word vectors for sentiment analysis. In Proceedings of the 49th annual meeting of the association for computational linguistics: Human language technologies-volume 1, pages 142–150. Association for Computational Linguistics.
[40]
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies.
[41]
Devvrit, Minhao Cheng, Cho-Jui Hsieh, Inderjit Dhillon, et al. 2020. Voting based ensemble improves robustness of defensive models. arXiv preprint arXiv:2011.14031.
[42]
Nikola Mrkšić, Diarmuid O Séaghdha, Blaise Thomson, Milica Gašić, Lina Rojas-Barahona, Pei-Hao Su, David Vandyke, Tsung-Hsien Wen, and Steve Young. 2016. Counter-fitting word vectors to linguistic constraints. Proceedings of HLT-NAACL.
[43]
Sven Gowal, Chongli Qin, Jonathan Uesato, Timothy Mann, and Pushmeet Kohli. 2020. Uncovering the limits of adversarial training against norm-bounded adversarial examples. arXiv preprint arXiv:2010.03593.

  1.   Equal contribution↩︎

  2. We also conducted experiments on combinatorial optimization attacker: e.g., GA [30], PSO [31]. However, our pre-experiments showed that they were very time-consuming, and their performance were poor under the limit of the maximum number of queries.↩︎

  3. According to our statistics, \(69.70\%\) of the words in defender’s synonym set appears in the attacker synonym set’s vocabulary. Among them, \(73\%\) of the synonyms in the defender’s synonym set are covered by the attacker’s.↩︎