DomainInv: Domain Invariant Fine Tuning and Adversarial Label Correction For Unsupervised QA Domain Adaptation (2024)

Abstract: Existing Question Answering (QA) systems are limited in their ability to answer questions from unseen domains or any out-of-domain distributions, making them less reliable for deployment in real scenarios. Importantly, all existing QA domain adaptation methods are either based on generating synthetic data or pseudolabeling the target domain data. Domain adaptation methods relying on synthetic data and pseudo-labeling suffer from either the need for extensive computational resources or an additional overhead of carefully selecting the confidence threshold to distinguish noisy examples from the training dataset. In this paper, we propose unsupervised domain adaptation for an unlabeled target domain by transferring the target representation close to the source domain without using supervision from the target domain. To achieve this, we introduce the idea of domain-invariant fine-tuning along with adversarial label correction (DomainInv) to identify target instances that are distant from the source domain. This involves learning the domain invariant feature encoder to minimize the distance between such target instances and source instances class-wisely. This eliminates the possibility of learning features of the target domain that are still close to the source support but are ambiguous. The evaluation of our QA domain adaptation method, namely DomainInv, on multiple target QA datasets reveals a performance improvement over the strongest baseline.

heading: 1 Introduction
text: Over the past few years, machine learning models have been widely deployed in production. However, making them work satisfactorily in production requires a substantial amount of high-quality annotated data, which is expensive and time-consuming. Therefore, it is of utmost importance to build generalizable models that can perform well on unseen datasets. However, due to the mechanism of domain shift or bias in the training dataset (Ben-David
et al., 2010, 2006), it is challenging to directly transfer knowledge from the model trained on the source domain to the unlabeled target domain. In this paper, we studied this phenomenon specifically for the case of extractive Question Answering (QA) systems.
Extractive QA systems perform the task of identifying the most relevant answer for a given question within a context or paragraph. The answer is represented as a sub-span of the context, with start and end positions predicted by the QA model. The training data for QA essentially consists of triplets specifying the question, answer, and context. The input to the model is a question and context presented as running text separated by a separator. The model is trained to predict the most relevant start and end positions in the context (Seo et al., 2016; Chen et al., 2017; Devlin et al., 2019; Kratzwald et al., 2019).
These QA systems also face performance degradation at test time, as questions and contexts can vary widely in complexity. The same question may be phrased in the simplest or most complex ways, and the answer may involve reasoning or follow a complex extraction pattern that is challenging to generalize with a limited annotated training dataset. Recent works (Fisch et al., 2019a; Miller et al., 2020; Zeng et al.) have explored this issue, proposing solutions such as using labeled target domain data or incorporating feedback during training (Daumé III, 2007; Kratzwald et al., 2020; Kamath et al., 2020). Others (Yue et al., 2022c, 2021) have employed synthetic or pseudo-labeled data to train these systems and enhance their generalization to out-of-domain distributions. However, it is important to note that pseudo-labeled data is prone to noise, and obtaining accurately labeled data requires considerable human labeling effort.
In this paper, we focus on unsupervised domain adaptation (UDA), which does not require labeled target domain data. There are numerous
13
works towards achieving domain-invariant representations, categorized into 1) optimizing the discrepancy between domain representations (Yue et al., 2022c, 2021), and 2) adversarial learning (Lee et al., 2019b; Cao et al., 2020). However, in general there exists different distance metrics for minimizing domain discrepancy, for example (Gretton et al., 2006) leverage maximum mean discrepancy (MMD) as the distance measure between source and target domain distributions. Similar to MMD, CMD (central moment discrepancy) (Zellinger et al., 2017), Wasserstein distance (WD) (Shen et al., 2018), sliced Wasserstein distance (SWD) (Kolouri et al., 2019), multi-kernel MMD (Long et al., 2015), joint MMD (Long et al., 2017) are other alternative measures.
Inspired by generative adversarial networks (GAN) (Goodfellow et al., 2014), adaptation methods based on adversarial learning have also shown promising results (Ganin et al., 2017; Xie et al., 2018; Pei et al., 2018; Saito et al., 2018; Lee et al., 2019a). Adversarial learning methods propose the idea of using the domain discriminator to distinguish whether the incoming sample is from the source or target domain, while the feature generator tries to fool the discriminator by generating domain-invariant features. During the process of creating domain-invariant representations, the generator positions the target representation near the source domain decision boundaries. However, these representations are misaligned with respect to the source classes, leading to a degradation in performance (Lee et al., 2019a).
Some works rely on high-confidence pseudolabels (Yue et al., 2022c; Deng et al., 2019) for the target domain. However, this method of generating synthetic data for the target domain imposes an additional computational overhead. Moreover, target pseudo-labeling can have adverse effects on adaptation if it generates too many incorrect labels above the confidence threshold. Some works propose minimizing the distance between tokens from the target instances and those of the source support contrastively (Yue et al., 2022c). However, in practical scenarios, the target domain can be completely asymmetrical, necessitating the alignment of the pre-trained source model with the target domain before optimizing for domain-invariant representations. In this paper, we propose an adaptation framework called DomainInv (illustrated in Figure 1), which can perform domain adaptation without training an answer classifier with noisy pseudo-
labeled data. This eliminates the need to filter out that noise before training on the target domain, as opposed to the existing SOTA method in (Yue et al., 2022c). Our approach involves learning domaininvariant features through domain-invariant finetuning along with adversarial label correction. This is done to identify target instances that are far apart from the source domain and optimize them to lie near the source support, class wisely. Main Contributions of this paper are as follows:
• We propose the unsupervised domain adaptation framework called DomainInv for extractive QA. The framework can address the domain shift phenomenon without the need for explicit training of an answer classifier with pseudo-labeled data. The noise in pseudolabeled data, which is challenging to filter out, deteriorates the performance of the answer classifier and, consequently, hinders its ability to generalize well to the target domain.
• We propose the idea of 1) Domain Invariant Fine Tuning and 2) Adversarial Label Correction together, aiming to minimize the distance between the source and target domain representations class-wise (start and end) in an iterative manner.
• We evaluated our framework on multiple QA datasets as target domains without accessing their answers during training. DomainInv outperforms the strongest baseline for QA domain adaptation, which adapts the model by explicitly training on pseudo-labeled target domain.

