Abstract
Dirichlet process (DP) mixture models provide a flexible Bayesian framework for density estimation. Unfortunately, their flexibility comes at a cost: inference in DP mixture models is computationally intensive. Standard approaches rely on Markov Chain Monte Carlo (MCMC) methods, which are often slow to converge. This paper demonstrates that if the goal is to find the Maximum A Posteriori (MAP) estimate, deterministic search algorithms like A* and beam search can outperform MCMC by orders of magnitude, scaling to datasets with tens of thousands of points.
Introduction
Dirichlet process (DP) mixture models are a cornerstone of nonparametric Bayesian statistics, allowing for clustering where the number of clusters $K$ is inferred directly from the data. Despite their power, the computational burden of posterior inference remains a significant barrier. Practitioners typically use Gibbs sampling or other MCMC variants, which are stochastic and often require many iterations to reach a stable state.
In many practical applications, such as computer vision or natural language processing, the full posterior distribution is not strictly necessary. Instead, a single high-quality clustering assignment—the MAP estimate—is sufficient. Finding the exact MAP is NP-hard; however, this work explores whether deterministic search techniques can provide high-quality approximations much faster than traditional sampling methods.
Methodology
We frame the MAP clustering problem as a sequential search. The algorithm processes data points $x_{1:N}$ one at a time, building partial clusterings. A "max-queue" $Q$ is maintained to store the most promising partial states, and a beam search strategy is employed to prune the search space when the queue size exceeds a predefined limit $b$.
The efficiency of this search depends heavily on the scoring function $g(c, x)$, which acts as a heuristic to estimate the potential of a partial clustering. We evaluate three specific heuristics:
- Trivial (Admissible): A loose heuristic that ignores unclustered points, guaranteeing the true MAP with an infinite beam but suffering from poor efficiency.
- Tighter (Admissible): Uses a mathematical "replica" trick to account for future assignments, providing a tighter bound at a higher computational cost per step.
- Inadmissible: A fast, tight heuristic that assumes all remaining points will form their own clusters. While it lacks global optimality guarantees, it is highly effective when data is pre-sorted by increasing marginal likelihood.
Experimental Evaluation
The proposed search methods were tested against standard Gibbs sampling and Split-Merge MCMC across three distinct datasets:
- Artificial Data: Gaussian/Gaussian DP mixtures used to evaluate scaling and accuracy on small-to-medium datasets ($N=4$ to $50$).
- MNIST: 60,000 handwritten digit images reduced to 50 dimensions via PCA, representing a large-scale continuous clustering task.
- NIPS Documents: 1,740 academic papers represented by word counts, testing the algorithm on discrete, high-dimensional data.
Results
On artificial data, the inadmissible search heuristic consistently achieved optimal or near-optimal F-scores and log-likelihoods. Crucially, it maintained this performance while running significantly faster than MCMC alternatives as the dataset size increased.
The scaling advantages became even more apparent on real-world datasets:
- MNIST: The search algorithm completed clustering in under 15 minutes. In contrast, Gibbs sampling required approximately 7 hours per iteration, making it impractical for large-scale use.
- NIPS Documents: The search method clustered the dataset in 21 seconds, whereas both Gibbs and Split-Merge MCMC took over an hour.
Discussion and Limitations
The results suggest that MCMC is often overkill when only a point estimate is required. Deterministic search, particularly with inadmissible heuristics, offers a viable and much faster alternative. Furthermore, the order of data presentation is critical for the inadmissible search; sorting by marginal likelihood helps isolate outliers early, preventing them from distorting larger clusters.
However, there are limitations. The search provides only a MAP estimate and does not capture posterior uncertainty. It also requires conjugate exponential family distributions to analytically integrate out parameters. Future work will focus on optimizing the cluster probability calculations, which currently represent the primary computational bottleneck. Despite these constraints, the speed of this approach makes it an excellent candidate for initializing MCMC chains or for use in time-sensitive production environments.
Summary updated