Exposing Length Divergence Bias of Textual Matching Models

Lan Jiang, Tianshu Lyu, Chong Meng, Xiaoyong Lyu, Dawei Yin

Introduction

Textual Matching (TM) is a fundamental task in Natural Language Processing (NLP) and Information Retrieval (IR), encompassing paraphrase detection and question answering. While deep learning models achieve high scores on leaderboards, they often rely on "Clever Hans" heuristics—spurious statistical correlations—rather than true semantic understanding. This paper investigates a specific heuristic: length divergence bias, where models predict a lack of match based solely on the difference in length between two input texts.

Quantifying Length Divergence Bias

The researchers defined Relative Length Divergence ($\Delta_{rel}L$) as the normalized difference in word counts between two texts. Dataset examples were categorized into four bins (CAT1 to CAT4) based on increasing divergence.

Distribution of positive and negative examples across length divergence categories (CAT1-CAT4) for four benchmarks.

As shown in the figure above, every analyzed dataset exhibits a strong correlation: as length divergence increases (moving from CAT1 to CAT4), the ratio of positive labels ("PosRatio") significantly declines. This creates a shortcut that models can exploit to achieve high accuracy without processing semantic content.

Methodology

To expose and mitigate this bias, the study employed three strategies:

  1. Adversarial Evaluation: The authors created "adversarial test sets" by down-sampling original test sets to ensure a uniform positive-to-negative ratio across all length divergence categories. A performance drop on these balanced sets indicates reliance on the length shortcut.
  2. Probing: Using the SentLen probing task, the researchers tested whether model embeddings explicitly encode length. They found that training on TM tasks actually improves a model's ability to predict sentence length, suggesting length is actively extracted as a feature.
  3. Adversarial Training: Models were trained on balanced datasets to force them to ignore length cues and focus on semantic relationships.

Experimental Setup

The study evaluated four major benchmarks: Quora Question Pairs (QQP), Twitter-URL, TrecQA, and TREC Microblog 2013. Models tested included MatchPyramid, BiMPM, ESIM, and BERT-Tiny.

Key Results and Insights

  • Ubiquity of Bias: Every dataset analyzed showed a strong correlation between high length divergence and negative labels.
  • Performance Collapse: 14 out of 16 model-task combinations showed a performance drop when evaluated on adversarial sets. MatchPyramid was the most vulnerable, while BERT-Tiny showed more robustness but was not immune.
  • Recall Trends: Model recall consistently dropped as length divergence increased, confirming that models are biased toward labeling long-short pairs as "negative," mirroring the dataset bias.
  • Effectiveness of Adversarial Training: Re-training on balanced data not only mitigated the bias but often improved performance on the original biased test sets. For instance, on the Microblog task, BiMPM’s MAP (Mean Average Precision) jumped from 26.44 to 41.50 after adversarial training.

Conclusion

Length divergence is a significant spurious cue in TM benchmarks. While adversarial training effectively mitigates this specific bias, it highlights the need for more robust evaluation frameworks that account for various shallow heuristics. Future research should explore broader adversarial training methods to address other potential cues like word overlap or keyword bias.

Summary updated

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.
BibTeX
@inproceedings{jiang2022exposing,
  author = {Lan Jiang and Tianshu Lyu and Chong Meng and Xiaoyong Lyu and Dawei Yin},
  title = {{Exposing Length Divergence Bias of Textual Matching Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.findings-acl.330},
}
Figure