heading: 2 Related Work
text: In the past few years, there has been an increasing interest in learning generalized representations through various learning paradigms, namely, unsupervised, multi-tasking, and transfer learning (Peters et al., 2018; McCann et al., 2018; Chronopoulou et al., 2019; Phang et al., 2018; Wang et al., 2018; Xu et al., 2019). Specifically, recent studies have explored the generalization capability of reading comprehension systems (Golub et al., 2017; Fisch et al., 2019b; Talmor and Berant, 2019; Yue et al., 2021, 2022c,b). Our interest in this paper lies solely in unsupervised approaches for domain adaptation, where target domain data is unlabelled. The approaches used for unsupervised
domain adaptation are broadly categorized into the following main themes: 1) Contrastive Learning, 2) Self-Supervision, and 3) Adversarial Learning.
Contrastive Learning: Contrastive learning methods (He et al., 2020; Caron et al., 2020; Chen et al., 2020; Yue et al., 2022c, 2021) aim to learn a feature encoder that generates similar features for the same input (obtained from different augmentations) and different features for any other input and its augmentations. Specifically for QA, (Sun et al., 2018; Du et al., 2017) have generated synthetic QA samples through Question Generation (QG). Leveraging these samples improves performance in out-of-domain distribution (Yue et al., 2021; Golub et al., 2017; Tang et al., 2017; Lee et al., 2020; Tang et al., 2018; Shakeri et al., 2020; Yue et al., 2022a; Zeng et al., 2022). Additionally, contrastive learning has been applied to minimize the discrepancy between the source and target domains using Maximum Mean Discrepancy (MMD) (Gretton et al., 2006). They learned to minimize the distance for averaged token features (Yue et al., 2022c) among answer and non-answer tokens in source and target domains and maximize the distance between them.
Self-Supervision: There are many works in computer vision that have explored the use of selfsupervision for unsupervised domain adaptation, all aligned with the common objective of minimizing the discrepancy (distance) between domains (Kang et al., 2019; Wang et al., 2021; Thota and Leontidis, 2021). Although the objective is similar to that of contrastive learning, models learned through contrastive learning have been shown to
perform better (Shen et al., 2022). Apart from the MMD (Gretton et al., 2006) criterion used in (Yue et al., 2022c), other metrics like central moment discrepancy (CMD) used in (Zellinger et al., 2017) directly match order-wise differences of central moments. Wasserstein distance, employed to measure the distance between two probability distributions, has been explored in (Shen et al., 2018; Kolouri et al., 2019). The method in (Yu et al., 2020) learns sentence representations for text matching between asymmetrical domains. In our approach, we consider the use of sliced Wasserstein distance (Kolouri et al., 2019). Instead of minimizing the distance between representations for domains, this distance is applied to minimize the distribution learned for the start and end tokens in QA domain adaptation.
Adversarial Learning: The objective of adversarial learning is also based on the idea of minimizing domain discrepancy. The main concept of domain adversarial learning is to learn domaininvariant representations through an adversarial loss between the feature generator and discriminator, similar to GANs (Goodfellow et al., 2014). Some works that use domain adversarial learning include (Ganin et al., 2017; Tzeng et al., 2017; Bousmalis et al., 2017; Yang et al., 2020; Long et al., 2018; Pei et al., 2018). Additionally, there are methods (Yue et al., 2022c) that explored the use of target data along with pseudo-labels to train the target classifier. In contrast to this, we have explored the use of adversarial loss to identify and correct mistakes in labels during target-aware source fine-tuning, aiming to learn domain-invariant rep-
resentations for the target domain.

