INFOBERT: IMPROVING ROBUSTNESS OF LANGUAGE MODELS FROM AN INFORMATION THEORETIC PERSPECTIVE
Year: 2021

Abstract:
Large-scale pre-trained language models such as BERT and RoBERTa have achieved state-of-the-art performance across a wide range of NLP tasks. Recent studies, however, show that such BERT-based models are vulnerable facing the threats of textual adversarial attacks. We aim to address this problem from an information-theoretic perspective, and propose InfoBERT, a novel learning framework for robust fine-tuning of pre-trained language models. InfoBERT contains two mutual-information-based regularizers for model training: (i) an Information Bottleneck regularizer, which suppresses noisy mutual information between the input and the feature representation; and (ii) an Anchored Feature regularizer, which increases the mutual information between local stable features and global features. We provide a principled way to theoretically analyze and improve the robustness of language models in both standard and adversarial training. Extensive experiments demonstrate that InfoBERT achieves stateof-the-art robust accuracy over several adversarial datasets on Natural Language Inference (NLI) and Question Answering (QA) tasks. Our code is available at https://github.com/AI-secure/InfoBERT.

heading: 1 INTRODUCTION
text: Self-supervised representation learning pre-trains good feature extractors from massive unlabeled data, which show promising transferability to various downstream tasks. Recent success includes large-scale pre-trained language models (e.g., BERT, RoBERTa, and GPT-3 (Devlin et al., 2019; Liu et al., 2019; Brown et al., 2020)), which have advanced state of the art over a wide range of NLP tasks such as NLI and QA, even surpassing human performance. Specifically, in the computer vision domain, many studies have shown that self-supervised representation learning is essentially solving the problem of maximizing the mutual information (MI) I(X;T ) between the input X and the representation T (van den Oord et al., 2018; Belghazi et al., 2018; Hjelm et al., 2019; Chen et al., 2020). Since MI is computationally intractable in high-dimensional feature space, many MI estimators (Belghazi et al., 2018) have been proposed to serve as lower bounds (Barber & Agakov, 2003; van den Oord et al., 2018) or upper bounds (Cheng et al., 2020) of MI. Recently, Kong et al. point out that the MI maximization principle of representation learning can be applied to not only computer vision but also NLP domain, and propose a unified view that recent pre-trained language models are maximizing a lower bound of MI among different segments of a word sequence.
On the other hand, deep neural networks are known to be prone to adversarial examples (Goodfellow et al., 2015; Papernot et al., 2016; Eykholt et al., 2017; Moosavi-Dezfooli et al., 2016), i.e., the outputs of neural networks can be arbitrarily wrong when human-imperceptible adversarial perturbations are added to the inputs. Textual adversarial attacks typically perform word-level substitution (Ebrahimi et al., 2018; Alzantot et al., 2018; Ren et al., 2019) or sentence-level paraphrasing (Iyyer et al., 2018; Zhang et al., 2019) to achieve semantic/utility preservation that seems innocuous to human, while fools NLP models. Recent studies (Jin et al., 2020; Zang et al., 2020; Nie et al., 2020; Wang et al., 2020) further show that even large-scale pre-trained language models (LM) such as
∗Work was done during Boxin Wang’s Summer internship in Microsoft Dynamics 365 AI Research.
BERT are vulnerable to adversarial attacks, which raises the challenge of building robust real-world LM applications against unknown adversarial attacks.
We investigate the robustness of language models from an information theoretic perspective, and propose a novel learning framework InfoBERT, which focuses on improving the robustness of language representations by fine-tuning both local features (word-level representation) and global features (sentence-level representation) for robustness purpose. InfoBERT considers two MI-based regularizers: (i) the Information Bottleneck regularizer manages to extract approximate minimal sufficient statistics for downstream tasks, while removing excessive and noisy information that may incur adversarial attacks; (ii) the Anchored Feature regularizer carefully selects useful local stable features that are invulnerable to adversarial attacks, and maximizes the mutual information between local stable features and global features to improve the robustness of the global representation. In this paper, we provide a detailed theoretical analysis to explicate the effect of InfoBERT for robustness improvement, along with extensive empirical adversarial evaluation to validate the theory.
Our contributions are summarized as follows. (i) We propose a novel learning framework InfoBERT from the information theory perspective, aiming to effectively improve the robustness of language models. (ii) We provide a principled theoretical analysis on model robustness, and propose two MIbased regularizers to refine the local and global features, which can be applied to both standard and adversarial training for different NLP tasks. (iii) Comprehensive experimental results demonstrate that InfoBERT can substantially improve robust accuracy by a large margin without sacrificing the benign accuracy, yielding the state-of-the-art performance across multiple adversarial datasets on NLI and QA tasks.

