Fitting large mixture models using stochastic component selection

Milan Papez, Tomáš Pevný, Vaclav Smidl

TL;DR

Traditional algorithms for training finite mixture models must evaluate every single mixture component at each step—a crippling bottleneck when models scale to millions of components. This paper introduces generalized MHSAEM, an algorithm that couples Stochastic Approximation Expectation-Maximization with a Metropolis-Hastings sampler to evaluate only a tiny subset ($M \ll K$) of components per iteration. The resulting approach trains both shallow and deep mixture models up to $100\times$ faster while frequently finding better local optima than standard baselines.

What Problem Does This Paper Address?

Finite mixture models represent complex probability densities by weighting a set of simpler base distributions (components). However, learning their parameters via standard Expectation-Maximization (EM) or Stochastic Gradient Descent (SGD) requires computing the likelihood across all $K$ components for each data point:

$$\mathcal{O}(T \cdot D \cdot N \cdot K)$$

where $T$ is iterations, $D$ is data dimension, and $N$ is dataset size.

While existing methods shrink $N$ (via minibatches or coresets) or $D$ (via sketching and random projections), the reliance on computing all $K$ components persists. This cost becomes prohibitive in deep latent-variable models—such as Sum-Product Networks (SPNs), where components grow exponentially with tree depth (often exceeding hundreds of millions), and mixtures of deep normalizing flows. Prior "sparse" or "truncated" approximations either require evaluating all likelihoods before pruning or rely on restrictive exponential-family assumptions with closed-form solutions.

Methods

The authors propose the generalized Metropolis-Hastings Stochastic Approximation EM (MHSAEM) algorithm:

  1. Minibatching in the E-step: The conditional expectation is evaluated on a random minibatch $B \ll N$ rather than the full dataset.
  2. Metropolis-Hastings (MH) Component Selection: To sample latent assignments $z_i \sim p_\theta(z_i \mid x_i)$ without computing the expensive normalization constant $\sum_{k=1}^K p_\theta(x_i, z_i = k)$, the method simulates a Markov chain using the Metropolis-Hastings rule. It proposes a component $z_i \sim q(\cdot \mid \bar{z}_i)$ and accepts/rejects it based on unnormalized joint likelihoods. Running this for only $M \ll K$ steps (often $M=1$ or $2$) evaluates only the proposed components. Chains persist across iterations, eliminating repeated burn-in.
  3. Stochastic Approximation M-step: Rather than solving for exact M-step parameters (often impossible with deep non-linear components), parameter updates are performed via Robbins-Monro stochastic gradient descent: $$\theta_t = \theta_{t-1} + \gamma_t \nabla_\theta \hat{Q}_{t-1}(\theta)$$ Gradients are computed strictly for the active components visited in the MH trajectory ($k \in \text{unique}(z_{i,t})$), and mixing proportions are updated using a softmax parameterization.

  4. Proposal Distributions: The paper evaluates multiple proposal strategies, including a Uniform proposal ($U$), a Tabular proposal with forgetting ($TF$, tracking categorical frequencies recursively), and a theoretical Optimal proposal ($O$).

                    ┌──────────────────────────────┐
                    │    Minibatch B << N Data     │
                    └──────────────┬───────────────┘
                                   │
                                   ▼
                    ┌──────────────────────────────┐
                    │   Metropolis-Hastings Step   │
                    │   Sample M << K components   │
                    │   (Skips full normalizer)    │
                    └──────────────┬───────────────┘
                                   │
                                   ▼
                    ┌──────────────────────────────┐
                    │ Stochastic Gradient M-Step   │
                    │  Update visited params only  │
                    └──────────────────────────────┘

Datasets

  • Synthetic Gaussian Mixtures: Synthesized across varying dimensions and component counts using a misclassification overlap parameter $\omega \in (0, 1)$ to test convergence under controlled overlap.
  • UCI Machine Learning Repository: 19 real-world benchmarks, including breast-cancer-wisconsin, cardiotocography, magic-telescope, pendigits, pima-indians, waveform, yeast, sonar, and wine.

Key Insights and Ideas

  • MCMC completely bypasses the partition function: Standard posterior inference in mixture models requires normalizing over all $K$ terms. Framing latent component selection as a continuous MCMC chain over training iterations reduces the marginal likelihood cost from $\mathcal{O}(K)$ to $\mathcal{O}(1)$ per sample.
  • Stochasticity as an escape mechanism: In highly non-convex architectures, standard EM and SGD easily get trapped in poor local modes. The stochasticity injected by drawing small MH subsets helped the optimizer jump across low-density regions, producing superior log-likelihoods.
  • A uniform proposal is surprisingly effective: Even a naive uniform proposal distribution ($q(z \mid \bar{z}) = \text{Uniform}(1, K)$) provided massive speedups and competitive likelihoods without maintaining large transition probability tables.

Key Results

  • Gaussian Mixture Models (GMMs): On synthetic benchmarks, MHSAEM converged significantly faster and arrived at a smaller absolute error ($|L(\theta_{t95}) - L(\theta)|$) relative to the true generative model than standard EM, SAEM, and existing truncated/sparse baselines (SSAEM, TSAEM).
  • Sum-Product Transform Networks (SPTNs): Compared to SGD running on architectures with up to 268 million effective components:
  • Achieved computational speedups on 17 out of 19 datasets, reaching $102.5\times$ on magic-telescope and $75.4\times$ on wine.
  • Achieved higher test log-likelihood than SGD on 10 of 19 datasets (average competition rank: 1.44 vs. 1.56).
  • Mixtures of Real NVP Normalizing Flows:
  • Achieved speedups on 18 of 19 datasets (e.g., $44.95\times$ on page-blocks, $38.49\times$ on statlog-segment).
  • Outperformed SGD in test log-likelihood on 16 of 19 datasets (average rank: 1.17 vs. 1.83).

Limitations and Future Work

  • Mixing Rates at Extreme Scales: Experiments largely relied on the uniform proposal ($U$). While computationally cheap, uniform proposals exhibit poor mixing when $K$ is exceptionally large, potentially slowing asymptotic convergence.
  • Overhead on Tiny Datasets: On very small datasets with low dimensions (such as iris and pima-indians), standard SGD was faster due to lower framework overhead.
  • Future Directions: The authors plan to investigate smarter, adaptive proposal distributions that boost MCMC mixing without incurring heavy memory or computation penalties.

Summary updated

BibTeX
@inproceedings{papez2021fitting,
  author = {Milan Papez and Tomáš Pevný and Vaclav Smidl},
  title = {{Fitting large mixture models using stochastic component selection}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=ki4eJ1fSJNq},
}
Figure