heading: 3 Setup
text: Problem setup for unsupervised domain adaptation(UDA) consider the labeled source domain Ds and unlabelled target domain Dt. The goal is to maximize the performance on target domain by only training with labeled source domain data and unlabelled target domain data as in (Cao et al., 2020; Shakeri et al., 2020; Yue et al., 2021, 2022b,c).
Data: Specifically, for the case of QA domain adaptation we describe the labeled source domain Ds data as samples consisting of triplets, {c(i)s , q(i)s , a(i)s } ∈ Xs, consisting of context c(i)s , question q(i)s and answer a (i) s , where each triplet is obtained from the training data Xs. Similarly, the unlabelled target domain Dt data consists of samples with pair {c(i)t , q (i) t } ∈ Xt consisting of only context c(i)t and question q (i) t , obtained from unlabelled training data Xt. Here, in our case of QA domain adaptation the answer is the start and end position in the context since we are working with extractive QA systems.
Model: We approach the problem of QA domain adaptation as training the model function f which predicts an answer a(i)t given the context c(i)t and question q (i) t from Xt, denoted as a (i) t = f (c (i) t , q (i) t ). This requires to optimize the function f for maximum performance on target domain Dt, given Ds. Mathematically, this is denoted as:
min f
L(f ,Xt;Xs) (1)
where L is the loss function. We adopt the two fold training scheme to maximize performance on target domain namely, Domain Invariant Fine Tuning and Adversarial Label Correction which will be discussed in the following sections.

heading: 4 DomainInv Framework

heading: 4.1 Overview
text: The proposed DomainInv framework consists of two main components: 1) Domain Invariant Fine Tuning and 2) Adversarial Label Correction for domain adaptation, as shown in Figure 1. We start with a pre-trained QA model f , fine-tuned on the source domain Ds as in (Cao et al., 2020), with an additional batch norm layer. The answer classifier C1 predicts the start and end indices in the context. During domain invariant fine-tuning, we incorporate the use of the target domain Dt to augment
the style of pseudo-answer and non-answer tokens to the source domain. This results in another answer classifier C2, which possesses target domain style information while still being trained on the source domain. With the answer classifier C2, there are instances in the target domain Dt for which the answer differs from the one obtained using C1. We identify these instances as those which are far apart from the source domain, and the QA model is least confident about them. During adversarial correction, we minimize the distribution between these two classifiers and update the BERT encoder to generate features for the target domain closer to the source domain. This ensures that the classifier C2 predicts the answer as if it were operating on the source domain, aligning the features for the target domain with those of the source domain.