heading: 2 RELATED WORK
text: Textual Adversarial Attacks/Defenses Most existing textual adversarial attacks focus on wordlevel adversarial manipulation. Ebrahimi et al. (2018) is the first to propose a whitebox gradientbased attack to search for adversarial word/character substitution. Following work (Alzantot et al., 2018; Ren et al., 2019; Zang et al., 2020; Jin et al., 2020) further constrains the perturbation search space and adopts Part-of-Speech checking to make NLP adversarial examples look natural to human.
To defend against textual adversarial attacks, existing work can be classified into three categories: (i) Adversarial Training is a practical method to defend against adversarial examples. Existing work either uses PGD-based attacks to generate adversarial examples in the embedding space of NLP as data augmentation (Zhu et al., 2020a), or regularizes the standard objective using virtual adversarial training (Jiang et al., 2020; Liu et al., 2020; Gan et al., 2020). However, one drawback is that the threat model is often unknown, which renders adversarial training less effective when facing unseen attacks. (ii) Interval Bound Propagation (IBP) (Dvijotham et al., 2018) is proposed as a new technique to consider the worst-case perturbation theoretically. Recent work (Huang et al., 2019; Jia et al., 2019) has applied IBP in the NLP domain to certify the robustness of models. However, IBPbased methods rely on strong assumptions of model architecture and are difficult to adapt to recent transformer-based language models. (iii) Randomized Smoothing (Cohen et al., 2019) provides a tight robustness guarantee in `2 norm by smoothing the classifier with Gaussian noise. Ye et al. (2020) adapts the idea to the NLP domain, and replace the Gaussian noise with synonym words to certify the robustness as long as adversarial word substitution falls into predefined synonym sets. However, to guarantee the completeness of the synonym set is challenging.
Representation Learning MI maximization principle has been adopted by many studies on selfsupervised representation learning (van den Oord et al., 2018; Belghazi et al., 2018; Hjelm et al., 2019; Chen et al., 2020). Specifically, InfoNCE (van den Oord et al., 2018) is used as the lower bound of MI, forming the problem as contrastive learning (Saunshi et al., 2019; Yu et al., 2020). However, Tian et al. (2020) suggests that the InfoMax (Linsker, 1988) principle may introduce excessive and noisy information, which could be adversarial. To generate robust representation, Zhu et al. (2020b) formalizes the problem from a mutual-information perspective, which essentially performs adversarial training for worst-case perturbation, while mainly considers the continuous space in computer vision. In contrast, InfoBERT originates from an information-theoretic perspective and is compatible with both standard and adversarial training for discrete input space of language models.

heading: 3 INFOBERT
text: Before diving into details, we first discuss the textual adversarial examples we consider in this paper. We mainly focus on the dominant word-level attack as the main threat model, since it achieves higher attack success and is less noticeable to human readers than other attacks. Due to the discrete nature of text input space, it is difficult to measure adversarial distortion on token level. Instead, because most word-level adversarial attacks (Li et al., 2019; Jin et al., 2020) constrain word perturbations via the bounded magnitude in the semantic embedding space, by adapting from Jacobsen et al. (2019), we define the adversarial text examples with distortions constrained in the embedding space. Definition 3.1. ( -bounded Textual Adversarial Examples). Given a sentence x = [x1;x2; ...;xn], where xi is the word at the i-th position, the -bounded adversarial sentence x′ = [x′1;x ′ 2; ...;x ′ n] for a classifier F satisfies: (1) F(x) = o(x) = o(x′) but F(x′) 6= o(x′), where o(·) is the oracle (e.g., human decision-maker); (2) ||ti − t′i||2 ≤ for i = 1, 2, ..., n, where ≥ 0 and ti is the word embedding of xi.

heading: 3.1 INFORMATION BOTTLENECK AS A REGULARIZER
text: In this section, we first discuss the general IB implementation, and then explain how IB formulation is adapted to InfoBERT as a regularizer along with theoretical analysis to support why IB regularizer can help improve the robustness of language models. The IB principle formulates the goal of deep learning as an information-theoretic trade-off between representation compression and predictive power (Tishby & Zaslavsky, 2015). Given the input source X , a deep neural net learns the internal representation T of some intermediate layer and maximizes the MI between T and label Y , so that T subject to a constraint on its complexity contains sufficient information to infer the target label Y . Finding an optimal representation T can be formulated as the maximization of the Lagrangian
LIB = I(Y ;T )− βI(X;T ), (1)
where β > 0 is a hyper-parameter to control the tradeoff, and I(Y ;T ) is defined as:
I(Y ;T ) = ∫ p(y, t) log p(y, t)
p(y)p(t) dy dt . (2)
Since Eq. (2) is intractable, we instead use the lower bound from Barber & Agakov (2003): I(Y ;T ) ≥ ∫ p(y, t) log qψ(y | t) dy dt , (3)
where qψ(y|t) is the variational approximation learned by a neural network parameterized by ψ for the true distribution p(y|t). This indicates that maximizing the lower bound of the first term of IB I(Y ;T ) is equivalent to minimizing the task cross-entropy loss `task = H(Y | T ). To derive a tractable lower bound of IB, we here use an upper bound (Cheng et al., 2020) of I(X;T )
I(X;T ) ≤ ∫ p(x, t) log(p(t | x)) dx dt − ∫ p(x)p(t) log(p(t | x)) dx dt . (4)
By combining Eq. (3) and (4), we can maximize the tractable lower bound L̂IB of IB in practice by:
L̂IB = 1
N N∑ i=1 [ log qψ(y (i) | t(i)) ] − β N N∑ i=1 [ log(p(t(i) | x(i)))− 1 N N∑ j=1 log(p(t(j) | x(i))) ] (5)
with data samples {x(i), y(i)}Ni=1, where qψ can represent any classification model (e.g., BERT), and p(t | x) can be viewed as the feature extractor fθ : X → T , where X and T are the support of the input source X and extracted feature T , respectively.
The above is a general implementation of IB objective function. In InfoBERT, we consider T as the features consisting of the local word-level features after the BERT embedding layer fθ. The following BERT self-attentive layers along with the linear classification head serve as qψ(y|t) that predicts the target Y given representation T .
Formally, given random variablesX = [X1;X2; ...;Xn] representing input sentences withXi (word token at i-th index), let T = [T1; ...;Tn] = fθ([X1;X2; ...;Xn]) = [fθ(X1); fθ(X2); ...; fθ(Xn)]
denote the random variables representing the features generated from input X via the BERT embedding layer fθ, where Ti ∈ Rd is the high-dimensional word-level local feature for word Xi. Due to the high dimensionality d of each word feature (e.g., 1024 for BERT-large), when the sentence length n increases, the dimensionality of features T becomes too large to compute I(X;T ) in practice. Thus, we propose to maximize a localized formulation of IB LLIB defined as:
LLIB := I(Y ;T )− nβ n∑ i=1 I(Xi;Ti). (6)
Theorem 3.1. (Lower Bound of LIB) Given a sequence of random variables X = [X1;X2; ...;Xn] and a deterministic feature extractor fθ, let T = [T1; ...;Tn] = [fθ(X1); fθ(X2); ...; fθ(Xn)]. Then the localized formulation of IB LLIB is a lower bound of LIB (Eq. (1)), i.e.,
I(Y ;T )− βI(X;T ) ≥ I(Y ;T )− nβ n∑ i=1 I(Xi;Ti). (7)
Theorem 3.1 indicates that we can maximize the localized formulation of LLIB as a lower bound of IB LIB when I(X;T ) is difficult to compute. In Eq. (6), if we regard the first term (I(Y ;T )) as a task-related objective, the second term (−nβ ∑n i=1 I(Xi;Ti)) can be considered as a regularization term to constrain the complexity of representation T , thus named as Information Bottleneck regularizer. Next, we give a theoretical analysis for the adversarial robustness of IB and demonstrate why localized IB objective function can help improve the robustness to adversarial attacks.
Following Definition 3.1, let T = [T1;T2; ...;Tn] and T ′ = [T ′1;T ′ 2; ...;T ′ n] denote the features for the benign sentence X and adversarial sentence X ′. The distributions of X and X ′ are denoted by probability p(x) and q(x) with the support X and X ′, respectively. We assume that the feature representation T has finite support denoted by T considering the finite vocabulary size in NLP. Theorem 3.2. (Adversarial Robustness Bound) For random variables X = [X1;X2; ...;Xn] and X ′ = [X ′1;X ′ 2; ...;X ′ n], let T = [T1;T2; ...;Tn] = [fθ(X1); fθ(X2); ...; fθ(Xn)] and T
′ = [T ′1;T ′ 2; ...;T ′ n] = [fθ(X ′ 1); fθ(X ′ 2); ...; fθ(X ′ n)] with finite support T , where fθ is a deterministic feature extractor. The performance gap between benign and adversarial data |I(Y ;T )− I(Y ;T ′)| is bounded above by
|I(Y ;T )− I(Y ;T ′)| ≤ B0 +B1 n∑ i=1 √ |T |(I(Xi;Ti))1/2 +B2 n∑ i=1 |T |3/4(I(Xi;Ti))1/4
+B3 n∑ i=1 √ |T |(I(X ′i;T ′i ))1/2 +B4 n∑ i=1 |T |3/4(I(X ′i;T ′i ))1/4, (8)
where B0, B1, B2, B3 and B4 are constants depending on the sequence length n, and p(x).
The sketch of the proof is to express the difference of |I(Y ;T ) − I(Y ′;T )| in terms of I(Xi;Ti). Specifically, Eq. (25) factorizes the difference into two summands. The first summand, the conditional entropy |H(T | Y ) − H(T ′ | Y )|, can be bound by Eq. (42) in terms of MI between benign/adversarial input and representation I(Xi;Ti) and I(X ′i;T ′ i ). The second summand |H(T ) − H(T ′)| has a constant upper bound (Eq. (85)), since language models have bounded vocabulary size and embedding space, and thus have bounded entropy.
The intuition of Theorem 3.2 is to bound the adversarial performance drop |I(Y ;T ) − I(Y ;T ′)| by I(Xi;Ti). As explained in Eq. (3), I(Y ;T ) and I(Y ;T ′) can be regarded as the model performance on benign and adversarial data. Thus, the LHS of the bound represents such a performance gap. The adversarial robustness bound of Theorem 3.2 indicates that the performance gap becomes closer when I(Xi;Ti) and I(X ′i;T ′ i ) decrease. Note that our IB regularizer in the objective function Eq. (6) achieves the same goal of minimizing I(Xi;Ti) while learning the most efficient information features, or approximate minimal sufficient statistics, for downstream tasks. Theorem 3.2 also suggests that combining adversarial training with our IB regularizer can further minimize I(X ′i;T ′ i ), leading to better robustness, which is verified in §4.

