The Role of Embedding Complexity in Domain-invariant Representations

Ching-Yao Chuang, Antonio Torralba, Stefanie Jegelka

Abstract

In unsupervised domain adaptation (UDA), the prevailing strategy is to learn domain-invariant representations by aligning source and target distributions in a shared latent space. However, this paper demonstrates that increasing the complexity of the embedding function can paradoxically lead to higher target error, a phenomenon termed "alignment overfitting." We introduce a new theoretical generalization bound that incorporates embedding complexity and propose Multilayer Divergence Minimization (MDM) to stabilize performance by aligning representations across multiple network layers.

Introduction

Unsupervised Domain Adaptation (UDA) aims to leverage labeled data from a source domain to perform well on an unlabeled target domain. The standard approach involves training an encoder to map both domains into a shared latent space where a discriminator cannot distinguish between them. Theoretically, if the distributions are identical, a classifier trained on the source should generalize to the target.

However, empirical evidence suggests that making the encoder deeper or more powerful does not always improve performance. In many cases, it actually increases target error despite achieving perfect distribution alignment. This research investigates the "Goldilocks zone" of embedding complexity and provides a framework to navigate it.

The Pitfall of Alignment Overfitting

The core issue identified is that a sufficiently flexible encoder can find a way to align two distributions that completely destroys underlying label consistency. For instance, it might map "cats" in the source to "dogs" in the target simply to satisfy the discriminator's requirement for identical distributions.

Comparison of linear and nonlinear embeddings in domain alignment.

As shown in Figure 1, while a linear embedding might fail to align complex distributions, a nonlinear embedding can achieve perfect alignment by "scrambling" the data. This flexibility allows the model to minimize domain divergence while simultaneously increasing the error of the predictor, as the semantic meaning of the features is lost during the transformation.

Theoretical Generalization Bound

The authors derive a new upper bound for target risk that explicitly accounts for Embedding Complexity. Unlike previous bounds that focused primarily on the complexity of the predictor, this new formulation shows that the target error is bounded by the source error, the domain divergence, and a term representing the complexity of the embedding function. This theoretical insight explains why overly deep encoders lead to performance degradation: they minimize divergence at the cost of excessive embedding complexity.

Empirical Evidence: The U-Curve of Complexity

Experiments on standard benchmarks, such as the Amazon reviews dataset and digit classification tasks (MNIST, SVHN), reveal a consistent "U-shaped" error curve relative to encoder depth.

Empirical verification of target error vs. encoder complexity on Amazon reviews.

As seen in Figure 2(a), as the number of layers in the encoder increases, the target error initially drops as the model gains the capacity to align the domains. However, beyond a certain point (the "Goldilocks zone"), the error begins to rise again. This confirms that deeper encoders are more prone to alignment overfitting. Furthermore, Figure 2(b) illustrates that the choice of which layer to align is critical, as aligning at the wrong depth can lead to suboptimal results.

Multilayer Divergence Minimization (MDM)

To address these challenges, the authors propose Multilayer Divergence Minimization (MDM). Instead of aligning only at the final bottleneck layer, MDM places discriminators at multiple intermediate layers of the neural network. By minimizing a weighted sum of divergences across these layers, the method provides an implicit regularization that prevents any single layer from "scrambling" the representation to force alignment.

Key advantages of MDM include:

  • Robustness: It reduces the sensitivity to encoder depth and architecture choice.
  • Performance: It consistently matches or outperforms the best hand-tuned single-layer alignment models.
  • Simplicity: It can be easily integrated into existing domain-adversarial frameworks like DANN.

Conclusion

This work highlights that in UDA, representation learning is a delicate balance between alignment and complexity. By recognizing the risks of alignment overfitting and utilizing multilayer alignment strategies like MDM, practitioners can build more robust models that generalize effectively across domains without the need for exhaustive architecture tuning.

Summary updated

BibTeX
@misc{chuang2019role,
  author = {Ching-Yao Chuang and Antonio Torralba and Stefanie Jegelka},
  title = {{The Role of Embedding Complexity in Domain-invariant Representations}},
  year = {2019},
  eprint = {1910.05804},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.05804},
}
Figure