Wasserstein Distance Regularized Sequence Representation for Text Matching in Asymmetrical Domains

Weijie Yu, Chen Xu, Jun Xu, Liang Pang, Xiaopeng Gao, Xiaozhao Wang, Ji-Rong Wen

Abstract

Text matching in asymmetrical domains—where input pairs like questions and answers possess distinct linguistic properties—often suffers from a "distributional gap" in latent space. We present WD-Match, a novel framework that utilizes Wasserstein distance as an adversarial regularizer to force feature representations from different domains to overlap. By minimizing the distance between these distributions, WD-Match ensures domain-invariant representations, leading to improved matching performance. Our evaluation across NLI and QA benchmarks demonstrates that WD-Match consistently enhances various base models, achieving state-of-the-art results with minimal computational overhead.

Introduction

In many Natural Language Processing (NLP) tasks, such as Natural Language Inference (NLI) and Question Answering (QA), models must match text pairs from asymmetrical domains. For instance, a premise and a hypothesis in NLI, or a query and a document in QA, exhibit different linguistic structures and properties. Standard deep learning models typically project both texts into a shared latent space as feature vectors. However, a persistent challenge is that feature vectors for these two domains often remain clustered separately during training. This distributional gap hinders the downstream matching function's ability to generalize. WD-Match addresses this by providing a formal mechanism to ensure inputs from different domains are mapped to the same region of the semantic space.

The WD-Match Framework

The WD-Match framework consists of three primary components trained in an adversarial "game":

  1. Feature Projection (F): A neural network (e.g., BERT or RE2) that transforms raw text into high-dimensional feature vectors.
  2. Matching Component (M): The module that predicts the relationship between the vectors (e.g., entailment, neutral, or contradiction).
  3. Regularizer Component (G): A "critic" network that estimates the Wasserstein distance between the distributions of the two domains (e.g., premises vs. hypotheses).
Architecture of the WD-Match framework showing the Feature Projection (F), Matching (M), and Regularizer (G) components.

The Adversarial Loop

Training proceeds as a min-max game. The Regularizer (G) attempts to maximize the estimated Wasserstein distance to distinguish between the two domains. Simultaneously, the Feature Projector (F) is optimized to minimize both the matching error and the Wasserstein distance. By minimizing this distance, the model forces the Feature Projector to produce representations where the domain of the input is effectively hidden, creating domain-invariant projections.

Experimental Setup

The researchers evaluated WD-Match on four major benchmarks:

  • SNLI (Stanford Natural Language Inference): Predicting if a hypothesis follows from a premise.
  • SciTail: A challenging NLI dataset derived from science exams.
  • TrecQA: Ranking answer relevance to questions.
  • WikiQA: A retrieval-based QA dataset based on Wikipedia.

Key Insights: Visualizing Domain Invariance

A critical insight of this work is the visualization of the latent space. Using t-SNE to project high-dimensional data into 2D, the authors observed that in standard models, premises and hypotheses remain in separate clusters for much of the training process. WD-Match forces these distributions to merge significantly earlier.

t-SNE visualization of feature representations at Epochs 1, 10, and 20, demonstrating how WD-Match merges the domain distributions over time.

Wasserstein distance (or Earth Mover's Distance) was chosen over other measures like KL Divergence because it provides a meaningful gradient even when two distributions do not overlap. This stability makes it an ideal guide for moving feature clusters together in an adversarial setting.

Results

WD-Match consistently outperformed base models across all tested architectures (RE2, DecAtt, CAFE, and BERT):

  • SNLI: Adding WD-Match to the RE2 model achieved an accuracy of 89.1%, surpassing the base model and more complex architectures.
  • SciTail: The framework boosted BERT's accuracy from 79.2% to 81.9%, a significant improvement on a competitive benchmark.
  • Efficiency: The additional "critic" network (G) is a simple two-layer MLP, resulting in negligible increases in parameter count or training time.

Conclusion and Future Work

WD-Match effectively bridges the gap between asymmetrical domains by enforcing domain-invariant representations. While successful, the authors note that real-world matching often involves more than two domains or more complex lexical gaps. Future research will explore multi-modal matching (e.g., image-to-text) and the impact of this regularization on the interpretability of learned semantic spaces.

Summary updated

BibTeX
@inproceedings{yu2020wasserstein,
  author = {Weijie Yu and Chen Xu and Jun Xu and Liang Pang and Xiaopeng Gao and Xiaozhao Wang and Ji-Rong Wen},
  title = {{Wasserstein Distance Regularized Sequence Representation for Text Matching in Asymmetrical Domains}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.emnlp-main.239},
}
Figure