heading: 4.2 Domain Invariant Fine Tuning
text: In this section, we will explain in detail the process we have followed for domain invariant fine-tuning. Let the trained QA model on source domain is denoted as f , it is a BERT model with L layers of transformers (Vaswani et al., 2017). Specifically, let C1 be an answer classifier, and θg be the encoder parameters for this source-domain QA model.
During domain invariant fine-tuning (shown in Figure 2), we propose to feed the style information of the target domain Dt to the source domain QA model at each layer l ∈ L, as illustrated in Figure 2. We keep the weights shared between the two encoders to allow the target domain information to be updated in the BERT encoder with the supervision of the source domain. Let ϕ(x, x′) be the learnable domain shift vector between the source instance x and the target domain instance x′, and M(x, ϕ(x, x′)) be a learnable domain transformation layer, which is introduced at the top of each transformer layer l ∈ L of model f . Cumulatively, it transforms the parameters of the source domain classifier C1 to the target-aware classifier C2 and updates encoder parameters θg with the style of the target domain.
Domain Transformation Layer: The domain transformation layer M is expected to fuse the domain shift vector with the hidden states (which were fine-tuned for the source domain) at each layer of the transformer. The domain shift vector ϕ should solely capture the information that is different from the source domain. This categorizes the vector containing any extra information in the target domain compared to the source domain, ir-
respective of its position in the context. This can be achieved by taking the difference between the average pooled vector of hidden states at each layer obtained for the source and target domains. Let H (l) s and H (l) t be the hidden states obtained at layer l for the source domain and target domain, respectively. Then, the domain shift vector at layer l between two instances is given as:
ϕ(l)(H (l) t , H (l) s ) = avg(WH (l) t )− avg(WH(l)s )
(2) where, W ∈ Rk×d are the linear transform parameters shared across layers. Then, the domain transformation layer M is given as:
M(H(l)s , ϕ(l)(H(l)t , H(l)s )) = H(l)s + W Tϕ(l)(H
(l) t , H (l) s )
(3)
The expression W Tϕ(l)(H(l)t , H (l) s ) ∈ Rd is added to all hidden states at layer l corresponding to the source domain. This design of the domain shift vector follows the identity property, i.e., ϕ(x, x) = 0. This allows us to plug in the domain transformation layer only at the time of training, while at the time of inference for the target domain, it is, ϕ(l)(H
(l) t , H (l) t )) = 0. However, it is required to
carefully choose the value of k, which is a hyperparameter, because it assumes the domain shift information lies in the k-dimensional subspace where the difference between two domains can be minimized to make them appear similar.
QA Domain Transformation: Specifically, for the case of QA domain adaptation, we can’t apply the domain shift across all the tokens uniformly, as there are underlying differences between the context, question, and answer tokens. Hence, it would be wise to calculate ϕA, ϕC , and ϕQ for Answer, Context, and Questions, respectively. Since we only have context and questions in the target domain, the answer is the pseudo-answer obtained
from the classifier C1, where the weights of C1 are frozen, and the BERT encoder parameters θg are shared during fine-tuning. These will be updated jointly along with classifier C2 (initialized with the fine-tuned classifier C1), as shown in Figure 2. At the end of domain transformation fine-tuning, we obtain another target-aware classifier C2 and updated encoder parameters θg which are the finetuned parameters on the target-aware source domain with supervised cross-entropy loss Lce. Note that here pseudo labels on target domain is not directly involved in training answer classifier C2.
min f
Lce(f ,Xs||Xt) (4)
where f consists of parameters θg and parameters in classifier C2 and M. During training, we randomly select samples from the target domain, ensuring the batch size matches that of the source domain, and an additional constraint to include parallel instances with the same question types (denoted as Xs||Xt). We employ the dependency parser, semantic role labeling, and named entity recognition (NER) to detect the question types, as done in (Keklik, 2018).

