QA Domain Adaptation using Hidden Space Augmentation and Self-Supervised Contrastive Adaptation

Zhenrui Yue, Huimin Zeng, Bernhard Kratzwald, Stefan Feuerriegel, Dong Wang

Abstract

Extractive Question Answering (QA) models often suffer from performance degradation when applied to new domains, a phenomenon known as domain shift. We present QADA, a novel framework that adapts QA models to unlabeled target domains through a three-stage process: pseudo-labeling, hidden space data augmentation, and self-supervised contrastive adaptation. By performing augmentation in the embedding space and utilizing attention-guided feature selection, QADA achieves state-of-the-art results on the MRQA benchmark, even outperforming supervised models in certain scenarios.

Introduction

Extractive QA systems are designed to locate answer spans within a given context. However, these models are typically brittle; a model trained on Wikipedia (e.g., SQuAD) often fails when deployed on specialized domains like medical literature or news. Traditional domain adaptation requires either expensive labeled data or computationally intensive Question Generation (QG) models. QADA addresses these challenges by leveraging unlabeled target text to bridge the domain gap efficiently and scalably.

Methodology

The QADA framework consists of three integrated stages designed to improve model robustness and domain alignment.

Overview of the QADA framework showing the three stages: Pseudo Labeling, Hidden Space Augmentation, and Contrastive Adaptation.

1. Pseudo Labeling

The process begins with a base model trained on a source domain. This model generates predictions for the unlabeled target domain. To ensure high-quality training signals, only predictions with a confidence score greater than 0.6 are retained as "pseudo-labels."

2. Hidden Space Augmentation

Unlike traditional token-level augmentation, QADA operates within the neural network's hidden layers to preserve semantic integrity and explore "smooth" variations of language.

  • Question Augmentation: Utilizing Dirichlet neighborhood sampling, the model identifies synonyms and samples "virtual" embeddings from the convex hull of these synonyms. This introduces semantic diversity without breaking grammar.
  • Context Augmentation: An "attentive context cutoff" mechanism identifies high-attention spans and masks them in the hidden layers. This acts as a "digital blindfold," forcing the model to learn global context rather than over-relying on specific keyword cues.

3. Contrastive Adaptation

To align source and target distributions, QADA employs a Maximum Mean Discrepancy (MMD) loss. An attention-based sampling strategy is used to select "hard" features near the decision boundary, facilitating more effective domain bridging than standard global averaging.

Experimental Results

QADA was evaluated using SQuAD v1.1 as the source and five diverse datasets from the MRQA benchmark (HotpotQA, Natural Questions, NewsQA, SearchQA, and TriviaQA) as targets.

Performance comparison of QADA against various baselines and supervised models across five MRQA datasets.

As shown in the results table, QADA achieved state-of-the-art performance across all target datasets. On average, it improved Exact Match (EM) scores by 6.1% and F1 scores by 4.9% over the best existing baselines. Notably, on the TriviaQA dataset, QADA's zero-shot adaptation (56.92 EM) outperformed a BERT model trained on 10,000 manually labeled target samples (54.63 EM).

Discussion and Conclusion

The success of QADA highlights the advantages of hidden space augmentation and attention-guided learning. By exploring linguistic variations in the embedding space and forcing the model to consider global context through attentive cutoffs, QADA builds a more robust representation of language. While hyperparameter sensitivity and the complexity of multi-span cutoffs remain areas for future exploration, QADA represents a significant step forward in cost-effective, scalable domain adaptation for QA systems.

Summary updated

BibTeX
@inproceedings{yue2022qa,
  author = {Zhenrui Yue and Huimin Zeng and Bernhard Kratzwald and Stefan Feuerriegel and Dong Wang},
  title = {{QA Domain Adaptation using Hidden Space Augmentation and Self-Supervised Contrastive Adaptation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.147},
}
Figure