Robustness to Modification with Shared Words in Paraphrase Identification (2020)

Abstract: Revealing the robustness issues of natural language processing models and improving their robustness is important to their performance under difficult situations. In this paper, we study the robustness of paraphrase identification models from a new perspective – via modification with shared words, and we show that the models have significant robustness issues when facing such modifications. To modify an example consisting of a sentence pair, we either replace some words shared by both sentences or introduce new shared words. We aim to construct a valid new example such that a target model makes a wrong prediction. To find a modification solution, we use beam search constrained by heuristic rules, and we leverage a BERT masked language model for generating substitution words compatible with the context. Experiments show that the performance of the target models has a dramatic drop on the modified examples, thereby revealing the robustness issue. We also show that adversarial training can mitigate this issue.

## introduction paraphrase identification is to determine whether a pair of sentences have the same meaning @xcite , with many applications such as duplicate question matching on social media @xcite and plagiarism detection @xcite . it can be viewed as a sentence matching problem, and many neural models have achieved great performance on benchmark datasets @xcite @xcite . despite this progress, there is not much work on the robustness of paraphrase identification models, while natural language processing (nlp) models on other tasks have been shown to be vulnerable and lack of robustness. in previous works * corresponding author for the robustness of nlp models, constructing semantic-preserving perturbations to input sentences while making the model prediction significantly change appears to be a popular way, in tasks such as text classification and natural language inference @xcite . however, on specific tasks, it is possible to design modification that is not necessarily semanticpreserving, which can further reveal more robustness issues. for instance, on reading comprehension, @xcite conducted modification by inserting distracting sentences to the input paragraphs. such findings can be important for investigating and resolving the weakness of nlp models. on paraphrase identification, to the best of our knowledge, the only previous work is paws @xcite with a cross-lingual version @xcite , which found that models often make false positive predictions when words in the two sentences only differ by word order. however, this approach is for negative examples only, and for positive examples, they used back-translation to still generate semantically similar sentences. moreover, it was unknown whether models still easily make false positive predictions when the word overlap between the two sentences is much smaller than 100%. in this paper, we propose an algorithm for studying the robustness of paraphrase identification models from a new perspective -via modifications with shared words (words that are shared by both sentences). for positive examples, i.e., the two sentences are paraphrases, we aim to see whether models can still make correct predictions when some shared words are replaced. each pair of selected shared words are replaced with a new word, and the new example tends to remain positive. as the first example in figure 1 shows, by replacing "purpose" and "life" with "measure" and "value" respectively, the sen- figure 1 : examples with labels positive and negative respectively, originally from quora question pairs (qqp) @xcite . "(p)" and "(q)" are original sentences while "(p')" and "(q')" are modified. modified words are highlighted in bold. "output" indicates the change of output labels by bert @xcite , where the percentage numbers are confidence scores. in our word replacement, to preserve the label and language quality, we impose heuristic constraints on replaceable positions. furthermore, we apply a bert masked language model @xcite to generate substitution words compatible with the context. we use beam search to find a word replacement solution that approximately maximizes the loss of the target model and thereby tends to make the model fail. we summarize our contributions below: ## conclusion in this paper, we present a novel algorithm to study the robustness of paraphrase identification models. we show that the target models have a robustness issue when facing modification with shared words. such modification is substantially different from those in previous works -the modification is not semantic-preserving and each pair of modified sentences generally have a much lower word overlap, and thereby it reveals a new robustness issue. we also show that model robustness can be improved using adversarial training with our modified examples.