On Length Divergence Bias in Textual Matching Models (2022)

Abstract: Despite the remarkable success deep models have achieved in Textual Matching (TM) tasks, it still remains unclear whether they truly understand language or measure the semantic similarity of texts by exploiting statistical bias in datasets. In this work, we provide a new perspective to study this issue — via the length divergence bias. We find the length divergence heuristic widely exists in prevalent TM datasets, providing direct cues for prediction. To determine whether TM models have adopted such heuristic, we introduce an adversarial evaluation scheme which invalidates the heuristic. In this adversarial setting, all TM models perform worse, indicating they have indeed adopted this heuristic. Through a well-designed probing experiment, we empirically validate that the bias of TM models can be attributed in part to extracting the text length information during training. To alleviate the length divergence bias, we propose an adversarial training method. The results demonstrate we successfully improve the robustness and generalization ability of models at the same time.

## introduction textual matching is a crucial component in various nlp applications, such as information retrieval @xcite , question answering @xcite and duplicate detection @xcite . given a pair of texts, the goal is to determine the semantic similarity between them. a lot of deep models @xcite @xcite @xcite have achieved excellent performance on various tm benchmarks. however, recent work has found that current models are prone to adopting shallow heuristics in the datasets, rather than learning the underlying linguistics that they are intended to capture. this t 1 -microsoft acquires maluuba, a startup focused on general artificial intelligence. (10) t 2 -microsoft has acquired canadian startupmaluuba, a company founded by university of waterloo grads kaheer suleman and sam pasupalak that also participated in. ( 22 ) label: paraphrase output: non-paraphrase t 1 -bill would cut off aid to countries that don't take back their illegal immigrant criminals. (15) t 2 -common sense law faces massive opposition supposing that aid would be cut off to countries who refuse their citizens. (19) label: non-paraphrase output: paraphrase in this paper, we address this issue in the domain of textual matching. the focus of our work is on the length divergence bias -models tend to classify examples with high length divergence as negative and vice versa. we analyze current tm datasets and find that all of them follow specific length divergence distribution by labels. to determine whether tm models have employed this spurious pattern to facilitate their performance, we construct adversarial test sets which invalidate this heuristic and re-evaluate tm models. there is a performance drop on 14 out of total 16 combinations of models and tasks, cat1 cat2 cat3 suggesting their reliance on this heuristic. despite demonstrating the existence of length divergence bias, the underlying reason has not been well explained. by conducting the sentlen probing experiment @xcite , we bridge this gap through revealing the text length information tm models have learned during training. we finally explore a simple yet effective adversarial training method to correct the length divergence bias. the results show our approach not only reduces the bias but also improves the generalization ability of tm models. to encourage the development of tm models that understand semantics more precisely, we will release our code. ## datasets and models we select four well-known nlp and ir datasets as follows: quora question pairs (qqp) @xcite , twitter-url @xcite , @xcite , and trec microblog 2013 (microblog) @xcite . we study four models for textual matching tasks: matchpyramid @xcite , @xcite , esim @xcite and bert @xcite . the four models above are representative in terms of neural architectures. the detailed explanation for each dataset and model can be found in appendix a.1 and a.2. ## length divergence heuristic in current datasets in this section, we characterize existing datasets from the perspective of the length divergence between text pairs. we first formulate pairwise length divergence for nlp tasks and listwise length divergence for ir tasks, respectively. pairwise. given two texts t 1 and t 2 , their relative length divergence is defined as: listwise. in ir tasks, each example consists of a query q and a list of documents d associated with it. we define the listwise relative length divergence with respect to q as: based on the length divergence definition, we sort and split the training sets into quarters, namely cat1-4, and examine length divergence distribution by labels for each dataset. statistics are shown in figure 1 . we can see that all datasets suffer from the same problem: as the length divergence increases, the ratio of positive examples decreases. overall, negative examples tend to have higher length divergence than positive ones, providing direct cues for label assignment. ## length divergence bias in tm models in this section, we demonstrate that existing tm models indeed employ the length divergence heuristic in datasets. existing test sets are drawn from the same distribution as the training sets, which are overly lenient on models that rely on superficial cues. to provide a more robust assessment of tm models, we construct adversarial test sets by eliminating such heuristic. ## length divergence bias correction in this section, we propose to correct the length divergence bias. as the model modification method usually has a significant cost and is inefficient, we apply adversarial training with bias-free training data. our method is much more practical, lower cost, and easier to be implemented and adopted. we first construct the adversarial training sets in the same way as the adversarial test sets. we next re-train each model on the adversarial training sets and report their performance on two test sets. results. as presented in ## conclusion the inspiring success of deep models is accounted for by employment spurious heuristics in datasets, instead of truly understanding the language. in this work, we investigate the length divergence heuristic that textual matching models are prone to learn. we characterize current tm datasets and find that examples with high length divergence tend to have negative labels and vice versa. to provide a more robust assessment, we construct adversarial test sets, on which models using this heuristic are guaranteed to fail. experiments show that almost all tm models perform worse on adversarial test sets, indicating they indeed exploit the length divergence cues. we then provide a deeper insight by conducting the sentlen probing experiment. tm models are shown to learn rich text length information during training, which accounts for the length divergence bias. finally, we propose a simple yet effective adversarial training method to alleviate the length divergence bias in tm models. it's a little inspiring that our approach improves models' robustness and generalization ability at the same time. overall, our results indicate that, there is still substantial room towards tm models which understand language more precisely. dan shen and mirella lapata. 2007. using semantic roles to improve question answering. in proceedings of the 2007 joint conference on empirical methods in natural language processing and computational natural language learning (emnlp-conll), pages 12-21, prague, czech republic. association for computational linguistics. ashish vaswani, noam shazeer, niki parmar, jakob uszkoreit, llion jones, aidan n. gomez, undefinedukasz kaiser, and illia polosukhin. 2017. attention is all you need. in proceedings of the 31st international conference on neural information processing systems, nips'17, pages 6000-6010, red hook, ny, usa. curran associates inc. eventplace: long beach, california, usa. shengxian wan, yanyan lan, jiafeng guo, jun xu, liang pang, and xueqi cheng. 2016. a deep architecture for semantic matching with multiple positional sentence representations. in proceedings of the thirtieth aaai conference on artificial intelligence, aaai'16, page 2835-2841. aaai press. alex wang, amanpreet singh, julian michael, felix hill, omer levy, and samuel bowman. 2018. glue: a multi-task benchmark and analysis platform for natural language understanding. in proceedings of the 2018 emnlp workshop black-boxnlp: analyzing and interpreting neural networks for nlp, pages 353-355, brussels, belgium. association for computational linguistics. mengqiu wang, noah a. smith, and teruko mitamura. 2007. what is the jeopardy model? a quasi-synchronous grammar for qa. in proceedings of the 2007 joint conference on empirical methods in natural language processing and computational natural language learning (emnlp-conll), pages 22-32, prague, czech republic. association for computational linguistics. zhiguo wang, wael hamza, and radu florian. 2017. bilateral multi-perspective matching for natural language sentences. in proceedings of the twenty-sixth international joint conference on artificial intelligence, pages 4144-4150, melbourne, australia. international joint conferences on artificial intelligence organization. zhiguo wang and abraham ittycheriah. 2015. faqbased question answering via word alignment. arxiv e-prints, page arxiv:1507.02628.