Adversarial Domain Adaptation for Duplicate Question Detection

Darsh J. Shah, Tao Lei, Alessandro Moschitti, Salvatore Romeo, Preslav Nakov

TL;DR

This paper tackles the challenge of identifying duplicate questions in online forums, a crucial step for efficient knowledge sharing. They introduce an adversarial domain adaptation technique that allows models trained on one forum to perform well on another, even with limited data, achieving significant improvements over existing methods.

What Problem Does This Paper Address?

Online question-answering forums, like Stack Overflow or Quora, are invaluable resources for users seeking help. However, a common issue is the proliferation of duplicate questions, where users ask the same thing in slightly different ways. This makes it difficult for others to find existing answers, leading to fragmented discussions and potentially delayed help. While manually identifying duplicates is tedious and costly, and many forums lack sufficient labeled data for training machine learning models, this paper proposes a solution: adversarial domain adaptation. This technique leverages labeled data from a "source" forum to build a model that can effectively detect duplicates in a "target" forum, even if the target forum has no labeled data.

Methods

The core of the paper's methodology lies in an adversarial domain adaptation (ADA) framework. Their model consists of three main components:

  1. Question Encoder: This component takes a question (title and body) and transforms it into a dense vector representation. They use a bi-LSTM architecture with pre-trained GloVe embeddings.
  2. Similarity Function: This function takes two question vectors and predicts the probability of them being duplicates. They explored both logistic regression and cosine similarity, finding cosine similarity to be superior.
  3. Domain Adaptation Component: This is the novel part. It employs an adversarial approach to ensure that the question encoder produces representations that are indistinguishable between the source and target domains. This is achieved by training a domain classifier to predict the origin of a question vector, while simultaneously training the question encoder to "fool" this classifier. This encourages the encoder to learn domain-invariant features. They specifically chose the Wasserstein method for domain adaptation due to its stability.

Datasets

The authors utilized several datasets for their experiments:

  • Stack Exchange Family: Data from four forums: AskUbuntu, SuperUser, Apple, and Android. These forums are focused on technical communities, and some duplicate question pairs are marked by users.
  • Sprint FAQ: A dataset from a technical forum, containing frequently asked questions and their paraphrased versions.
  • Quora: A dataset of similar questions from the Quora platform, covering diverse topics.

These datasets are described as heterogeneous, with Stack Exchange forums being informal and technology-focused, Sprint FAQ being concise and technical, and Quora being broad in topic.

Key Insights and Ideas

  • Domain Adaptation is Crucial: The paper strongly advocates for domain adaptation, showing that simply applying a model trained on one forum to another (direct transfer) often performs poorly.
  • Domain Similarity Matters: The effectiveness of adversarial domain adaptation is directly correlated with the similarity between the source and target domains. More similar domains lead to better adaptation results.
  • N-gram Overlap as a Predictor: Simple statistics like n-gram overlap between domains can predict the effectiveness of domain adaptation, offering a way to estimate potential success beforehand.
  • Cosine Similarity Outperforms Sigmoid: For the similarity function, cosine similarity with a hinge loss proved significantly better than a logistic function with cross-entropy loss, likely due to its robustness to noisy labels.
  • Wasserstein for Stability: The Wasserstein approach for domain adaptation offered more stable training compared to classification-based methods.

Key Results

The proposed adversarial domain adaptation model achieved an average relative improvement of 5.6% over the best baseline across multiple domain pairs from the StackExchange family. This improvement reached up to 14% for specific pairs like AskUbuntu-Android. While adaptation on the Sprint dataset showed improvement over direct transfer, it was still outperformed by the BM25 baseline. Adaptation from Quora yielded the least improvement, highlighting the importance of domain similarity.

Limitations and Future Work

The authors acknowledge that domain adaptation performs worst when the source and target domains are very dissimilar (e.g., Quora vs. Stack Exchange). They also note that while their model improves over direct transfer, it can still be outperformed by strong baselines like BM25 in certain scenarios.

Future work directions include:

  • Developing improved adversarial adaptation methods, potentially by leveraging domain similarity insights.
  • Exploring "source-pivot-target" transfer learning, where an intermediate domain is used.
  • Investigating the integration of attention mechanisms for question similarity, ensuring these mechanisms are also made domain-invariant.

Summary updated

BibTeX
@inproceedings{shah2018adversarial,
  author = {Darsh J. Shah and Tao Lei and Alessandro Moschitti and Salvatore Romeo and Preslav Nakov},
  title = {{Adversarial Domain Adaptation for Duplicate Question Detection}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2018},
  doi = {10.18653/v1/d18-1131},
}
Figure