Source-linked AI summary
Multi-Source Domain Adaptation for Text Classification via DistanceNet-Bandits
Han Guo, Ramakanth Pasunuru, Mohit Bansal
TL;DR
Domain adaptation addresses the challenge of transferring from labeled source data when the target distribution differs and target labels are unavailable. The paper studies domain-distance measures, incorporates them into DistanceNet, and uses a bandit controller to select among source domains; its models outperform corresponding baselines in sentiment-analysis experiments.
Problem
When test-time data distributions differ from training distributions, collecting new target-domain labels may be unscalable, motivating unsupervised domain adaptation and better ways to estimate and use domain dissimilarity.
Source: §1 · p. 1Method
The paper compares domain-distance measures, adds one or a selected mixture as a loss alongside classification loss, and uses a multi-armed bandit to dynamically select source domains.
Source: §1 · pp. 1–2, §3.6 · p. 4Results
Takeaways & Limitations
Across the reported sentiment-analysis domains, no single distance measure is best in all analyses, while DistanceNet and its dynamic variant outperform competitive baselines.
Source: §1 · pp. 1–2Proxy A-distance was excluded because it is nondifferentiable and computationally costly.
Source: §3.3 · p. 3
Abstract
from arXiv · showhide
Domain adaptation performance of a learning algorithm on a target domain is a function of its source domain error and a divergence measure between the data distribution of these two domains. We present a study of various distance-based measures in the context of NLP tasks, that characterize the dissimilarity between domains based on sample estimates. We first conduct analysis experiments to show which of these distance measures can best differentiate samples from same versus different domains, and are correlated with empirical results. Next, we develop a DistanceNet model which uses these distance measures, or a mixture of these distance measures, as an additional loss function to be minimized jointly with the task's loss function, so as to achieve better unsupervised domain adaptation. Finally, we extend this model to a novel DistanceNet-Bandit model, which employs a multi-armed bandit controller to dynamically switch between multiple source domains and allow the model to learn an optimal trajectory and mixture of domains for transfer to the low-resource target domain. We conduct experiments on popular sentiment analysis datasets with several diverse domains and show that our DistanceNet model, as well as its dynamic bandit variant, can outperform competitive baselines in the context of unsupervised domain adaptation.
1 Introduction
Domain adaptation addresses distribution shifts between training and test data, where collecting new target-domain labels can be unscalable. This work studies domain-distance measures and uses them to improve unsupervised adaptation, including across multiple source domains.
1 Introduction
- Domain adaptation is motivated by test-time distributions differing from training distributions, while collecting new representative datasets can be costly and time-consuming.The paper focuses on unsupervised adaptation, where target-domain data are unlabeled.Source: §1 · p. 1
- The study compares L2, MMD, FDA, cosine, and CORAL for scalability, differentiability, and interpretability, finding no single best measure for all cases.It proposes selecting a subset for a mixture using an unsupervised criterion to reduce extra weight hyperparameters.Source: §1 · pp. 1–2
- The paper augments classification training with a domain-distance loss and uses a multi-armed bandit to schedule candidate source domains for a target task.The controller frames dynamic source selection as a multi-armed bandit problem.Source: §1 · p. 2
- DistanceNet and its dynamic bandit variant outperform competitive baselines on sentiment analysis across diverse domains, including a comparable multi-source baseline using the same amount of data.The study also finds that a subset of discrepancy measures separates source and target samples.Source: §1 · p. 2
2 Related Work
Prior domain-adaptation work includes methods for estimating discrepancy and aligning or transforming feature spaces. This paper compares distance measures for NLP classification and explores their integration into training and dynamic source selection.
2 Related Work
- Existing unsupervised adaptation approaches include instance selection or reweighting, feature-space transformation, distribution-moment matching with MMD, and representation learning that fools a domain classifier.The passage also reviews CMD, CORAL, CCA, cosine similarity, association loss, and metric learning.Source: §2 · p. 2
- Prior discrepancy estimation includes domain-classifier approaches, with proxy A-distance providing a tractable approximation based on a linear classifier and modified Huber loss.The cited work connects classifier error to domain discrepancy [7].Source: §2 · p. 2
- Unlike prior uses of Bayesian optimization or metalearning to choose criteria, this work compares distance measures for NLP and explores mixtures and bandit-based multi-source selection.Earlier multi-source work also used mixture-of-experts approaches [Guo, Shah, and Barzilay 2018; Chen et al. 2019]; this paper uses UCB for source-domain selection [Auer, Cesa-Bianchi, and Fischer 2002].Source: §2 · pp. 2–3
3 Domain Distance Measures
The paper defines five sample-based measures of source–target domain dissimilarity and proposes combining measures because each can have pathological cases and no single measure performs best across analyses.
3 Domain Distance Measures
- The measures estimate the difference between source and target embedding samples, with L2, cosine, MMD, FLD, and CORAL providing distinct alternatives.The embeddings may come from feature extractors such as an LSTM-RNN.Source: §3 · p. 3
3.1 L2 Distance
- L2 distance is the Euclidean distance between the source and target sample means.It is defined as the norm of the difference between the two means.Source: §3.1 · p. 3
3.2 Cosine Distance
- Cosine distance is one minus the cosine similarity between the source and target sample means.The similarity uses their inner product normalized by their norms.Source: §3.2 · p. 3
3.3 Maximum Mean Discrepancy (MMD)
- MMD is a kernel two-sample statistic for distinguishing whether source and target samples come from the same distribution.With a characteristic kernel on the unit ball of an RKHS, the measure has a closed form and an unbiased finite-sample estimate; minimizing it is analogous to minimizing distances between all distribution moments.Source: §3.3 · p. 3
3.4 Fisher Linear Discriminant
- FLD uses the optimal class-separation objective as a proxy for domain distance, contrasting source and target means relative to within-class scatter.The discriminant maximizes separation of class means while keeping within-class variance small.Source: §3.4 · p. 3
3.5 Correlation Alignment (CORAL)
- CORAL measures the distance between the second-order statistics of source and target samples.The passage identifies the relevant statistics as their covariance matrices.Source: §3.5 · p. 3
3.6 Mixture of Distances
- Because no single measure outperforms all others and measures can have pathological cases, the paper proposes a weighted mixture that selects a subset using unsupervised criteria.For example, L2 may be small for Gaussian and Laplace samples with the same mean and variance, while MMD can distinguish them.Source: §3.6 · pp. 3–4
4 Models
The models progress from a source-only classifier to DistanceNet, which adds a source–target representation-distance term. For multiple sources, a bandit controller selects domains during training using validation feedback.
4.1 Baseline Model
- The baseline embeds token sequences, uses an LSTM-RNN and fully connected layer to predict labels, and trains with source-domain cross-entropy.The model parameters are learned by minimizing cross-entropy on labeled source examples.Source: §4.1 · p. 4
4.2 DistanceNet
- DistanceNet adds a domain-distance term between source and target representations to the source classification loss, jointly encouraging task fit and representation alignment.The distance measure is selected from the measures defined earlier.Source: §4.2 · p. 4
4.3 Dynamic Multi-Source DistanceNet using Multi-Armed Bandit
- For multiple sources, a multi-armed bandit dynamically selects the training domain, using validation performance as reward and UCB to choose among candidate domains.The controller tracks action values as running averages of rewards and uses their performance upper bounds to guide selection.Source: §4.3 · pp. 4–5
5 Experimental Setup
Experiments use sentiment-review datasets for binary classification, with a restricted set of domains for adaptation evaluations. The setup also gives the bandit controller small target-domain validation data for reward feedback.
5 Experimental Setup
- Experiments use 3 datasets for single-source and 5 for multi-source adaptation, drawn from 16 product- and movie-review datasets.The binary task is positive-versus-negative review classification, evaluated by accuracy.Source: §5 · p. 5
- The model encodes sentences with a single-layer bidirectional LSTM-RNN and uses a two-layer fully connected ReLU output network initialized with GloVe embeddings.Training uses Adam.Source: §5 · p. 5
- A small target-domain validation set tunes models and supplies weak reward feedback to the multi-armed bandit controller.The two Table 5 models are described as fairly comparable because they have access to the same validation data.Source: §5 · p. 5
- Each model runs three times; average validation performance is used for validation and average test performance is reported.Hyperparameters are tuned with Ax over the specified learning-rate, dropout, β, and α_k ranges.Source: §5 · p. 5
6 Analysis of Distance Measures
The analysis tests whether distance measures separate same- from different-domain samples, track transfer performance, and contribute nonredundant information to a mixture.
6.1 Domain Separability Test
- Across 16 domains, DL2, Dcos, DMMD, and DFLD separated domains well, while DCORAL was the exception; DL2 led Method-1 and DFLD led Method-2.The figure encodes in-domain distances on the diagonal and between-domain distances off the diagonal.Source: §6.1 · pp. 5–6, Figure 3 · p. 6
- Method-1 checks whether same-domain distances are no greater than different-domain distances; it is scale- and translation-invariant but ignores the size of the gap.Method-2 standardizes the distance matrix, applies softmax, and sums the diagonal entries; lower scores are better.Source: §6.1 · p. 6
6.2 Correlation With Results
- Most distance measures correlated with source-to-target baseline performance, while DCORAL had the lowest correlation and was excluded from later experiments.The study uses Pearson correlation with baseline performance as a proxy for latent domain distance.Source: §6.2 · p. 6
6.3 Informativeness of Mixture Components
- The mixture analysis estimates each metric’s informativeness by comparing mixture quality before and after removing that metric, using unsupervised z2 as the quality criterion.A small removal impact indicates a metric is not informative given the remaining components.Source: §6.3 · pp. 6–7
- Removing Dcos had far lower impact on optimal z2 than removing the other considered measures, so Dcos was omitted from the distance mixtures.The maximum z2 value is estimated using gradient descent.Source: §6.3 · p. 7
7 DistanceNet and Bandit Results
The section compares DistanceNet variants with baselines for single- and multi-source sentiment adaptation, then illustrates how the bandit’s source-domain values change over training. The multi-source bandit improves individual and average results over round-robin selection.
7.1 Single Source DistanceNet Results
- The in-domain baseline is stronger than comparable prior work in four of the five evaluated domains.The experiments exclude z1 because it is nondifferentiable and nearly maximal, and exclude correlation because the evaluation criterion is unsupervised.Source: Table 3 · p. 7, §7.1 · p. 7
- All single-distance DistanceNet models improve average results over the baseline, and MMD exceeds it by one corresponding standard deviation.Adding a domain-distance loss also reduces the gap between in-domain and out-of-domain performance.Source: Table 4 · p. 7, §7.1 · p. 7
- Mixtures of distance measures achieve the highest average out-of-domain results, better than the baseline by two standard deviations.The mixture model also outperforms DANN and DataSel by standard-deviation margins.Source: §7.1 · pp. 7–8, Table 4 · p. 7
7.3 Multi-Armed Bandit Visualization
- Bandit visualizations track each source domain’s value over time; Books has the highest value for Camera, while Camera and Apparel benefit Baby.For the MR target, Books and Apparel are more beneficial; for Apparel, the bandit also switches between Books and MR over time.Source: Figure 4 · p. 8, §7.3 · p. 8
7.2 Multi-Source DistanceNet-Bandit Results
- The dynamic controller improves individual and average multi-source results over the round-robin baseline, with average results better by two standard deviations.The bandit also improves over the baseline when reusing single-source hyperparameters or using cross-entropy without the DistanceNet loss.Source: §7.2 · p. 8
8 Conclusion
The conclusion recaps the study of domain-distance measures and the DistanceNet and bandit approaches. It reports that both approaches outperform corresponding baselines, with a source-specific masking condition for some targets.
8 Conclusion
- The study analyzes domain-distance measures for separating same- from different-domain samples and for correlation with empirical results.Source: §8 · p. 8
- For targets other than MR or Books, the DistanceNet loss is masked for those source domains because they were not helpful for the other three tasks.Source: §8 · p. 8
- DistanceNet adds distance measures to the loss, while its multi-source extension uses a multi-armed bandit controller.Source: §8 · p. 8
- DistanceNet and its bandit variant outperform their corresponding baselines in the reported experiments.Source: §8 · p. 8