Unsupervised Domain Adaptation for Text Classification via Meta Self-Paced Learning (2022)

Abstract: A shift in data distribution can have a significant impact on performance of a text classification model. Recent methods addressing unsupervised domain adaptation for textual tasks typically extracted domain-invariant representations through balancing between multiple objectives to align feature spaces between source and target domains. While effective, these methods induce various new domain-sensitive hyperparameters, thus are impractical as large-scale language models are drastically growing bigger to achieve optimal performance. To this end, we propose to leverage meta-learning framework to train a neural network-based self-paced learning procedure in an end-to-end manner. Our method, called Meta Self-Paced Domain Adaption (MSP-DA), follows a novel but intuitive domain-shift variation of cluster assumption to derive the meta train-test dataset split based on the self-pacing difficulties of source domain’s examples. As a result, MSP-DA effectively leverages self-training and self-tuning domain-specific hyperparameters simultaneously throughout the learning process. Extensive experiments demonstrate our framework substantially improves performance on target domains, surpassing state-of-the-art approaches. Detailed analyses validate our method and provide insight into how each domain affects the learned hyperparameters.

## introduction given enough supervision, modern deep learning models can learn a new task with great accuracy. however, in many practical settings, the goal is to adapt to a new domain in which there is a different in data distribution between training and testing processes. this poses a major challenge for standard natural language systems due to both the intrinsic variation of linguistics (e.g., lexical shift, semantic shift) as well as the extrinsic factors such as how textual datasets are collected and annotated. for example, a model trained to predict news events may easily recognize, from medical domain, "died" as an event, but would not be able to detect obvious events such as "mutation" or "cancer". such a model may even fail to generalize to closer adaptation settings (e.g. news from different times and sources). the majority of existing unsupervised domain adaptatiopn (uda) approaches combined various training objectives to align different aspects of domain-specific extracted features. in particular, the most prominent approach is domain-adversarial neural network (dann) @xcite ) that employs a domain-adversarial training procedure between a domain classifier and the network's feature extractor to learn a discriminative and domaininvariant joint feature representation. the simplicity of dann allows researchers to incorporate it with multiple other objectives such as semisupervised learning (ssl) regularizers @xcite , discrepancy metrics @xcite , cotraining @xcite , and auxiliary tasks @xcite . each of them plays an important role in enhancing domain adaptation ability of models in the current state-of-the-art methods. however, it is not trivial to apply these techniques to textual tasks, where large transformer-based language models are essential to achieve top performance, because of the time and resource required to fine-tune and balance the effects of these terms for multiple different adaptation scenarios. meta-learning (ml) framework is an effective solution for the problem of hyperparameter optimization @xcite . furthermore, it has been widely applied by recent works on domain generalization (dg) @xcite , in which a learning procedure similar to that of model-agnostic meta-learning (maml) @xcite is leveraged to simulate the domain shift in train-test datasets by a virtual meta train-test set created from data drawn only from source domains. though dg and uda share close similarities, the final goal of each learning setting is different. more importantly, the maml procedure is not applicable for uda problem because of the lack of a clean validation dataset for meta-test step. to this end, we propose to dynamically partition the training source data into a low-loss meta-source domain and a high-loss meta-target domain, inspired by self-paced learning (spl) approach @xcite . our framework, called meta self-paced domain adaptation (msp-da), employs a neural-spl module to control the data selection process for meta train-test set using a learnable age hyperparameter as threshold while also introducing optimized weighting mechanisms for each of the combined loss' terms, including instancewise weighting for the main classification task and layer-wise weighting for domain alignment losses. the weighted objectives on meta-source domain are minimized in meta-train step in a direction such that also leading to improvement in model's predictions on meta-target domain. during the learning process, parameters and age threshold of the neural-spl module are updated based on model's evaluation performance in meta-test step, resulting in tuned weighting coefficients and learning schedules similar to that of a standard hyperparameter tuning process. to our knowledge, this is the first work to devise a neural network-based spl method, in which both the sample weightings/selections and the age hyperparameter are dynamically optimized, generalizing previous works which require heuristic age schedule and complicated mathematical derivation for the corresponding instance weighting. while the meta-target set does not contain samples from the true target domain, we argue that our formulation is beneficial for uda because of the two following reasons. first, the proposed partition can result in two virtual domains with a significant discrepancy, and through learning to address in this hard setting that the model would gain the ability to adapt to other, possibly easier, domains. another reason is based on the cluster assumption from ssl methods @xcite , which states that data points of the same class should concentrate around the same cluster, effectively forming a high-density low-loss region. in case of adapting between two highly dissimilar domains, these regions may get shifted significantly, as a consequence low-loss regions of target domain may contain considerable intersection with high-loss regions of source domain, as illustrated in fig. 1 . in other words, by learning to adapt the high-loss meta-target domain, the model would also be able to generalize to a significant portion of the true target domain. we provide extensively evaluation of the proposed framework on the standard uda benchmarks -fdu-mtl dataset for sentiment analysis task, along with additional results for event detection task on ace-05 dataset, which is a much harder adaptation setting. ablation studies and detailed analyses are conducted to validate each main component of our model and provide insights for future researches. ## discussion following the analysis of mldg framework presented in @xcite , we decompose the meta-test loss, given that θ = θ -αl ′ tr (θ), using the first order taylor expansion: the third term in eq. 11 is a gradient-based regularization that penalizes inconsistency between parameter updates of meta-train and meta-test domains. by enforcing loss gradients of the two domains to follow a similar direction, eq. 11 prevents the model from over-fitting to a single domain, effectively improves model's adaptation capacity provided that meta-test set is 'close' to target domain. we further examine how the ml framework affects the values of neural-spl module's parameters (θ w , θ v , λ a ) in our model. plugging eq. 10 into the gradient of λ a , we have: from eq. 12, we see that the multiplicative factor g also controls how the value of λ a changes throughout the ml process. when there is a significant discrepancy between meta-train and meta-test domain, g would have a negative value, which would in effect push λ a higher and allow more samples into meta-train set for easier adaptation to meta-test set. conversely, a positive g would imply that the model is good enough to align the current meta domains, thus gradually pulling λ a down to make the task harder. this behavior is clearly illustrated in fig. 3 . similar arguments can be made for the meta-learned weighting coefficients, where g would encourage samples whose gradients are similar across domains while decreasing the contribution of those whose gradients are not. these understanding are also presented in @xcite and closely related to how maml works @xcite 6 conclusion we present a novel ml framework for uda setting that achieves state-of-the-art performance on ed task. in particular, a neural-spl module is employed to adaptively partition source domain into meta-train and meta-test set, while simultaneously learns the instance-wise and layer-wise weights for the loss terms of downstream task and domain adversarial task respectively. the proposed model significantly improves domain adaptation performances against various baselines on every domain without domain-specific hyperparameter tuning. in the future, we intend to apply our approach to the several direction: (1) we will extend our work to multilingual problems @xcite , or other domains and tasks @xcite ;