heading: 3.2 ANCHORED FEATURE REGULARIZER
text: In addition to the IB regularizer that suppresses noisy information that may incur adversarial attacks, we propose a novel regularizer termed “Anchored Feature Regularizer”, which extracts local
Algorithm 1 - Local Anchored Feature Extraction. This algorithm takes in the word local features and returns the index of local anchored features.
1: Input: Word local features t, upper and lower threshold ch and cl 2: δ ← 0 // Initialize the perturbation vector δ 3: g(δ) = ∇δ`task(qψ(t+ δ), y) // Perform adversarial attack on the embedding space 4: Sort the magnitude of the gradient of the perturbation vector from ||g(δ)1||2, ||g(δ)2||2, ..., ||g(δ)n||2 into ||g(δ)k1 ||2, ||g(δ)k2 ||2, ..., ||g(δ)kn ||2 in ascending order, where zi corresponds to its original index. 5: Return: ki, ki+1, ..., kj , where cl ≤ in ≤ j n ≤ ch.
stable features and aligns them with sentence global representations, thus improving the stability and robustness of language representations.
The goal of the local anchored feature extraction is to find features that carry useful and stable information for downstream tasks. Instead of directly searching for local anchored features, we start with searching for nonrobust and unuseful features. To identify local nonrobust features, we perform adversarial attacks to detect which words are prone to changes under adversarial word substitution. We consider these vulnerable words as features nonrobust to adversarial threats. Therefore, global robust sentence representations should rely less on these vulnerable statistical clues. On the other hand, by examining the adversarial perturbation on each local word feature, we can also identify words that are less useful for downstream tasks. For example, stopwords and punctuation usually carry limited information, and tend to have smaller adversarial perturbations than words containing more effective information. Although these unuseful features are barely changed under adversarial attacks, they contain insufficient information and should be discarded. After identifying the nonrobust and unuseful features, we treat the remaining local features in the sentences as useful stable features and align the global feature representation based on them.
During the local anchored feature extraction, we perform “virtual” adversarial attacks that generate adversarial perturbation in the embedding space, as it abstracts the general idea for existing wordlevel adversarial attacks. Formally, given an input sentence x = [x1;x2; ...;xn] with its corresponding local embedding representation t = [t1; ...; tn], where x and t are the realization of random variables X and T , we generate adversarial perturbation δ in the embedding space so that the task loss `task increases. The adversarial perturbation δ is initialized to zero, and the gradient of the loss with respect to δ is calculated by g(δ) = ∇δ`task(qψ(t+δ), y) to update δ ← ∏ ||δ||F≤ (ηg(δ)/||g(δ)||F ). The above process is similar to one-step PGD with zero-initialized perturbation δ. Since we only care about the ranking of perturbation to decide on robust features, in practice we skip the update of δ to save computational cost, and simply examine the `2 norm of the gradient g(δ)i of the perturbation on each word feature ti. A feasible plan is to choose the words whose perturbation is neither too large (nonrobust features) nor too small (unuseful features), e.g., the words whose perturbation rankings are among 50% ∼ 80% of all the words. The detailed procedures are provided in Algorithm 1.
After local anchored features are extracted, we propose to align sentence global representations Z with our local anchored features Ti. In practice, we can use the final-layer [CLS] embedding to represent global sentence-level feature Z. Specifically, we use the information theoretic tool to increase the mutual information I(Ti;Z) between local anchored features Ti and sentence global representations Z, so that the global representations can share more robust and useful information with the local anchored features and focus less on the nonrobust and unuseful ones. By incorporating the term I(Ti;Z) into the previous objective function Eq. (6), our final objective function becomes:
max I(Y ;T )− nβ n∑ i=1 I(Xi;Ti) + α M∑ j=1 I(Tkj ;Z), (9)
where Tkj are the local anchored features selected by Algorithm 1 and M is the number of local anchored features. An illustrative figure can be found in Appendix Figure 2.
In addition, due to the intractability of computing MI, we use InfoNCE (van den Oord et al., 2018) as the lower bound of MI to approximate the last term I(Tkj ;Z):
Î (InfoNCE)(Ti;Z) := EP [ gω(ti, z)− EP̃ [ log ∑ t′i egω(t ′ i,z) ]] , (10)
where gω(·, ·) is a score function (or critic function) approximated by a neural network, ti are the positive samples drawn from the joint distribution P of local anchored features and global representations, and t′i are the negative samples drawn from the distribution of nonrobust and unuseful features P̃.

heading: 4 EXPERIMENTS
text: In this section, we demonstrate how effective InfoBERT improves the robustness of language models over multiple NLP tasks such as NLI and QA. We evaluate InfoBERT against both strong adversarial datasets and state-of-the-art adversarial attacks.

heading: 4.1 EXPERIMENTAL SETUP
text: Adversarial Datasets The following adversarial datasets and adversarial attacks are used to evaluate the robustness of InfoBERT and baselines. (I) Adversarial NLI (ANLI) (Nie et al., 2020) is a large-scale NLI benchmark, collected via an iterative, adversarial, human-and-model-in-theloop procedure to attack BERT and RoBERTa. ANLI dataset is a strong adversarial dataset which can easily reduce the accuracy of BERTLarge to 0%. (II) Adversarial SQuAD (Jia & Liang, 2017) dataset is an adversarial QA benchmark dataset generated by a set of handcrafted rules and refined by crowdsourcing. Since adversarial training data is not provided, we fine-tune RoBERTaLarge on benign SQuAD training data (Rajpurkar et al., 2016) only, and test the models on both benign and adversarial test sets. (III) TextFooler (Jin et al., 2020) is the state-of-the-art word-level adversarial attack method to generate adversarial examples. To create an adversarial evaluation dataset, we sampled 1, 000 examples from the test sets of SNLI and MNLI respectively, and run TextFooler against BERTLarge and RoBERTaLarge to obtain the adversarial text examples.
Baselines Since IBP-based methods (Huang et al., 2019; Jia et al., 2019) cannot be applied to largescale language models yet, and the randomized-smoothing-based method (Ye et al., 2020) achieves limited certified robustness, we compare InfoBERT against three competitive baselines based on adversarial training: (I) FreeLB (Zhu et al., 2020a) applies adversarial training to language models during fine-tuning stage to improve generalization. In §4.2, we observe that FreeLB can boost the robustness of language models by a large margin. (II) SMART (Jiang et al., 2020) uses adversarial training as smoothness-inducing regularization and Bregman proximal point optimization during fine-tuning, to improve the generalization and robustness of language models. (III) ALUM (Liu et al., 2020) performs adversarial training in both pre-training and fine-tuning stages, which achieves substantial performance gain on a wide range of NLP tasks. Due to the high computational cost of adversarial training, we compare InfoBERT to ALUM and SMART with the best results reported in the original papers.
Evaluation Metrics We use robust accuracy or robust F1 score to measure how robust the baseline models and InfoBERT are when facing adversarial data. Specifically, robust accuracy is calculated by: Acc = 1|Dadv| ∑ x′∈Dadv 1[arg max qψ(fθ(x
′)) ≡ y], where Dadv is the adversarial dataset, y is the ground-truth label, arg max selects the class with the highest logits and 1(·) is the indicator function. Similarly, robust F1 score is calculated by: F1 = 1|Dadv| ∑ x′∈Dadv v(arg max qψ(fθ(x
′)), a), where v(·, ·) is the F1 score between the true answer a and the predicted answer arg max qψ(fθ(x′)), and arg max selects the answer with the highest probability (see Rajpurkar et al. (2016) for details).
Implementation Details To demonstrate InfoBERT is effective for different language models, we apply InfoBERT to both pretrained RoBERTaLarge and BERTLarge. Since InfoBERT can be applied to both standard training and adversarial training, we here use FreeLB as the adversarial training implementation. InfoBERT is fine-tuned for 2 epochs for the QA task, and 3 epochs for the NLI task. More implementation details such as α, β, ch, cl selection can be found in Appendix A.1.

heading: 4.2 EXPERIMENTAL RESULTS
text: Evaluation on ANLI As ANLI provides an adversarial training dataset, we evaluate models in two settings: 1) training models on benign data (MNLI (Williams et al., 2018) + SNLI (Bowman et al., 2015)) only, which is the case when the adversarial threat model is unknown; 2) training models on both benign and adversarial training data (SNLI+MNLI+ANLI+FeverNLI), which assumes the threat model is known in advance.
Results of the first setting are summarized in Table 1. The vanilla RoBERTa and BERT models perform poorly on the adversarial dataset. In particular, vanilla BERTLarge with standard training achieves the lowest robust accuracy of 26.5% among all the models. We also evaluate the robustness improvement by performing adversarial training during fine-tuning, and observe that adversarial training for language models can improve not only generalization but also robustness. In contrast, InfoBERT substantially improves robust accuracy in both standard and adversarial training. The robust accuracy of InfoBERT through standard training is even higher than the adversarial training baseline FreeLB for both RoBERTa and BERT, while the training time of InfoBERT is 1/3 ∼ 1/2 less than FreeLB. This is mainly because FreeLB requires multiple steps of PGD attacks to generate adversarial examples, while InfoBERT essentially needs only 1-step PGD attack for anchored feature selection.
Results of the second setting are provided in Table 2, which shows InfoBERT can further improve robust accuracy for both standard and adversarial training. Specifically, when combined with adversarial training, InfoBERT achieves the state-of-the-art robust accuracy of 58.3%, outperforming all existing baselines. Note that although ALUM achieves higher accuracy for BERT on the dev set, it tends to overfit on the dev set, therefore performing worse than InfoBERT on the test set.
Evaluation against TextFooler InfoBERT can defend against not only human-crafted adversarial examples (e.g., ANLI) but also those generated by adversarial attacks (e.g., TextFooler). Results are summarized in Table 3. We can see that InfoBERT barely affects model performance on the benign test data, and in the case of adversarial training, InfoBERT even boosts the benign test accuracy. Under the TextFooler attack, the robust accuracy of the vanilla BERT drops to 0.0% on both MNLI and SNLI datasets, while RoBERTa drops from 90% to around 20%. We observe that both adversarial training and InfoBERT with standard training can improve robust accuracy by a comparable large margin, while InfoBERT with adversarial training achieves the best performance among all models, confirming the hypothesis in Theorem 3.2 that combining adversarial training with IB regularizer can further minimize I(X ′i;T ′ i ), leading to better robustness than the vanilla one.
Evaluation on Adversarial SQuAD Previous experiments show that InfoBERT can improve model robustness for NLI tasks. Now we demonstrate that InfoBERT can also be adapted to other NLP tasks such as QA in Table 4. Similar to our observation on NLI dataset, we find that InfoBERT barely hurts the performance on the benign test data, and even improves it in some cases. Moreover, InfoBERT substantially improves model robustness when presented with adversarial QA test sets (AddSent and AddOneSent). While adversarial training does help improve robustness, InfoBERT can further boost the robust performance by a larger margin. In particular, InfoBERT through standard training achieves the state-of-the-art robust F1/EM score as 78.5/72.9 compared to existing adversarial training baselines, and in the meantime requires only half the training time of adversarialtraining-based methods.

heading: 4.3 ANALYSIS OF LOCAL ANCHORED FEATURES
text: We conduct an ablation study to further validate that our anchored feature regularizer indeed filters out nonrobust/unuseful information. As shown in Table 1 and 2, adding adversarial data in the training set can significantly improve model robustness. To find out what helps improve the robustness from the MI perspective, we first calculate the MI between anchored features and global features 1M ∑M j=1 I(Tkj ;Z) on the adversarial test data and benign test data, based on the model trained without adversarial training data (denoted by I ′R and IR). We then calculate the MI between nonrobust/unuseful features and global features 1M ′ ∑M ′ i=1 I(Tki ;Z) on the adversarial test data and
benign data as well (denoted by I ′N and IN). After adding adversarial examples into the training set and re-training the model, we find that the MI between the local features and the global features substantially increases on the adversarial test data, which accounts for the robustness improvement. We also observe that those local anchored features extracted by our anchored feature regularizer, as expected, contribute more to the MI improvement. As shown in Figure 1, the MI improvement of anchored features on adversarial test data ∆I ′R (red bar on the left) is higher than that of nonrobust/unuseful ∆I ′N (red bar on the right), thus confirming that local anchored features discovered by our anchored feature regularizer have a stronger impact on robustness than nonrobust/unuseful ones.
We conduct more ablation studies in Appendix §A.2, including analyzing the individual impact of two regularizers, the difference between global and local features for IB regularizer, hyper-parameter selection strategy and so on.

heading: 5 CONCLUSION
text: In this paper, we propose a novel learning framework InfoBERT from an information theoretic perspective to perform robust fine-tuning over pre-trained language models. Specifically, InfoBERT consists of two novel regularizers to improve the robustness of the learned representations: (a) Information Bottleneck Regularizer, learning to extract the approximated minimal sufficient statistics and denoise the excessive spurious features, and (b) Local Anchored Feature Regularizer, which improves the robustness of global features by aligning them with local anchored features. Supported by our theoretical analysis, InfoBERT provides a principled way to improve the robustness of BERT and RoBERTa against strong adversarial attacks over a variety of NLP tasks, including NLI and QA tasks. Comprehensive experiments demonstrate that InfoBERT outperforms existing baseline methods and achieves new state of the art on different adversarial datasets. We believe this work will shed light on future research directions towards improving the robustness of representation learning for language models.

heading: 6 ACKNOWLEDGEMENT
text: We gratefully thank the anonymous reviewers and meta-reviewers for their constructive feedback. We also thank Julia Hockenmaier, Alexander Schwing, Sanmi Koyejo, Fan Wu, Wei Wang, Pengyu Cheng, and many others for the helpful discussion. This work is partially supported by NSF grant No.1910100, DARPA QED-RML-FP-003, and the Intel RSA 2020.

heading: A APPENDIX
text: A.1 IMPLEMENTATION DETAILS
Model Details1 BERT is a transformer (Vaswani et al., 2017) based model, which is unsupervised pretrained on large corpora. We use BERTLarge-uncased as the baseline model, which has 24 layers, 1024 hidden units, 16 self-attention heads, and 340M parameters. RoBERTaLarge shares the same architecture as BERT, but modifies key hyperparameters, removes the next-sentence pretraining objective and trains with much larger mini-batches and learning rates, which results in higher performance than BERT model on GLUE, RACE and SQuAD.
Standard Training Details For both standard and adversarial training, we fine-tune InfoBERT for 2 epochs on the QA task, and for 3 epochs on the NLI task. The best model is selected based on the performance on the development set. All fine-tuning experiments are run on Nvidia V100 GPUs. For NLI task, we set the batch size to 256, learning rate to 2 × 10−5, max sequence length to 128 and warm-up steps to 1000. For QA task, we set the batch size to 32, learning rate to 3× 10−5 and max sequence length to 384 without warm-up steps.
Adversarial Training Details2 Adversarial training introduces hyper-parameters including adversarial learning rates, number of PGD steps, and adversarial norm. When combing adversarial training with InfoBERT, we use FreeLB as the adversarial training implementation, and set adversarial learning rate to 10−1 or 4∗10−2, adversarial steps to 3, maximal perturbation norm to 3∗10−1 or 2 ∗ 10−1 and initial random perturbation norm to 10−1 or 0.
Information Bottleneck Regularizer Details For information bottleneck, there are different ways to model p(t | x):
1. Assume that p(t | x) is unknown. We use a neural net parameterized by qθ(t | x) to learn the conditional distribution p(t | x). We assume the distribution is a Gaussian distribution. The 1We use the huggingface implementation https://github.com/huggingface/transformers for BERT and RoBERTa. 2We follow the FreeLB implementations in https://github.com/zhuchen03/FreeLB.
neural net qθ will learn the mean and variance of the Gaussian given input x and representation t. By reparameterization trick, the neural net can be backpropagated to approximate the distribution given the training samples.
2. p(t | x) is known. Since t is the representation encoded by BERT, we actually already know the distribution of p. We also denote it as qθ, where θ is the parameter of the BERT encoder fθ. If we assume the conditional distribution is a Gaussian N (ti, σ) for input xi whose mean is the BERT representation ti and variance is a fixed constant σ, the Eq.6 becomes
LLIB = 1
N N∑ i=1
([ log qψ(y (i) | t(i)) ] − β
n∑ k=1 [ − c(σ)||t′(i)k − t (i) k || 2 2 + 1 n N∑ j=1 c(σ)||tj − tk||22 ]) ,
(11)
where c(σ) is a positive constant related to σ. In practice, the sample t′i from the conditional distribution Gaussian N (ti, σ) can be ti with some Gaussian noise, an adversarial examples of ti, or ti itself (assume σ = 0).
We use the second way to model p(t | x) for InfoBERT finally, as it gives higher robustness improvement than the first way empirically (shown in the following §A.2). We suspect that the main reason is because the first way needs to approximate the distribution p(t | x) via another neural net which could present some difficulty in model training.
Information Bottleneck Regularizer also introduces another parameter β to tune the trad-off between representation compression I(Xi;Ti) and predictive power I(Y ;T ). We search for the optimal β via grid search, and set β = 5× 10−2 for RoBERTa, β = 10−3 for BERT on the NLI task. On the QA task, we set β = 5 × 10−5, which is substantially lower than β on NLI tasks, thus containing more word-level features. We think it is mainly because the QA task relies more on the word-level representation to predict the exact answer spans. More ablation results can be found in the following §A.2.
Anchored Feature Regularizer Details Anchored Feature Regularizer uses α to weigh the balance between predictive power and importance of anchored feature. We set α = 5× 10−3 for both NLI and QA tasks. Anchored Feature Regularizer also introduces upper and lower threshold cl and ch for anchored feature extraction. We set ch = 0.9 and cl = 0.5 for the NLI task, and set ch = 0.95 and cl = 0.75 for the QA task. The neural MI estimator used by infoNCE uses two-layer fully connected layer to estimate the MI with the intermediate layer hidden size set to 300.

heading: A.2 ADDITIONAL EXPERIMENTAL RESULTS

heading: A.2.1 ABLATION STUDY ON INFORMATION BOTTLENECK REGULARIZER
text: Modeling p(t | x) As discussed in §A.1, we have two ways to model p(t | x): (i) using an auxiliary neural network to approximate the distribution; (ii) directly using the BERT encoder fθ to calculate the p(t | x). Thus we implemented these two methods and compare the robustness improvement in Table 5. To eliminate other factors such as Anchored Feature Regularizer and adversarial training, we set α = 0, β = 5 × 10−2 and conduct the following ablation experiments via standard training on standard datasets. We observe that although both modeling methods can improve the model robustness, modeling as BERT encoder gives a larger margin than the Auxiliary Net. Moreover, the second way barely sacrifices the performance on benign data, while the first way can hurt the benign accuracy a little bit. Therefore, we use the BERT Encoder fθ to model the p(t | x) in our main paper.
Local Features v.s. Global Features Information Bottlenck Regularizer improves model robustness by reducing I(X;T ). In the main paper, we use T as word-level local features. Here we consider T as sentence-level global features, and compare the robustness improvement with T as local features. To eliminate other factors such as Anchored Feature Regularizer and adversarial training, we set α = 0, β = 5× 10−2 and conduct the following ablation experiments via standard training.
The experimental results are summarized in Table 6. We can see that while both features can boost the model robustness, using local features yield higher robust accuracy improvement than global features, especially when adversarial training dataset is added.
Hyper-parameter Search We perform grid search to find out the optimal β so that the optimal trade-off between representation compression (“minimality”) and predictive power (“sufficiency”) is achieved. An example to search for the optimal β on QA dataset is shown in Fingure 3, which illustrates how β affects the F1 score on benign and adversarial datasets. We can see that from a very small β, both the robust and benign F1 scores increase, demonstrating InfoBERT can improve both robustness and generalization to some extent. When we set β = 5 × 10−5 (log(β) = −9.9), InfoBERT achieves the best benign and adversarial accuracy. When we set a larger β to further minimize I(Xi;Ti), we observe that the benign F1 score starts to drop, indicating the increasingly compressed representation could start to hurt its predictive capability.

heading: A.2.2 ABLATION STUDY ON ANCHORED FEATURE REGULARIZER
text: Visualization of Anchored Words To explore which local anchored features are extracted, we conduct another ablation study to visualize the local anchored words. We follow the best hyperparameters of Anchored Feature Regularizer introduced in §A.1, use the best BERT model trained on benign datasets (MNLI + SNLI) only and test on the ANLI dev set. We visualize the local anchored words in Table 7 as follows. In the first example, we find that Anchored Features mainly focus on the important features such as quantity number “Two”, the verb “playing” and objects “card”/“poker” to make a robust prediction. In the second example, the matching robust features between hypothesis and premise, such as “people”, “roller” v.s. “park”, “flipped upside” v.s. “ride”, are aligned to infer the relationship of hypothesis and premise. These anchored feature examples confirm that Anchored Feature Regularizer is able to find out useful and stable features to improve the robustness of global representation.

heading: A.2.3 ABLATION STUDY ON DISENTANGLING TWO REGULARIZERS
text: To understand how two regularizers contribute to the improvement of robustness separetely, we apply two regularizers individually to both the standard training and adversarial training. We refer InfoBERT trained with IB regularizer only as “InfoBERT (IBR only)” and InfoBERT trained with Anchored Feature Regularizer only as “InfoBERT (AFR only)”. “InfoBERT (Both)” is the standard setting for InfoBERT, where we incorporate both regularizers during training. For “InfoBERT (IBR only)”, we set α = 0 and perform grid search to find the optimal β = 5 × 10−2. Similarly for “InfoBERT (AFR only)”, we set β = 0 and find the optimal parameters as α = 5× 10−3, ch = 0.9 and cl = 0.5.
The results are shown in Table 8. We can see that both regularizers improve the robust accuracy on top of vanilla and FreeLB to a similar margin. Applying one of the regularizer can achieve similar performance of FreeLB, but the training time of InfoBERT is only 1/31̃/2 less than FreeLB. Moreover, after combining both regularizers, we observe that InfoBERT achieves the best robust accuracy.

heading: A.2.4 EXAMPLES OF ADVERSARIAL DATASETS GENERATED BY TEXTFOOLER
text: We show some adversarial examples generated by TextFooler in Table 9. We can see most adversarial examples are of high quality and look valid to human while attacking the NLP models, thus confirming our adversarial dastasets created by TextFooler is a strong benchmark dataset to evaluate model robustness. However, as also noted in Jin et al. (2020), we observe that some adversarial examples look invalid to human For example, in the last example of Table 9, TextFooler replaces “stand” with “position”, losing the critical information that “girls are standing instead of kneeling” and fooling both human and NLP models. Therefore, we expect that InfoBERT should achieve better robustness when we eliminate such invalid adversarial examples during evaluation.

heading: A.3 PROOFS

heading: A.3.1 PROOF OF THEOREM 3.1
text: We first state two lemmas.
Lemma A.1. Given a sequence of random variables X1, X2, ..., Xn and a deterministic function f , then ∀ i, j = 1, 2, ..., n, we have
I(Xi; f(Xi)) ≥ I(Xj ; f(Xi)) (12)
Proof. By the definition,
I(Xi; f(Xi)) = H(f(Xi))−H(f(Xi) | Xi) (13) I(Xj ; f(Xi)) = H(f(Xi))−H(f(Xi) | Xj) (14)
Since f is a deterministic function,
H(f(Xi) | Xi) = 0 (15) H(f(Xi) | Xj) ≥ 0 (16)
Therefore,
I(Xi; f(Xi)) ≥ I(Xj ; f(Xi)) (17)
Lemma A.2. Let X = [X1;X2; ...;Xn] be a sequence of random variables, and T = [T1;T2; ...;Tn] = [f(X1); f(X2); ...; f(Xn)] be a sequence of random variables generated by a deterministic function f . Then we have
I(X;T ) ≤ n n∑ i=1 I(Xi;Ti) (18)
Proof. Since X = [X1;X2; ...;Xn] and T = [T1;T2; ...;Tn] are language tokens with its corresponding local representations, we have
I(X;T ) = I(X;T1, T2, ..., Tn) = n∑ i=1 [H(Ti | T1, T2, ..., Ti−1)−H(Ti | X,T1, T2, ..., Ti−1)]
(19)
≤ n∑ i=1 [H(Ti)−H(Ti | X)] = n∑ i=1 I(X;Ti) (20)
≤ n∑ i=1 n∑ j=1 I(Xj ;Ti) ≤ n n∑ i=1 I(Xi;Ti), (21)
where the first inequality follows because conditioning reduces entropy, and the last inequality is because I(Xi;Ti) ≥ I(Xj ;Ti) based on Lemma A.1.
Then we directly plug Lemma A.2 into Theorem 3.1, we have the lower bound of LIB as
I(Y ;T )− βI(X;T ) ≥ I(Y ;T )− nβ n∑ i=1 I(Xi;Ti). (22)

heading: A.3.2 PROOF OF THEOREM 3.2
text: We first state an easily proven lemma,
Lemma A.3. For any a, b ∈ [0, 1],
|a log(a)− b log(b)| ≤ φ(|a− b|), (23)
where φ(·) : R+ → R+ is defined as
φ(x) =  0 x = 0 x log( 1x ) 0 < x < 1 e
1 e x > 1 e
. (24)
It is easy to verify that φ(x) is a continuous, monotonically increasing, concave and subadditive function.
Now, we can proceed with the proof of Theorem 3.2.
Proof. We use the fact that
|I(Y ;T )− I(Y ;T ′)| ≤ |H(T | Y )−H(T ′ | Y )|+ |H(T )−H(T ′)| (25)
and bound each of the summands on the right separately.
We can bound the first summand as follows: |H(T | Y )−H(T ′ | Y )| ≤ ∑ y p(y)|H(T | Y = y)−H(T ′ | Y = y)| (26)
= ∑ y p(y)| ∑ t p(t | y) log(1/p(t | y))− ∑ t q(t | y) log(1/q(t | y))| (27)
≤ ∑ y p(y) ∑ t |p(t | y) log p(t | y)− q(t | y) log q(t | y)| (28)
≤ ∑ y p(y) ∑ t φ(|p(t | y)− q(t | y)|) (29)
= ∑ y p(y) ∑ t φ(| ∑ x p(t | x)[p(x | y)− q(x | y)]|), (30)
where
p(x | y) = p(y | x)p(x)∑ x p(y | x)p(x)
(31)
q(x | y) = p(y | x)q(x)∑ x p(y | x)q(x) . (32)
Since ∑ x∈X∪X ′ p(x | y)− q(x | y) = 0 for any y ∈ Y , we have that for any scalar a,
| ∑ x p(t | x)[p(x | y)− q(x | y)])| (33)
= | ∑ x (p(t | x)− a)(p(x | y)− q(x | y))| (34)
≤ √∑
x
(p(t | x)− a)2 √∑
x
(p(x | y)− q(x | y))2. (35)
Setting a = 1|X−X ′| ∑ x∈X∪X ′ p(t | x) we get
|H(T | Y )−H(T ′ | Y ) ≤ ∑ y p(y) ∑ t φ (√ V (p(t | x ∈ X ∪ X ′) · ||p(x | y)− q(x | y)||2 ) ,
(36)
where for any real-value vector a = (a1, ..., an), V (a) is defined to be proportional to the variance of elements of a:
V (a) = n∑ i=1 (ai − 1 n n∑ j=1 aj) 2, (37)
p(t | x ∈ X ∪ X ′) stands for the vector in which entries are p(t | x) with different values of x ∈ X ∪X ′ for a fixed t, and p(x | y) and q(x | y) are the vectors in which entries are p(x | y) and q(x | y), respectively, with different values of x ∈ X ∪ X ′ for a fixed y. Since
||p(x | y)− q(x | y)||2 ≤ ||p(x | y)− q(x | y)||1 ≤ 2, (38)
it follows that
|H(T | Y )−H(T ′ | Y )| ≤ ∑ y p(y) ∑ t φ ( 2 √ V (p(t | x ∈ X ∪ X ′)) ) (39)
Moreover, we have
√ V (p(t | x ∈ X ∪ X ′) ≤ √ V (p(t | x ∈ X )) + V (p(t | x ∈ X ′)) (40)
≤ √ V (p(t | x ∈ X )) + √ V (p(t | x ∈ X ′)), (41)
where the first inequality is because sample mean is the minimizer of the sum of the squared distances to each sample and the second inequality is due to the subadditivity of the square root function. Using the fact that φ(·) is monotonically increasing and subadditive, we get
|H(T | Y )−H(T ′ | Y )| ≤ ∑ y p(y) ∑ t φ ( 2 √ V (p(t | x ∈ X )) ) + ∑ y p(y) ∑ t φ ( 2 √ V (p(t | x ∈ X ′)) ) (42)
Now we explicate the process for establishing the bound for ∑ y p(y) ∑ t φ ( 2 √ V (p(t | x ∈ X )) ) and the one for ∑ y p(y) ∑ t φ ( 2 √ V (p(t | x ∈ X ′)) ) can be similarly derived.
By definition of V (·) and using Bayes’ theorem p(t | x) = p(t)p(x|t)p(x) for x ∈ X , we have that
√ V (p(t | x ∈ X )) = p(t) √∑ x∈X (p(x | t) p(x) − 1 |X | ∑ x′∈X p(x′ | t) p(x′) ) 2 (43)
Denoting 1 = (1, ..., 1), we have by the triangle inequality that√∑ x∈X (p(x | t) p(x) − 1 |X | ∑ x′∈X p(x′ | t) p(x′) ) 2 (44)
≤ ||p(x | t) p(x) − 1||2 + √∑ x∈X ( 1− 1 |X | ∑ x′∈X p(x′ | t) p(x′) ) 2 (45)
= ||p(x | t) p(x) − 1||2 + √ |X | ( 1− 1 |X | ∑ x′∈X p(x′ | t) p(x′) ) 2 (46)
= ||p(x | t) p(x)
− 1||2 + √ 1 |X | ( |X | − ∑ x′∈X p(x′ | t) p(x′) ) 2 (47)
= ||p(x | t) p(x) − 1||2 + 1√ |X | | ∑ x′∈X (1− p(x ′ | t) p(x′) )| (48)
≤ ||p(x | t) p(x) − 1||2 + 1√ |X | ||p(x | t) p(x) − 1||1 (49) ≤ (1 + 1√ |X | )||p(x | t) p(x) − 1||1 (50)
≤ 2 minx∈X p(x) ||p(x | t)− p(x)||1 (51)
From an inequality linking KL-divergence and the l1 norm, we have that ||p(x | t)− p(x)||1 ≤ √
2 log(2)DKL[p(x | t)||p(x)] (52) Plugging Eq. (52) into Eq. (51) and using Eq. (43), we have the following bound:√
V (p(t | x ∈ X )) ≤ B 2 p(t)
√ dt, (53)
where B = 4 √ 2 log(2)
minx∈X p(x) and dt = DKL[p(x | t)||p(x)].
We will first proceed the proof under the assumption that Bp(t) √ dt ≤ 1e for any t. We will later see
that this condition can be discarded. If Bp(t) √ dt ≤ 1e , then∑
t
φ ( 2 √ V (p(t | x ∈ X )) ) (54)
≤ ∑ t Bp(t) √ dt ( log( 1 B ) + log( 1 p(t)dt ) )
(55)
= B log( 1 B ) ∑ t p(t) √ dt +B ∑ t p(t) √ dt log( 1 p(t)dt ) (56)
≤ B log( 1 B
)||p(t) √ dt||1 +B|| √ p(t) √ dt||1, (57)
where the last inequality is due to an easily proven fact that for any x > 0, x log( 1x ) ≤ √ x. We p(t) and d(t) are vectors comprising p(t) and dt with different values of t, respectively.
Using the following two inequalities: ||p(t) √ dt||1 ≤ √ |T |||p(t) √ dt||2 ≤ √ |T ||| √ p(t)dt||2 (58)
and
|| √ p(t) √ dt||1 ≤ √ |T ||| √ p(t) √ dt||2 (59)
= √ T √ ||p(t) √ dt||1 ≤ |T |3/4 √ || √ p(t)dt||2 (60)
we have∑ t φ ( 2 √ V (p(t | x ∈ X )) ) ≤ B log( 1 B ) √ |T ||| √ p(t)dt||2 +B|T |3/4 √ || √ p(t)dt||2. (61)
Using the equality
|| √ p(t)dt||2 = √ E[DKL[p(x|t)||p(x)]] = √ I(X;T ), (62)
we reach the following bound∑ t φ ( 2 √ V (p(t | x ∈ X )) ) (63)
≤ B log( 1 B )|T |1/2I(X;T )1/2 +B|T |3/4I(X;T )1/4. (64)
Plug Lemma A.2 into the equation above, we have∑ t φ ( 2 √ V (p(t | x ∈ X )) ) (65)
≤ B log( 1 B )|T |1/2(n n∑ i=1 I(Xi;Ti)) 1/2 +B|T |3/4(n n∑ i=1 I(Xi;Ti)) 1/4 (66)
≤ √ nB log( 1
B )|T |1/2 n∑ i=1 I(Xi;Ti) 1/2 + n1/4B|T |3/4 n∑ i=1 I(Xi;Ti) 1/4 (67)
We now show the bound is trivial if the assumption that Bp(t) √ dt ≤ 1e does not hold. If the
assumption does not hold, then there exists a t such that Bp(t) √ dt >
1 e . Since√
I(X;T ) = √∑ t p(t)dt ≥ ∑ t p(t) √ dt ≥ p(t) √ dt (68)
for any t, we get that √ I(X;T ) ≥ 1eB . Since |T | ≥ 1 and C ≥ 0, we get that our bound in Eq. (63) is at least
B log( 1
B )|T |1/2I(X;T )1/2 +B|T |3/4I(X;T )1/4 (69)
≥ √ |T |( log(1/B)
e + B1/2|T |1/4 e1/2 ) (70)
Let f(c) = log(1/c)e + c1/2|T |1/4 e1/2 . It can be verifed that f ′(c) > 0 if c > 0. Since B > 4
√ 2 log(2)
by the definition of B, we have f(B) > f(4 √ 2 log(2)) > 0.746. Therefore, we have
B log( 1
B )|T |1/2I(X;T )1/2 +B|T |3/4I(X;T )1/4 (71) ≥ 0.746 √ |T | ≥ log(|T |) (72)
Therefore, if indeed Bp(t) √ dt > 1 e for some t, then the bound in Eq. (63) is trivially
true, since H(T | Y ) is within [0, log(|T |)]. Similarly, we can establish a bound for∑ t φ ( 2 √ V (p(t | x ∈ X ′)) ) as follows:∑
t
φ ( 2 √ V (p(t | x ∈ X ′)) ) ≤ √ nB′ log( 1
B′ )|T |1/2 n∑ i=1 I(X ′i;T ′ i ) 1/2 + n1/4B′|T |3/4 n∑ i=1 I(X ′i;T ′ i ) 1/4,
(73)
where B′ = 4 √ 2 log(2)
minx∈X′ q(x) .
Plugging Eq. (73) and Eq. (65) into Eq. (42), we get
|H(T | Y )−H(T ′ | Y )| ≤ √ nB log( 1
B )|T |1/2 n∑ i=1 I(Xi;Ti) 1/2 + n1/4B|T |3/4 n∑ i=1 I(Xi;Ti) 1/4+
√ nB′ log( 1
B′ )|T |1/2 n∑ i=1 I(X ′i;T ′ i ) 1/2 + n1/4B′|T |3/4 n∑ i=1 I(X ′i;T ′ i ) 1/4
(74)
Now we turn to the third summand in Eq. (25), we have to bound |H(T )−H(T ′)|. Recall the definition of -bounded adversarial example. We denote the set of the benign data representation t that are within the -ball of t′ by Q(t′). Then for any t ∈ Q(t′), we have
||t′i − ti|| ≤ , (75)
for i = 1, 2, ..., n. We also denote the number of the -bounded adversarial examples around the benign representation t by c(t). Then we have the distribution of adversarial representation t′ as follows:
q(t′) = ∑
t∈Q(t′)
p(t) c(t) (76)
|H(T )−H(T ′)| (77) = | ∑ t p(t) log p(t)− ∑ t′ q(t′) log q(t′)| (78)
= | ∑ t p(t) log p(t)− ∑ t′ [ ( ∑ t∈Q(t′) p(t) c(t) ) log( ∑ t∈Q(t′) p(t) c(t) ) ] | (79)
≤ | ∑ t p(t) log p(t)− ∑ t′ ∑ t∈Q(t′) p(t) c(t) log( p(t) c(t) )| (80)
= | ∑ t p(t) log p(t)− ∑ t c(t) p(t) c(t) log( p(t) c(t) )| (81)
= | ∑ t p(t) log c(t)|, (82)
where the inequality is by log sum inequality. If we denote the C = maxt c(t) which is the maximum number of -bounded textual adversarial examples given a benign representation t of a word sequence x, we have
|H(T )−H(T ′)| (83) ≤ | ∑ t p(t) log c(t)| (84)
≤ | ∑ t p(t) logC| = logC. (85)
Note that given a word sequence x of n with representation t, the number of -bounded textual adversarial examples c(t) is finite given a finite vocabulary size. Therefore, if each word has at most k candidate word perturbations, then logC ≤ n log k can be viewed as some constants depending only on n and .
Now, combining Eq. (25), Eq. (74) and Eq. (85), we prove the bound in Theorem 3.2.

Review summaries:
This work (InfoBERT) proposes additional objectives for transformer finetuning to obtain models more robust to adversarial inputs. The authors first propose a mutual information based information bottleneck objective, next the authors propose an adversarial loss inspired method for identifying robust features and a subsequent objective to emphasize the mutual information between global representations and these robust features. The experiments demonstrate that InfoBERT consistently outperforms other adversarial training approaches on a variety of adversarial evaluations.