SlowGuess/NAACL_2022_OCR huggingface dataset:
Test Transformation Name	Failure Rate (%)	Dataset Size Reduction (%)
D	D+COVER	D+MNCOVER	ΔD+MNCOVER	D+COVER	D+MNCOVER
change names	5.14	100.0016.86	100.0016.86	94.8611.73	62.84	62.84
add negative phrases	6.80	100.0019.16	99.3419.16	92.5412.36	75.40	75.99
protected: race	68.00	100.0073.02	99.3772.13	31.374.13	44.33	43.54
used to,but now	29.87	53.3046.27	53.3046.75	23.4316.88	84.61	84.61
protected: sexual	86.83	100.0087.31	100.0088.99	13.172.15	83.83	86.83
change locations	8.69	21.438.31	21.438.31	12.74-0.38	86.47	86.93
change neutral words with BERT	9.80	20.0013.04	20.8413.39	11.043.59	73.40	73.88
contractions	2.90	5.523.94	8.224.34	5.321.44	34.80	34.80
2 typos	11.60	18.0011.14	16.0010.87	4.40-0.73	10.00	10.00
change numbers	3.20	7.143.94	7.143.29	3.940.09	87.70	88.44
typos	6.60	10.006.45	10.006.24	3.40-0.36	10.00	10.00
neutral words in context	96.73	100.0096.91	100.0096.82	3.270.09	21.33	28.50
protected: religion	96.83	100.0093.42	100.0098.02	3.171.19	89.67	89.67
add random urls and handles	15.40	14.639.17	17.8611.56	2.46-3.84	87.60	87.60
simple negations: not neutral is still neutral	97.93	100.0098.49	100.0098.34	2.070.41	45.67	46.03
simple negations: not negative	10.40	12.009.56	12.429.90	2.02-0.50	80.11	80.37
my opinion is what matters	41.53	42.4936.79	43.1436.79	1.61-4.74	84.16	84.32
punctuation	5.40	6.805.37	6.806.26	1.400.86	10.00	9.11
Q & A: yes	0.40	1.330.50	1.710.49	1.310.09	82.33	83.14
Q & A: no	85.20	86.3376.42	86.2277.16	1.02-8.04	82.34	83.12
simple negations: negative	6.13	7.335.63	7.125.70	0.99-0.44	78.63	78.71
reducers	0.13	0.270.10	1.030.10	0.90-0.03	67.00	66.77
intensifiers	1.33	1.050.31	1.831.01	0.49-0.33	66.65	66.96
Average Improvement	-	13.511.10	13.781.55	13.781.55	62.99	63.57
Table 1: Failure Rate(%) obtained using BERT model on the original dataset  $D$ , the dataset filtered using COVER coverage (D+COVER columns) and the dataset filtered with MNCOVER coverage (D+MNCOVER columns) from the Sentiment Test Suite. We report both the max failure rate as well as the mean in the subscript across 10 thresholds of coverage. Rows are sorted regarding the failure rate difference between the dataset filtered using MNCOVER and the original dataset (column  $\Delta_{D + \mathrm{MNCOVER}}$ ).
across all 23 transformation on SST-2 dataset. On average, both MNCOVER and COVER can help reduce more than  $60\%$  of the test suite size, and MNCOVER achieves a slight advantage over COVER. In Table 2, when using RoBERTa model, MNCOVER based filtering wins over the original dataset in 21 of 23 cases. The average improvement of MNCOVER regarding error detection is  $7.29\%$  on RoBERTa model and  $13.78\%$  on BERT model. We include similar results on QQP dataset in Table 6.
4.2 Experiment 2: Achieving Higher Dataset Coverage with Fewer Data Points
Motivation We revisit the question: given a test generation strategy, does adding more test samples necessarily add more information? In this set of experiments, we appeal to the software engineering notion of "coverage" as a metric of test adequacy. We show that we can reach a target level of test adequacy faster, i.e. a higher coverage, hence achieving more rigorous behavior testing, with fewer test examples, by using coverage as an indicator of redundant test samples.
Setup: We use the training set as seed examples and generate samples using transformations used in the previous experiment listed in Table 1. Similar to the previous set of examples, we disregard an example if the increase in its coverage is below threshold. We vary these threshold values  $\in \{1e - 04, 1e - 03, 1e - 02, 1e - 01, 0.0\}$ . Higher the threshold, more number of examples get fil
tered out.
Results: In Figure 4, we show that using our coverage guided filtering strategy, we are able to achieve coverage with a fewer number of samples than without coverage based filtering. Even with a threshold of 0.0, we are able to significantly reduce the number of samples that achieve the same coverage as the unfiltered set: we are able to achieve an average reduction across transformations (higher the better) of  $71.17\%$ ,  $45.94\%$ ,  $28.52\%$ ,  $11.33\%$  and  $2.83\%$  for  $\{0.0, 1e - 04, 1e - 03, 1e - 02, 1e - 01\}$  thresholds respectively.
4.3 Experiment 3: MNCOVER as a Metric to Evaluate Testing Benchmarks
Motivation: In this set of experiments, we utilize coverage as a test/benchmark dataset evaluation measure. Static test suites, such as the GLUE benchmark, saturate and become obsolete as models become more advanced. To mitigate the saturation of static benchmarks with model advancement, (Kiela et al., 2021) introduced Dynabench, a dynamic benchmark for Natural Language Inference(NLI). Dynabench introduced a novel human-and-model-in-the-loop dataset, consisting of three rounds that progressively increase in difficulty and complexity. This results in three sets of training, validation and test datasets, with increasing complexity testing datasets. We use MNCOVER as an additional validation measure for the datasets.
Test Transformation Name	Failure Rate (%)	Dataset Size Reduction (%)
D	D+COVER	D+MNCOVER	ΔD+MNCOVER	D+COVER	D+MNCOVER
Q & A: yes	46.20	100.0051.45	100.0051.45	53.805.25	82.37	81.58
protected: race	61.67	100.0066.00	100.0066.00	38.334.34	44.33	44.33
neutral words in context	80.87	100.0083.43	100.0083.31	19.132.44	21.27	21.39
protected: religion	73.00	74.1962.31	85.7163.64	12.71-9.36	89.67	89.67
protected: sexual	91.00	100.0084.25	100.0084.25	9.00-6.75	83.83	83.83
simple negations: not neutral is still neutral	91.53	100.0092.93	100.0092.24	8.470.71	45.87	46.11
add negative phrases	29.60	36.4623.15	36.7223.15	7.12-6.45	75.40	75.40
Q & A: no	57.53	61.6753.60	62.4153.60	4.87-3.93	82.31	82.31
simple negations: not negative	95.40	100.0096.11	100.0095.92	4.600.52	80.14	80.27
2 typos	5.20	6.405.10	7.335.33	2.130.13	10.00	10.00
change neutral words with BERT	9.20	11.117.81	11.117.48	1.91-1.72	73.40	72.45
intensifiers	1.13	2.681.69	2.681.87	1.550.73	66.65	66.46
change names	4.53	4.882.57	5.812.37	1.28-2.16	62.84	62.84
punctuation	4.80	6.004.03	6.003.96	1.20-0.84	10.00	10.00
change locations	6.16	7.325.28	7.324.44	1.16-1.72	86.47	87.43
typos	3.00	3.601.90	4.002.39	1.00-0.61	10.00	10.00
simple negations: negative	1.33	2.001.07	1.991.20	0.65-0.13	78.63	78.68
used to,but now	52.73	53.3046.27	53.3045.58	0.56-7.16	84.61	83.74
my opinion is what matters	56.47	59.0050.32	56.8649.87	0.39-6.60	84.20	84.20
contractions	1.00	1.370.74	1.370.63	0.37-0.37	34.80	34.80
reducers	0.40	0.340.14	0.570.27	0.17-0.13	67.05	66.35
change numbers	2.50	1.630.48	2.410.72	-0.09-1.78	87.70	87.70
add random urls and handles	11.40	8.335.22	8.654.55	-2.75-6.85	87.60	88.18
Average Improvement	-	6.68-1.10	7.29-1.85	7.29-1.85	63.01	62.95
Table 2: Failure Rate(%) obtained using RoBERTa model on the original dataset  $D$ , the dataset filtered using COVER coverage (D+COVER columns) and the dataset filtered with MNCOVER coverage (D+MNCOVER columns) from the Sentiment Test Suite. We report both the max failure rate as well as the mean in the subscript across 10 thresholds of coverage. Rows are sorted regarding the failure rate difference between the dataset filtered using MNCOVER and the original dataset (column  $\Delta_{D + \mathrm{MNCOVER}}$ ).
Test Set	MNCOVER
A1	0.175
A1 + A2	0.182
A1 + A2 + A3	0.185
A2	0.179
A3	0.181
Table 3: MNCOVER Values on the Dynabench test sets
Setup: We test the ROBERTA-Large model provided by Dynabench trained on training data from all three rounds of the benchmark. We use 10 as the number of bins and  $\lambda = 1.0$ .
Results: We measure coverage achieved by each of the test sets individually as well as in combination. We have summarized the results in Table 3. The test sets indeed provide more novel test inputs to the model as indicated by the increasing coverage as the test sets from each split are taken into consideration. The low values arise from a large architecture, (24-layer, 1024-hidden, 16-heads) that is potentially still unexplored with 1000 samples from each test set.
4.4 Experiment 4: Coverage Guided Augmentation
Motivation: Data augmentation refers to strategies for increasing the diversity of training examples without explicitly collecting new data. This is usually achieved by transforming training examples using a transformation. A number of automated
approaches have been proposed to automatically select these transformations including like (Xie et al., 2019). Since computing MNCOVER does not require retraining, and the input selection can indicate the usefulness of a new sample, we propose to use MNCOVER to select transformed samples, in order to add them into the training set for improving test accuracy.
Setup: In this set of experiments, we focus on using coverage to guide generation of augmented samples. We propose a greedy search algorithm to coverage as guide to generate a new training set with selected augmentations. The procedure is described in Algorithm 1 and is motivated by a similar procedure from (Tian et al., 2018). This is a coverage-guided greedy search technique for efficiently finding combinations of transformations that result in higher coverage. We use transformations described in Section (A.3) and BERT model pretrained on the datasets.
We then add the coverage selected samples into the training set and retrain a target model. Using BERT model as base, Table 4 shows the test accuracy, when with or without adding the selected samples into the training set. We also show the size of the augmentation set. Our results show that using MNCOVER to guide data augmentation can improve test accuracy in both SST-2 and QQP.
Figure 4: MNCOVER is able to achieve higher coverage with a fewer number of samples than without coverage based filtering. For this experiment we use the RoBERTa model. In the top row, we do not shuffle the examples and the bottom row with shuffling. Even with a threshold of 0.0, we are able to significantly reduce the number of samples that achieve the same coverage as the unfiltered set: we are able to achieve an average reduction (across transformations) of  $28.83\%$ ,  $54.06\%$ ,  $71.48\%$ ,  $88.67\%$  and  $97.17\%$  for  $\{0.0, 1e - 04, 1e - 03, 1e - 02, 1e - 01\}$  thresholds respectively.
Dataset	Coverage Threshold	Test Accuracy	Size of Augmented Set
SST-2	Baseline	90.22	0
Random	90.45	6541
MNCOVER	90.41	6541
QQP	Baseline	90.91	0
Random	90.96	14005
MNCOVER	91.03	14005
Table 4: The test accuracy after adding the augmented set generated using coverage guidance to the training set on SST-2 and QQP dataset.
Our work connects to a few topics in the literature. Testing for Natural Language Processing Recent literature has shown that deep learning models often exhibit unexpectedly poor behavior when deployed "in the wild". This has led to a growing interest in testing NLP models. The pioneering work in this domain is CHECKLIST (Ribeiro et al., 2020), that provides a behavioral testing template for deep NLP models. A different paradigm is proposing more thorough and extensive evaluation sets. For example, (Kiela et al., 2021) and (Koh et al., 2021) proposed new test sets reflecting distribution shifts that naturally arise in real-world language applications. On a similar line, (Belinkov and Glass, 2019; Naik et al., 2018) introduced challenge set based testing. Another line of work has focused on perturbation techniques for evaluating models, such as logical consistency (Ribeiro et al., 2019), robustness to noise (Belinkov and Bisk, 2017), name changes (Prabhakaran et al., 2019), and adversaries (Ribeiro et al., 2018).
Subset Selection Our MNCOVER can be used as a guide for filtering test inputs, and hence is a data selection approach. Previous work has looked at finding representative samples from training and/or interpretation perspectives. For example, submodular optimization from (Lin and Bilmes, 2009, 2010) provides a framework for selecting examples that minimize redundancy with each other to select representative subsets from large data sets. These methods are part of the "training the model" stage, targeting to achieve higher accuracy with fewer training samples. Moreover, Influence Functions from (Koh and Liang, 2020) provide a strategy to interpret black box models by discovering important representative training samples. The influence function can explain and attribute a model's prediction back to its training samples. Differently, MNCOVER is a test suite evaluation approach.
This paper proposes MNCOVER to perform white-box coverage-based behavior testing on NLP models. We design MNCOVER to consider Transformer models' properties, focusing on essential words and important word combinations. Filtering test sets using the MNCOVER helps us reduce the test suite size and improve error detection rates. We also demonstrate that MNCOVER serves as a practical criterion for evaluating the quality of test sets. It can also help generate augmented training data to improve the model's generalization.
Yonatan Belinkov and Yonatan Bisk. 2017. Synthetic and natural noise both break neural machine translation. arXiv preprint arXiv:1711.02173.
Yonatan Belinkov and James Glass. 2019. Analysis methods in neural language processing: A survey. Transactions of the Association for Computational Linguistics, 7:49-72.
Rishi Bommasani, Drew A Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, et al. 2021. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding.
Swaroopa Dola, Matthew B. Dwyer, and Mary Lou Soffa. 2021. Distribution-aware testing of neural networks using generative models. In 43rd IEEE/ACM International Conference on Software Engineering. To appear.
Eric Jang, Shixiang Gu, and Ben Poole. 2016. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144.
Douwe Kiela, Max Bartolo, Yixin Nie, Divyansh Kaushik, Atticus Geiger, Zhengxuan Wu, Bertie Vidgen, Grusha Prasad, Amanpreet Singh, Pratik Ringshia, et al. 2021. Dynabench: Rethinking benchmarking in nlp. arXiv preprint arXiv:2104.14337.
Thomas N Kipf and Max Welling. 2016. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907.
Pang Wei Koh and Percy Liang. 2020. Understanding black-box predictions via influence functions.
Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, et al. 2021. Wilds: A benchmark of in-the-wild distribution shifts. In International Conference on Machine Learning, pages 5637-5664. PMLR.
Hui Lin and Jeff Bilmes. 2009. How to select a good training-data subset for transcription: Submodular active selection for sequences. Technical report, WASHINGTON UNIV SEATTL DEPT OF ELECTRICAL ENGINEERING.
Hui Lin and Jeff Bilmes. 2010. An application of the submodular principal partition to training data subset selection. In NIPS workshop on Discrete Optimization in Machine Learning. CiteSeer.
Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692.
Lei Ma, Felix Juefei-Xu, Fuyuan Zhang, Jiyuan Sun, Minhui Xue, Bo Li, Chunyang Chen, Ting Su, Li Li, Yang Liu, et al. 2018a. Deepgaue: Multigranularity testing criteria for deep learning systems. In Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering, pages 120-131.
Lei Ma, Fuyuan Zhang, Minhui Xue, Bo Li, Yang Liu, Jianjun Zhao, and Yadong Wang. 2018b. Combinatorial testing for deep learning systems. arXiv preprint arXiv:1806.07723.
John X. 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.
Aakanksha Naik, Abhilasha Ravichander, Norman Sadeh, Carolyn Rose, and Graham Neubig. 2018. Stress test evaluation for natural language inference. arXiv preprint arXiv:1806.00692.
Kexin Pei, Yinzhi Cao, Junfeng Yang, and Suman Jana. 2017. Deepxplore: Automated whitebox testing of deep learning systems. In proceedings of the 26th Symposium on Operating Systems Principles, pages 1-18.
Vinodkumar Prabhakaran, Ben Hutchinson, and Margaret Mitchell. 2019. Perturbation sensitivity analysis to detect unintended model biases. arXiv preprint arXiv:1910.04210.
Danilo Rezende and Shakir Mohamed. 2015. Variational inference with normalizing flows. In International conference on machine learning, pages 1530-1538. PMLR.
Marco Tulio Ribeiro, Carlos Guestrin, and Sameer Singh. 2019. Are red roses red? evaluating consistency of question-answering models. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6174-6184.
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. 2018. Semantically equivalent adversarial rules for debugging nlp models. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 856-865.
Marco Tulio Ribeiro, Tongshuang Wu, Carlos Guestrin, and Sameer Singh. 2020. Beyond accuracy: Behavioral testing of nlp models with checklist.
Yuchi Tian, Kexin Pei, Suman Jana, and Baishakhi Ray. 2018. Deeptest: Automated testing of deep-neural network-driven autonomous cars. In Proceedings of the 40th international conference on software engineering, pages 303-314.
Qizhe Xie, Zihang Dai, Eduard Hovy, Minh-Thang Luong, and Quoc V Le. 2019. Unsupervised data augmentation for consistency training. arXiv preprint arXiv:1904.12848.
A.1 Deriving How Two Masks are Used
To learn these global masks, we update each preloaded word embedding  $\mathbf{x}_i\forall i\in \{1,\dots ,L\}$  using embeddings from words that interact with  $\mathbf{x}_i$  as defined by the learnt interaction matrix  $\mathbf{M}_{A\mathbf{x}}$ . Specifically, to get interaction-based word composition, we use the following formulation:
$$
\mathbf {e} _ {i} ^ {\prime} = \left(\mathbf {e} _ {i} + g \left(\mathbf {M} _ {A [ \mathbf {x} _ {i}, : ]}, \mathbf {E}\right)\right) \tag {10}
$$
Here,  $\mathbf{e}_i^{\prime}$  is the updated word embedding for token  $\mathbf{x}_i$  after taking into account its interaction scores with other words in the sentence  $\mathbf{E} = [\mathbf{e}_1,\dots ,\mathbf{e}_L]$ . This is motivated from the message passing paradigm from (Kipf and Welling, 2016), where we treat each word in a sentence as a node in a graph. Using Equation 10, we effectively augment a word's embedding using information from words it interacts with. Note that we normalize  $\mathbf{M}_{A\mathbf{x}}$ , using  $\mathbf{D}^{-1 / 2}\mathbf{M}_{A\mathbf{x}}\mathbf{D}^{-1 / 2}$ , where  $\mathbf{D}$  is the diagonal node degree matrix for  $\mathbf{M}_{A\mathbf{x}}$ .  $g(\mathbf{M}_{A\mathbf{x}},\mathbf{e}_{\{j\}})\forall j\in \{1,\ldots ,L\}$  is the aggregation function. Equation 10 formulation represents words and their local sentence level neighborhoods' aggregated embeddings. Specifically, we use  $g(\mathbf{M}_{A\mathbf{x}},\mathbf{E}_{\mathbf{x}}) = h(\mathbf{M}_{A\mathbf{x}}\mathbf{E}_{\mathbf{x}})$ . Here,  $h$  is a nonlinearity function, we use the ReLU non linearity. Simplifying our interaction based aggregation, if two words  $x_{i},x_{j}$  are related in a sentence, we represent each word using  $\mathbf{e}_i^{\prime} = (\mathbf{e}_i + \sigma (a_{ij}(\mathbf{e}_i + \mathbf{e}_j)))$ . Similarly,  $\mathbf{e}_j^{\prime} = (\mathbf{e}_j + \sigma (a_{ji}(\mathbf{e}_i + \mathbf{e}_j)))$ . Further, to select words based on interactions, we add a word level mask  $\mathbf{M}_W$  after the word embeddings, where  $\mathbf{M}_W = [\mathbf{M}_{W\mathbf{x}_1},\dots ,\mathbf{M}_{W\mathbf{x}_L}]$ .
$\mathbf{z}_i = \mathbf{M}_{W_i}*\mathbf{e}_i'$ , where  $\tilde{\mathbf{M}}_{W_i}\in \{0,1\}$  is a binary random variable.  $\mathbf{Z} = [\mathbf{z}_1,\dots ,\mathbf{z}_L]$  represents word level embeddings input into a model for a specific input sentence after passing through the bottleneck layer.
A.2 Deriving the Loss
We introduce a bottleneck loss:
$$
\ell_ {I B} = \max  _ {\mathbf {Z}} I (\mathbf {Z}; \mathbf {Y}) - \beta I (\mathbf {Z}; \mathbf {X}) \tag {11}
$$
Given  $X$ , we assume  $\mathbf{E}'$  and  $\mathbf{M}_W$  are independent of each other. We write  $q(\mathbf{Z}|\mathbf{X}) = q(\mathbf{M}_W|\mathbf{X})q(\mathbf{E}'|\mathbf{X})$ . From Equation 10,  $\mathbf{e}_i' = \mathbf{e}_i + \mathrm{ReLU}(\mathbf{M}_{A\mathbf{x}}\mathbf{E}_{[1,\dots,L]})$ .  $q(\mathbf{E}'|\mathbf{X})$  can be written as  $q(\mathbf{M}_{A\mathbf{x}}|\mathbf{X})$ .
The lower bound to be maximized is:
$$
\begin{array}{l} \mathcal {L} = \mathbb {E} _ {q (\mathbf {Z} | \mathbf {x} ^ {m})} \log (p (\mathbf {y} ^ {m} | \mathbf {M} _ {W}, \mathbf {M} _ {A}, \mathbf {x} ^ {m})) \\ - \beta_ {i} K L (q (\mathbf {M} _ {W} | \mathbf {x} ^ {m}) | | p _ {r 0} (\mathbf {M} _ {W})) \tag {12} \\ - \beta_ {g} K L (q (\mathbf {M} _ {A} | \mathbf {x} ^ {m}) | | p _ {a 0} (\mathbf {M} _ {A})) \\ \end{array}
$$
We use the bernoulli distribution prior (a non informative prior) for each word-pair interaction  $q_{\phi}[\mathbf{M}_{A x_i,x_j}|\mathbf{x}_i,\mathbf{x}_j]$ .  $p_{a0}(\mathbf{M}_{A x}) = \prod_{i = 1}^{L}\prod_{j = 1}^{L}p_{a0}(\mathbf{M}_{A\mathbf{x}_i,\mathbf{x}_j})$  hence  $p_{a0}(\mathbf{M}_{A x_i,x_j}) = Bernoulli(0.5)$ . This leads to:
$$
\begin{array}{l} \beta_ {g} K L \left(q \left(\mathbf {M} _ {A \mathbf {x}} \mid \mathbf {x} ^ {m}\right) \mid \mid p _ {a 0} (\mathbf {M} _ {A})\right) = \tag {13} \\ - \beta_ {g} H _ {\mathbf {q}} (\mathbf {M} _ {A \mathbf {x}} | \mathbf {x} ^ {m}) \\ \end{array}
$$
Similarly, we use the same bernoulli distribution prior for the word mask,  $p_{r0}(\mathbf{M}_W) = \prod_{i=1}^{L} p_{r0}(\mathbf{M}_{W\mathbf{x}_i}),$  and  $p_{r0}(\mathbf{M}_{W\mathbf{x}_i}) = \text{Bernoulli}(0.5)$ :
$$
\begin{array}{l} \beta_ {i} K L \left(q \left(\mathbf {M} _ {W \mathbf {x}} \mid \mathbf {x} ^ {m}\right) \mid p _ {a 0} (\mathbf {M} _ {W})\right) = \tag {14} \\ - \beta_ {r} H _ {\mathbf {q}} (\mathbf {M} _ {W \mathbf {x}} | \mathbf {x} ^ {m}) \\ \end{array}
$$
We also add a sparsity regularization on  $\mathbf{M}_{A\mathbf{x}}$  to encourage learning of sparse interactions. Finally, we have the following loss function:
$$
\begin{array}{l} L = - \left(E _ {\mathbf {x}} p (\mathbf {y} | \mathbf {x} ^ {m}, \mathbf {M} _ {A}, \mathbf {M} _ {W}) + \right. \\ \beta_ {i} H _ {q} \left(\mathbf {M} _ {W} \mid \mathbf {x} ^ {m}\right) \tag {15} \\ + \beta_ {g} H _ {\mathbf {q}} \left(\mathbf {M} _ {A \mathbf {x}} \mid \mathbf {x} ^ {m}\right)) + \\ \beta_ {s p a r s e} | | \mathbf {M} _ {A \mathbf {x}} | | _ {1} \\ \end{array}
$$
As  $\mathbf{M}_A$  is a binary graph sampled from a Bernoulli distribution with parameter  $\gamma$ , to train the learnt parameter  $\gamma$ , we use the Gumbel-Softmax(Jang et al., 2016) trick to differentiate through the sampling layer. To learn the word mask  $\mathbf{M}_W$ , we use the amortized variational inference(Rezende and Mohamed, 2015). We use a single-layer feedforward neural network as the inference network  $q_{\phi(R_{x_t})} |_{\mathbf{x}_t}$ , whose parameters are optimized with the model parameters during training. We use Gumbel-Softmax for training with discrete word mask.
Figure 5: A schematic of k-multisection coverage in a DNN model.
Model	Dataset	Test Accuracy
BERT	SST-2	99.31
QQP	99.77
RoBERTa	SST-2	97.36
QQP	99.66
Table 5: Test accuracy (in %) of models trained with WIMASK layer. Note that the ground truth labels here are the predictions from the target model  $f$  without the WIMASK layer, as our goal is to ensure fidelity of the WIMASK  $+f$  to the target model  $f$  . The original models' accuracies are summarized in Table 4.
A.3 More Details and Results on Experiments
For Experiment 4.4 Coverage Guided Augmentation, the set of transformations we consider are: RandomSynonymInsertion, WordSwapEmbedding,