heading: 4.3 Adversarial Label Correction
text: We have introduced adversarial label correction based on the fact that during domain invariant finetuning, we relied on the pseudo-labels obtained from classifier C1. However, these labels are noisy and prone to error accumulation, potentially leading to erroneous alignment of the source and target domain. The domain shift information in the kdimensional subspace may be captured incorrectly, resulting in similar performance degradation as observed in the approaches (Yue et al., 2022c, 2021) where pseudo-labels are used to train the answer classifier. However, these methods (Yue et al., 2022c, 2021) overlook the fact that domain adaptation can result in target features lie far apart from the source domain for similar semantics that are ambiguous and hence error-prone. To mitigate this, we propose the idea of reducing the inconsistency between domains by generating target features near the support of source classes. In our case, this refers to the starting and ending indices for the answer classifier for different question types.
In Equation 4, fine-tuning occurs with the targetaware source domain, resulting in the answer classifier C2. This learns the distribution of start and end classes given the style of the target domain Dt,
but these can be error-prone, mainly due to two reasons: 1) The target pseudo labels obtained from C1 are erroneous, and 2) The target domain information makes the classifier C2 difficult to learn the correct distribution of start and end classes on the source domain. Collectively, this happens when the target instances are far apart from the source domain and require explicit optimization for such cases. Hence, we make use of the adversarial loss to first identify the samples of the target domain that are far apart from the support of the source domain. We then update the parameters of answer classifiers C1 and C2 with θg (obtained after domain invariant fine-tuning) frozen to maximize the discrepancy due to such instances. Specifically, we update C1 first keeping C2 fixed and then C2 with updated C1. Subsequently, we minimize the parameters of θg to generate target domain features near the source domain for start and end classes. Mathematically, this has been written as the minmax game of learning domain invariant representations:
min θg max C1,C2 Llc(Xt) (5)
where Llc is the label correction loss optimized for the target domain for maximum performance. The discrepancy maximizing term has been mathematically formulated as the Sliced Wasserstein Distance(SWD) between the representation as in (Kolouri et al., 2019) learnt for start and end classes by classifier C1 and C2 respectively. Let G denote the BERT encoder with parameters θg, the loss is written as:
min C1 ,C2 Lce(f ,Xs||Xt)− ∑ k∈{s,e} Lswd(Ck1 (G(Xt)), Ck2 (G(Xt))) (6)
where Ck1 (.), Ck2 (.) for all k ∈ {s, e} denotes the probability distribution obtained from classifier C1 and C2 for starting and ending indices s and e. This loss updates both classifiers on target aware source domain only for those instances where parallel target domain instances are inconsistent. Since both C1 and C2 trained to predict the start and end indices for the source domain, one with source domain features only and another on source augmented with target domain features. Hence, the classifier C2 can predict the different start and end indices for those instances where C1 is incorrect for target domain. Hence we update the classifier C1 first and then update C2 using updated C1. Adjusted answer classifiers results in updated domain discrepancy for
the non-confident target predictions and hence we need to update the parameters θg so as to generate the target domain features near to source support class wisely. This has been achieved by minimizing the loss function:
min G
∑
k∈{s,e} Lswd(Ck1 (G(Xt)), Ck2 (G(Xt))) (7)
Finally, at the end we use the Encoder G and answer classifier C1 as the domain adapted QA model. Endto-end training of DomainInv Framework is shown in Algorithm 1 (in Appendix B).

