Multi-Source Attention for Unsupervised Domain Adaptation (2020)

Abstract: We model source-selection in multi-source Unsupervised Domain Adaptation (UDA) as an attention-learning problem, where we learn attention over the sources per given target instance. We first independently learn source-specific classification models, and a relatedness map between sources and target domains using pseudo-labelled target domain instances. Next, we learn domain-attention scores over the sources for aggregating the predictions of the source-specific models. Experimental results on two cross-domain sentiment classification datasets show that the proposed method reports consistently good performance across domains, and at times outperforming more complex prior proposals. Moreover, the computed domain-attention scores enable us to find explanations for the predictions made by the proposed method.

## introduction domain adaptation (da) considers the problem of generalising a model learnt using the data from a particular source domain to a different target domain @xcite . although most da methods consider adapting to a target domain from a single source domain @xcite @xcite , often it is difficult to find a suitable single source to adapt from, and one must consider multiple sources. for example, in sentiment classification, each product category is considered as a domain @xcite , resulting in a multi-domain adaptation setting. unsupervised da (uda) is a special case of da where labelled instances are not available for the target domain. existing approaches for uda can be categorised into pivot-based and instancebased methods. pivots refer to the features common to both source and target domains @xcite . pivot-based single-source domain adaptation methods, such as structural correspondence learning (scl; @xcite and @xcite , first select a set of pivots and then project the source and target domain documents into a shared space. next, a prediction model is learnt in this shared space. however, these methods fail in multi-source settings because it is challenging to find pivots across all sources such that a single shared projection can be learnt. similarly, instance-based methods, such as stacked denoising autoencoders (sda; @xcite and marginalised sda (msda; @xcite minimise the loss between the original inputs and their reconstructions. not all of the source domains are appropriate for learning transferable projections for a particular target domain. adapting from an unrelated source can result in poor performance on the given target, which is known as negative transfer @xcite @xcite . prior proposals for multi-source uda can be broadly classified into methods that: (a) first select a source domain and then select instances from that source domain to adapt to a given target domain test instance @xcite @xcite ; (b) pool all source domain instances together and from this pool select instances to adapt to a given target domain test instance @xcite ; (c) pick a source domain and use all instances in that source (source domain selection) @xcite ; and (d) pick all source domains and use all instances (utilising all instances) @xcite @xcite . in contrast, we propose a multi-source uda method that systematically addresses the various challenges in multi-source uda. we evaluate the proposed method on two standard cross-domain sentiment classification benchmarks for uda. we find that both pseudo-labels and domain-attention scores contribute toward improving the classification accuracy for a target domain. the proposed method reports consistently good performance in both datasets and across multiple domains. although the proposed method does not outperform more complex uda methods in some cases, using the domain-attention scores, we are able to retrieve justifications for the predicted labels. ## related work in § 1 we already mentioned prior proposals for single-source da and this section discusses multisource da, which is the main focus of this paper. @xcite created a sentiment sensitive thesaurus (sst) using the data from the union of multiple source domains to train a cross-domain sentiment classifier. the sst is used to expand feature spaces during train and test times. the performance of sst depends heavily on the selection of pivots @xcite . @xcite proposed a sentiment da method from multiple sources (sdams) by introducing two components: a sentiment graph and a domain similarity measure. the sentiment graph is extracted from unlabelled data. similar to sst, sdams uses data from multiple sources to maximise the available labelled data. @xcite proposed a mixture of distance measures and used a multi-arm bandit to dynamically select a single source during training. however, in our proposed method all domains are selected and contributing differently as specified by their domain-attention weights for each train and test instance. moreover, we use only one distance measure and is easier to implement. recently, adversarial nns have become popular in da @xcite @xcite . adversarial training is used to reduce the discrepancy between source and target domains @xcite . domain-adversarial neural networks (dann; @xcite use a gradient reversal layer to learn domain independent features for a given task. multiple source domain adaptation with adversarial learning (mdan; @xcite generalises dann and aims to learn domain independent features while being relevant to the target task. @xcite proposed end-to-end adversarial memory network (amn), inspired by memory networks @xcite , and automatically capture pivots using an attention mechanism. @xcite proposed an uda method using a mixture of experts for each domain. they model the domain relations using a point-to-set distance metric to the encoded training matrix for source domains. next, they perform joint training over all domain-pairs to update the parameters in the model by meta-training. however, they ignore the available unlabelled instances for the source domain. adversarial training methods have shown to be sensitive to the hyper parameter values and require problem-specific techniques @xcite . @xcite modeled domain relations using exampleto-domain based on an attention mechanism. however, the attention weights are learnt using source domain training data in a supervised manner. following a self-training approach, @xcite proposed a two-stage weighting framework for multi-source da that first computes the weights for features from different source domains using maximum mean discrepancy (mmd; @xcite . next, they generate pseudo labels for the target unlabelled instances using a classifier learnt from the multiple source domains. finally, a classifier is trained on the pseudo-labelled instances for the target domain. their method requires labelled data for the target domain, which is a supervised da setting, different from the uda setting we consider in this paper. our proposed method uses self-training to assign pseudo-labels for the unlabelled target instances, and learn an embedding for each domain using an attention mechanism. ## multi-source domain attention let us assume that we are given n source domains, s 1 , s 2 , . . . , s n , and required to adapt to a target domain t . moreover, let us denote the labelled instances in s i by s l i and unlabelled instances by s u i . for t we have only unlabelled instances t u in uda. our goal is to learn a binary classifier foot_0 to predict labels (∈ {0, 1}) for the target domain instances using the steps of our proposed method can be summarised as follows: (a) use labelled and unlabelled instances from each of the source domains to learn classifiers that can predict the label for a given instance. next, develop a majority voter and use it to predict the pseudo-labels for the target domain unlabelled instances t u ( § 3.1); (b) compute a relatedness map between the target domain's pseudolabelled instances, t l * , and source domains' labelled instances s l ( § 3.3); (c) compute domainattention weights for each source domain ( § 3.4); (d) jointly learn a model based on the relatedness map and the domain-attention weights for predicting labels for the target domain's test instances ( § 3.5). ## experiments to evaluate the proposed method, we use the multi-domain amazon product review dataset compiled by @xcite . this dataset contains product reviews from four domains: books (b), dvd (d), electronics (e) and kitchen appliances (k). following guo et al. (2018 ), we conduct experiments under two different splits of this dataset as originally proposed by blitzer et al. (2007) (blitzer2007) and by chen et al. (2012) (chen2012). in chen2012, each domain contains 2000 labelled training instances (1000 positive and 1000 negative), and 2000 target test instances (1000 positive and 1000 negative). the remainder of the instances are used as unlabelled instances (ca. 4k-6k for each domain). we use the publicly available 3 5000 dimensional tf-idf vectors produced by @xcite . we use a multilayer perceptron (mlp) with an input layer of 5000 dimensions and 3 hidden layers with 500 dimensions. we use final output layer with 500 dimensions as the representation of an instance. for each setting, we follow the standard input representation methods as used in prior work. it also shows the flexibility of the proposed method to use different (embedding vs. bow) text representation methods. we conduct experiments for cross-domain sentiment classification with multiple sources by selecting one domain as the target and the remaining three as sources. the statistics for the two settings are shown in ## conclusions we propose a multi-source uda method that combines self-training with an attention module. in contrast to prior works that select pseudo-labelled instances based on prediction confidence of a predictor learnt from source domains, our proposed method uses similarity to the target domain during adaptation. our proposed method reports competitive performance against previously proposed multi-source uda methods on two splits on a standard benchmark dataset.