Abstract
This paper introduces a latent variable framework for multi-domain learning that treats "domains" as hidden factors rather than fixed labels. By utilizing stochastic channel gating and variational inference, the proposed model effectively navigates heterogeneous datasets where domain labels may be missing or overlapping. Experimental results on multi-domain sentiment analysis and language identification show that this approach outperforms state-of-the-art adversarial domain adaptation methods, particularly when using continuous latent variables and Dirichlet priors.
Introduction
Most Natural Language Processing (NLP) systems struggle when the training data distribution differs from the test data distribution. Traditional domain adaptation techniques often rely on two problematic assumptions: that every training instance is perfectly labeled with its domain, and that domains have discrete, monolithic boundaries. In reality, linguistic features often overlap across domains (e.g., a news article about a stadium may be linguistically closer to sports than to a budget report).
To address these challenges, we propose a model that can discover underlying "latent domains" autonomously. This allows for improved classification performance even when test data comes from unseen sources or when training metadata is incomplete.
Methods: Stochastic Domain Adaptation (SDA)
The core of our approach is a multi-channel neural network consisting of $k$ independent CNN channels. A latent variable $z$ acts as a gate to determine which channels to activate for a given input $x$. We explore two primary variants:
- Discrete SDA (DSDA): $z$ is an integer, forcing the model to select a single specific channel, similar to a mixture-of-experts approach.
- Continuous SDA (CSDA): $z$ is a continuous vector, allowing the model to treat input as a mixture of domains by combining outputs from multiple channels.
For CSDA, we employ Variational Inference to treat the domain as a latent variable in a VAE-style setup. We use implicit reparameterization gradients to handle Beta and Dirichlet distributions, which are not amenable to standard reparameterization tricks. The Dirichlet distribution is particularly effective as it encourages sparsity, forcing the model to focus on a few highly relevant channels.
Experimental Results
We evaluated the models on multi-domain sentiment analysis (Amazon reviews) and language identification across 97 languages.
Quantitative Performance
In sentiment analysis, the CSDA model with a Dirichlet prior achieved an average accuracy of 84.4%, significantly outperforming the single-channel CNN baseline (81.6%) and strong adversarial domain adaptation baselines (82.8%). In language identification, CSDA set new state-of-the-art results, reaching 93.2% accuracy on the TBE dataset compared to 79.3% for a standard CNN.
Latent Space Visualization
Qualitative analysis via t-SNE plots confirms that the model naturally clusters similar domains together in the latent space, even without explicit supervision. For instance, "Music" and "Video" domains are positioned closely, suggesting the model successfully captures inherent linguistic similarities.
Conclusion
Stochastic Domain Adaptation, particularly the continuous variant, provides a robust framework for learning from messy, multi-domain data. By modeling documents as mixtures of latent influences rather than members of rigid categories, the system handles out-of-domain data more gracefully. Future work will explore more complex channel architectures, such as Transformers, and apply this latent domain approach to tasks like machine translation and summarization.
Summary updated