heading: 5 Experiments
text: Datasets: We consider the source domain Ds as SQuAD v1.1 (Rajpurkar et al., 2016) following (Yue et al., 2022c, 2021; Shakeri et al., 2020; Cao et al., 2020; Lee et al., 2020). SQuAD v1.1 is a well known annotated QA dataset where paragraphs (context) are from Wikipedia articles. Target Domains Dt are considered from MRQA Split 1 (Fisch et al., 2019b), namely, NaturalQuestions (Kwiatkowski et al., 2019), HotpotQA (Yang et al., 2018), SearchQA (Dunn et al., 2017), TriviaQA (Joshi et al., 2017), NewsQA (Trischler et al., 2016). The dataset details we have considered for target domain is given in Appendix A. Baselines: We trained our DomainInv Framework on top of the fine-tuned QA model on source domain, adopted from BERT with an additional batch normalization layer, as in (Cao et al., 2020). This fine-tuned BERT model, trained on the source domain, acts as the naive baseline. However, to further assess the robustness of our framework in QA domain adaptation, we adopted the following state-of-the-art (SOTA) baselines: 1) QADA (Yue et al., 2022c): QA Domain Adaptation (QADA) leverages hidden space augmentation for enriching the training dataset and used attention-based contrastive learning for domain adaptation. 2) CAQA (Yue et al., 2021): Contrastive Domain Adaption for Question Answering (CAQA) combines question generation and contrastive domain adaptation to learn domain-invariant features, so that it can capture both domains and thus transfer knowledge to the target distribution 3) DAT (Tzeng et al., 2017; Lee et al., 2019b): Domain Adversarial Training (DAT) follows the known adversarial training and uses the [CLS] token in BERT as a discriminator to learn the generalized features from both source and target domains after training with labeled source domain 4) CAQA* (Yue et al., 2021, 2022c): Instead
of question generation in CAQA, this baseline uses the same process of generating pseudo labels and self-supervised adaptation as in QADA. 5) CASe (Cao et al., 2020): Conditional Adversarial SelfTraining (CASe) is an unsupervised domain adaptation method that iteratively performs self-training on high-confidence pseudo-labels and incorporates conditional adversarial learning.
Training, Evaluation and Implementation: Following (Cao et al., 2020; Yue et al., 2022c), we trained the naive baseline of the BERT model with an additional batch norm layer after the encoder (in PyTorch by Hugging Face, using the base-uncased pretrained model with 12 layers and 768-dim hidden state). Specifically, we used a learning rate of 3 · 10−5 and trained for 2 epochs with a batch size of 12, optimized using the AdamW optimizer with 10% linear warm-up on the source domain Ds. Following (Lee et al., 2020; Shakeri et al., 2020; Yue et al., 2021), we evaluated exact matches (EM) and F1 score on the dev sets. The rest of the baselines are implemented according to the methods described in their corresponding papers.
For the DomainInv Framework, we ran the domain invariant fine-tuning followed by adversarial label correction and repeated this for 10 epochs with the AdamW optimizer, learning rate of 10−5, with 10% linear warm-up. During fine-tuning, we generated the labels for the target domain using the classifier C1, which is frozen during fine-tuning, and sampled parallel samples of the target domain with question types of source domain samples in a given batch size of 12. During fine-tuning, there is
only one hyperparameter named k for the domain transformation layer, which has been searched for the best value in [64, 128, 256, 512, 768]. Eventually, the best value of 256 works for us in almost all cases and is the one with the maximum performance on the source domain Ds during fine-tuning. After domain invariant fine-tuning, the obtained classifiers C1, C2, and encoder G are trained with adversarial label correction. We stopped the training in between if there is no decrease in the loss described in equation 7 for the continuous 3 epochs in a row.

heading: 5.1 Experimental Results
text: Table 1 presents the results for QA domain adaptation performance on various target domains, as described in Section 5. We grouped our results and analysis into three main categories, namely: 1) Zero short Target Performance: This reports the results on the target domain with the BERT fine-tuned model without any domain adaptation on the target domain, serving as a lower bound for domain adaptation approaches. 2) QA Domain Adaptation Target Performance: This reports the results due to various domain adaptation methods, including DomainInv.. 3) Supervised Training Target Performance: This reports the results following the supervised training of BERT on the target domain using randomly selected 10K samples, along with all source domain samples, to establish the upper bound performance for QA domain adaptation approaches. QA domain adaptation performance (shown in Table 1) using the DomainInv
Framework outperforms all the domain adaptation baselines across all target domains and is well beyond the naive baseline. In fact, almost all the domain adaptation baselines outperform the naive baseline by a significant margin on all target domains. However, BERT performs poorly (compared to domain adaptation baselines) on some target domains, namely, Natural Questions and SearchQA, due to two main reasons: 1) BERT does not understand the style of Natural Questions; even if the Wikipedia article is the same, the real user questions style is different from the one asked in SQuAD v1.1. 2) BERT does not understand the long form of contexts, which is usual in SearchQA, and it learns to focus on the nearby tokens similar to those in SQuAD v1.1.
However, the actual or more effective answer is also present in the long context. Compared to the worst QA adaptation baseline, DomainInv outperforms BERT on these two domains on average by 2.64% in EM and the other domains by 1.2% in EM. This is the main reason we adopted the domain style-based transformation layer and the corresponding fine-tuning, which can make BERT understand different contexts and questions. The DomainInv Framework outperforms all baselines; on average, it outperforms the best baseline by 2.59% and 2.17% in EM and F1, respectively. Moreover, our framework outperforms supervised training with 10K target data, additionally on Natural Questions and NewsQA, as compared to QADA (best baseline), which outperforms the supervised baseline of 10K target data only on HotpotQA and TriviaQA. We reported all the results after averaging the inference results from 10 rounds.

