Introduction
Machine learning practitioners often face a trade-off between generative models (e.g., Naive Bayes) and discriminative models (e.g., SVMs). Generative models are versatile, modeling the joint probability $p(y, x)$, which allows them to handle missing features or latent variables gracefully. However, they are typically trained via Maximum Likelihood Estimation (MLE), which prioritizes data explanation over label prediction. Conversely, discriminative models optimize directly for classification accuracy but often struggle with incomplete data or latent structures.
Training generative models discriminatively has historically been difficult due to complex normalization constraints—ensuring that updated parameters still represent valid probability distributions. Stochastic Discriminative EM (sdEM) addresses this by providing a simple, iterative, and scalable method for discriminative training of exponential family generative models.
The sdEM Algorithm
The core of sdEM is an extension of Sato’s online EM algorithm, interpreted as a stochastic natural gradient descent. Natural gradients account for the information geometry of the statistical model, moving along the Riemannian manifold of parameters rather than in standard Euclidean space. For exponential family models, a key mathematical insight is that the natural gradient with respect to expectation parameters (like mean counts) is equivalent to the standard gradient with respect to natural parameters. This makes the geometrically complex update computationally "free."
The algorithm supports various discriminative losses, including Negative Conditional Log-Likelihood (NCLL) and Hinge loss. In the case of latent variable models like Latent Dirichlet Allocation (LDA), sdEM can utilize techniques like collapsed Gibbs sampling to estimate the required sufficient statistics for the E-step.
Experimental Evaluation
The algorithm was tested on a range of benchmarks, from toy Gaussian Naive Bayes problems to large-scale text classification tasks like 20NewsGroup, Cade, and Reuters-R52. A key finding is that generative models are not inherently inferior at classification; their performance is often limited by the training objective rather than the model structure. When trained with sdEM, simple models like Multinomial Naive Bayes (MNB) can rival highly optimized SVMs and Logistic Regression implementations from toolkits like Liblinear.
In toy examples where models were intentionally misspecified (the true data distribution did not match model assumptions), sdEM improved accuracy from 78.6% (MLE) to over 90%. On text datasets, sdEM-trained MNB performed competitively with state-of-the-art discriminative toolkits. Furthermore, for LDA, sdEM-trained classifiers outperformed supervised-LDA (sLDA) while remaining significantly easier to implement and debug.
Key Insights and Limitations
One significant advantage of sdEM is the use of conjugate priors, which act as "log-barriers" during optimization. These priors naturally regularize the model and help pull parameters back into valid regions if a stochastic update jumps too far. Hinge loss training proved particularly efficient, as the algorithm skips updates for data points that are already correctly classified with a sufficient margin.
However, challenges remain. The "Check-Step" used to ensure parameter validity (e.g., ensuring word counts don't go negative) is currently somewhat ad-hoc. Additionally, the algorithm's performance can be sensitive to hyperparameters like the learning rate ($\lambda$) and the prior ($\alpha$). While the current focus is on classification, the framework's potential for regression remains an area for future validation.
Conclusion
Stochastic Discriminative EM offers a compelling "best of both worlds" approach, providing the interpretability and probabilistic rigor of generative models alongside the raw predictive power of discriminative learning. It represents a significant step toward scalable, flexible, and accurate machine learning systems that can handle complex, real-world data structures.
Summary updated