Latent Variable Models (LVMs), such as Latent Dirichlet Allocation (LDA) and mixture models, are powerful tools for uncovering hidden structures in high-dimensional data. However, when these models are applied to supervised tasks—such as predicting sentiment from text or clinical outcomes from electronic health records—standard training approaches often struggle to balance generative modeling with predictive performance. This paper, presented at AISTATS 2018, introduces a prediction-constrained (PC) objective designed to address these challenges, particularly in semi-supervised settings.
The Challenges of Supervised LVMs
The authors identify two primary obstacles that hinder standard supervised LVM training:
- Cardinality Mismatch: In many real-world datasets, the dimensionality of the observed data (e.g., thousands of words in a document) far exceeds the dimensionality of the labels (e.g., a single binary sentiment). In standard joint likelihood training, the data "drowns out" the labels, leading the model to ignore predictive features in favor of general data reconstruction.
- Symmetry vs. Asymmetry: Standard supervised LVMs typically model the joint distribution of data and labels symmetrically. However, prediction is inherently asymmetric: we aim to predict labels from the data. Models trained symmetrically often learn representations that rely on the presence of labels during training, which then fail to generalize at test time when labels are absent.
The Prediction-Constrained (PC) Objective
To overcome these issues, the authors propose the prediction-constrained objective. Instead of maximizing the joint likelihood, the PC approach maximizes the marginal likelihood of the data subject to a constraint on the model's predictive accuracy. In its unconstrained Lagrangian form, the objective is expressed as:
$$\min_{\xi} \underbrace{-\sum \log p(x_d | \xi)}_{\text{Generative Loss}} - \lambda \underbrace{\sum \log p(y_d | x_d, \xi)}_{\text{Predictive Loss}}$$
This formulation allows practitioners to tune the hyperparameter $\lambda$ to balance generative fidelity with predictive power. Crucially, the predictive term $p(y|x)$ marginalizes out the hidden variables, ensuring the model learns a mapping from data to latent space that is useful for prediction even when labels are missing.
The PC framework is applicable to a wide range of "downstream" LVMs where both data and labels are generated conditioned on a hidden variable, as illustrated in the graphical models above. Training is performed end-to-end using stochastic gradient descent (SGD) with automatic differentiation.
Experimental Evaluation
The authors evaluated the PC objective across several diverse benchmarks:
- Synthetic Tasks: Toy Gaussian mixtures and an image-based "vowels-from-consonants" task demonstrated that PC training successfully avoids the "label replication" trap—a common but suboptimal heuristic used to fix cardinality mismatch. PC training successfully separates overlapping data clusters when prediction is prioritized, whereas standard joint training often fails to improve prediction even with high label weights.
- Text Analysis: On Movie Review sentiment analysis and Yelp restaurant attribute classification, PC-LDA achieved predictive accuracy competitive with high-dimensional logistic regression while maintaining the interpretability of the learned topics.
- Clinical EHR: In a large-scale task predicting antidepressant success for over 64,000 patients, PC-LDA identified clinically coherent topics (e.g., related to migraines or specific physiological functions) that served as strong predictors for drug response.
Key Insights
- Interpretability is Not a Tax: The PC objective demonstrates that one does not need to sacrifice model interpretability for predictive power. By adjusting $\lambda$, the model can find a "sweet spot" that yields both high accuracy and sparse, coherent latent representations.
- Semi-Supervised Strength: The method is particularly effective when only a small portion of the data is labeled. It leverages unlabeled data to build a robust generative model while using the labeled data to "steer" the latent space toward features relevant to the target outcome.
Conclusion and Future Work
While the PC objective offers significant advantages in accuracy and interpretability, it introduces computational challenges. Differentiating through the inference process (such as MAP embedding in topic models) can be a bottleneck. Future work may explore amortized inference techniques, like Variational Auto-Encoders, to improve scalability. Additionally, the non-convex nature of the objective requires careful initialization and hyperparameter tuning to avoid local optima.
Summary updated