heading: 5.2 Ablation Studies
text: In Table 1, we compared the DomainInv framework against the strongest baseline named QADA. However, this comparison does not detail the importance of each component of DomainInv, namely, domain invariant fine-tuning and adversarial label correction. The absence of these components can cause a maximum drop of 5.17% compared to the best baseline QADA, highlighting the advantage
of using DomainInv over other domain adaptation approaches. However, the contribution of each component towards performance gain is still unknown. Hence, we studied the performance (mentioned in Table 2) of DomainInv after removing the adversarial label correction component only, since removing the domain-invariant fine tuning as well results in the source-domain trained BERT model, for which the zero-shot performance is already mentioned in Table 1. The performance drop in Table 2 clearly depicts the advantage of adversarial label correction. For target domains, namely HotpotQA, Natural Questions, and NewsQA, the performance of DomainInv w/o adversarial label correction in terms of EM is still higher than that of QADA. However, in SearchQA, it goes below the performance of QADA. This indicates the important insight into the functioning of adversarial label correction. For long contexts like in SearchQA, where matching the answer exactly requires significant correction, and in Natural Questions, where the question style has changed but the context is still the same (i.e., Wikipedia articles), requiring only minor correction in labels. This proves the effectiveness of the label correction component in the DomainInv framework.

heading: 6 Conclusion
text: In this paper, we proposed a novel QA domain adaptation framework called DomainInv. It is an unsupervised algorithm that does not require the use of labeled target domain data, nor does it depend on synthetic data or pseudo-labeled target domain. DomainInv comprises two key components: 1) Domain Invariant Fine Tuning, which fine-tunes the QA model using the target style on the source domain, and 2) Adversarial Label Correction, which identifies target distributions that are far apart from the source domain and optimizes the feature generator to bring them closer to the source support class wisely. Evaluation of DomainInv showed that it outperforms all baselines, achieving superior performance and establishing a new benchmark.
Limitations
In this section, we highlights certain limitations of DomainInv that were not covered in the paper. In the domain invariant fine-tuning, we introduced a new layer called the domain adaptation layer, which computes the difference between the average pooled representations of the source and target domains. However, this design assumes equal importance for all tokens in both domains at each layer, overlooking the influence of the self-attention mechanism on token distribution. To rectify this, future work should explore incorporating attentionweighted representations before calculating the difference. Additionally, in the adversarial label correction, we proposed adjusting the feature encoder solely based on the target domain, neglecting the potential benefits of jointly aligning both source and target domains. Further research could explore these aspects for improvement.

heading: A Benchmark Datasets
text: The dataset details we have considered for target domain is given as follows:
• NaturalQuestions: A real world QA dataset with questions that are actual user questions, and contexts as Wikipedia articles, which may or may not contain the answers (Kwiatkowski et al., 2019)
• HotpotQA: A reasoning based QA dataset with multi hop questions and supporting facts (Yang et al., 2018)
• SearchQA: QA dataset where context built by crawling through Google Search. However, this is based on existing QA pairs for which the context is extended. More details in (Dunn et al., 2017)
• TriviaQA: A reasoning based QA dataset containing evidences for questions asked (Joshi et al., 2017)
• NewsQA: QA dataset with news as contexts and questions with answers not from simple matching and entailment. (Trischler et al., 2016)

heading: B Algorithm
text: We presented the end-to-end DomainInv algorithm as follows:
Algorithm 1 DomainInv Training for UDA Require: Labeled Source {Xs,Ys}; unlabelled Target {Xt},
hyperparameter k, fine tuned QA model with encoder G and Classifier C1 and classifier C2 initialized with C1. Step 1: Update G, C2 on Source Domain (with target style augmentation) using Domain Invariant FineTuning as in Equation 4 while G, C1, C2 still converging do Step 2: Update C1, C2 on target aware source set to maximize the sliced Wasserstein distance (SWD) on target instances as in Equation 6 Step 3: Update G to minimize the SWD as calculated earlier according to Equation 7 end while

heading: Future Work
text: To rectify this, future work should explore incorporating attentionweighted representations before calculating the difference. Additionally, in the adversarial label correction, we proposed adjusting the feature encoder solely based on the target domain, neglecting the potential benefits of jointly aligning both source and target domains. Further research could explore these aspects for improvement