Domain Adaptation and Entanglement: an Optimal Transport Perspective

Okan Koc, Alexander Soen, Chao-Kai Chiang, Masashi Sugiyama

Abstract

Current machine learning systems are brittle in the face of distribution shifts (DS), where the target distribution that the system is tested on differs from the source distribution used to train the system. This problem of robustness to DS has been studied extensively in the field of domain adaptation. For deep neural networks, popular methods for unsupervised domain adaptation (UDA) are domain matching methods that try to align the marginal distributions in the feature or output space. The current theoretical understanding of these methods, however, are limited and existing theoretical frameworks are not precise enough to characterize their performance in practice. To this end, we derive new bounds based on optimal transport that analyze the UDA problem. Our new bound includes a term which we dub as entanglement, consisting of an expectation of Wasserstein distance between conditionals with respect to changing data distributions. Analysis of the entanglement term provides a novel perspective on the unoptimizable aspects of UDA. In various experiments with multiple models across several DS scenarios, we show that this term can be used to explain the varying performance of UDA algorithms.

Introduction

Machine learning models are notoriously "brittle" when faced with distribution shift—where the data they are tested on (the target domain) looks different from the data they were trained on (the source domain). Unsupervised Domain Adaptation (UDA) aims to fix this by using unlabeled data from the target domain to "align" it with the source domain.

The most common strategy is marginal matching: making the overall "shape" of the data in both domains look the same. However, there is a catch. You can align the shapes perfectly while still mixing up the labels (e.g., aligning the "cats" in the source domain with the "dogs" in the target domain). This paper addresses the lack of precise theoretical tools to characterize this failure mode, which the authors call entanglement.

Theoretical Framework: The Concept of Entanglement

The authors leverage Optimal Transport (OT)—a mathematical framework for measuring distances between probability distributions—to derive new theoretical upper bounds for a model's risk on the target domain.

Visualizing entanglement: Even when marginal distributions are aligned, class-conditionals can become mixed across the decision boundary, leading to incorrect predictions.

Key components include:

  • The Entanglement Term: This is the paper's core contribution. It is defined as the expected Wasserstein distance between class-conditional distributions. It quantifies how much the "labels" get mixed up when the "features" are aligned.
  • Oracle Bounds: Since we don't have labels in the target domain, the entanglement term is technically unoptimizable. The authors use "Oracles" (hypothetical models that do see target labels) to calculate the Low Joint Error (LJE) and Close Conditionals (CC) assumptions, providing a benchmark for the best possible performance.
  • Wasserstein Regularized Risk (WRR): A practical objective function that minimizes source risk plus the Wasserstein distance between source and target marginals. The authors use this to study how entanglement evolves during training.

Experimental Methodology

The researchers evaluated their theory across a diverse set of distribution shift scenarios:

  • Digit Datasets: MNIST $\leftrightarrow$ USPS and SVHN $\rightarrow$ MNIST.
  • MNIST-M: A version of MNIST with complex, colored backgrounds.
  • Portraits: A dataset of yearbook photos from 1905 to 2013, studying temporal shifts in fashion and lighting.
  • CIFAR-10c: A benchmark for robustness against common image corruptions (fog, snow, frost).
  • Office-Home: Shifts between product images and real-world photos.

Key Insights and Results

  • The Alignment Trap: Minimizing the distance between data distributions (marginal alignment) does not guarantee the model will learn the correct labels. In fact, the optimization process can actively increase "entanglement," causing target accuracy to degrade even as the distributions look more similar.
  • Entanglement as a Metric of Hardness: The entanglement term provides a novel perspective on why some UDA tasks are harder than others. If the "Close Conditionals" (CC) oracle cannot find a good solution, the task is likely impossible for standard UDA algorithms.
  • Correlation with Accuracy: Experiments showed a strong negative correlation between the estimated entanglement and target accuracy. As entanglement goes up, accuracy goes down.
  • Loss Function Matters: Interestingly, using Euclidean distance as a loss function often outperformed standard cross-entropy in these OT-based settings, particularly in reducing entanglement.
  • CIFAR-10c Difficulty: The theory explained why UDA often fails on CIFAR-10c: even though a good joint classifier exists (Low LJE), the conditionals are fundamentally difficult to align (High CC), leading to high entanglement.

Limitations and Future Work

The entanglement term requires target labels to calculate, meaning it can't be directly minimized in a real-world UDA scenario. It serves more as a diagnostic and theoretical tool than a direct training objective. Furthermore, the authors note that the WRR objective function is not always effectively minimized by standard optimizers like Adam, suggesting that the "optimization landscape" of OT-based UDA needs more study.

Future directions include exploring more "reasonable" assumptions beyond Gradual Shift to make UDA more tractable and developing new algorithms that can implicitly minimize entanglement without needing target labels.

Summary updated

BibTeX
@inproceedings{koc2025domain,
  author = {Okan Koc and Alexander Soen and Chao-Kai Chiang and Masashi Sugiyama},
  title = {{Domain Adaptation and Entanglement: an Optimal Transport Perspective}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2025},
  url = {https://openreview.net/forum?id=ZDyi1BeTu7},
}
Figure