Bayesian Nonparametric Mixture of Experts · Merge-Truncate-Merge
The Bayesian companion to the dendrogram demo above. A Gaussian-gated mixture of experts (GLLiM) is fit by variational Bayes with a Dirichlet-process prior at a large truncation, so it deliberately over-fits the mixing measure; the Merge-Truncate-Merge (MTM) post-processing collapses the redundant atoms, and repeating its randomization gives a full posterior over the number of experts. Drag the merge radius (the Bayesian analogue of cutting the dendrogram) and watch the posterior concentrate on the true count with calibrated uncertainty.
Each expert is a local linear map with a Gaussian gate on the input, the GLLiM parameterization of a mixture of experts for inverse problems; the π-shape scatter is K0 overlapping linear branches. The model is fit by variational Bayes with a Dirichlet-process stick-breaking prior at a deliberately large truncation, so the mixing measure is over-fitted into many redundant atoms (a known effect: with N observations the variational posterior cannot prune non-empty components on its own, which is exactly what motivates a post-hoc merge). Merge-Truncate-Merge then operates on the joint-Gaussian atoms (μ, V) of the mixing measure: merge atoms within the radius ω, truncate the negligible-weight atoms, then merge again. Because the merge order is randomized, repeating MTM over resampled fits yields a posterior over the number of experts (right), whose mode is the estimate K̂ and whose spread is the uncertainty. The radius is anchored to the paper's contraction rate ωN ∼ √(log log N / log N) and defaults to the value that recovers K0; drag it (the Bayesian analogue of the dendrogram cut above) and the posterior shifts, raise N and it concentrates, switch to a Pitman-Yor prior for a heavier tail of small components. (An illustrative in-browser version: the engine is a 1-D DP-GLLiM with point-mass expert parameters and MTM per the paper's Algorithm 1; the published method adds full hierarchical priors and handles high-dimensional inverse problems. Values are illustrative.)
Run the experiments
Every animation runs live in your browser. Click a button to play that experiment on the demo (it scrolls up and starts); drag any control to take over. Nothing is downloaded, it is generated on the fly.
Merge-Truncate-Merge (the merging)
Sweep the merge radius ω: redundant atoms merge and the posterior number of experts falls, the Bayesian analogue of the dendrogram cut.
True number of experts K₀
Change the data-generating number of experts and watch the posterior over the count track it.
Sample size N
More data sharpens the posterior over the number of experts.
Truncation level K
Raise the truncation; the variational fit over-segments, which is exactly why MTM is needed.
How the EM algorithm evolves
Play the variational EM iterations on the panel below: the experts start broad and diffuse, then the Dirichlet-process prior concentrates the ones that carry data and shrinks the redundant weights.
Merge-Truncate-Merge trajectory
Play the merge: the effective number of experts K falls one at a time from the over-fitted count down to 1, the gold panel stepping through the trajectory grid.
How the EM algorithm evolves
Watch the variational EM converge. The atoms start as broad, diffuse experts; over the iterations the Dirichlet-process prior concentrates the ones that carry data and shrinks the redundant weights (thin outlines), the over-fitting you then prune with Merge-Truncate-Merge. Press Run the EM evolution below to replay iterations 0 to 60.
Merge-Truncate-Merge trajectory
The Bayesian analogue of cutting the dendrogram. Starting from the over-fitted variational atoms (the many faint experts the DP/PY prior keeps), the two closest atoms of the mixing measure merge at each step, so the effective number of experts K falls one at a time down to 1. Each panel is one merge level, with the induced clustering and its regression mean; the panel at the current posterior mode K̂ is outlined in gold. Drag the merge radius ω above (or run its sweep) and watch the gold panel move as the posterior mode shifts.
The idea in three steps
The same over-fit-then-merge principle as the dendrogram demo, but Bayesian: the prior over-fits on purpose, and the merge is a randomized procedure whose repetitions quantify how sure we are of the component count.
A nonparametric prior with too many experts
Fit the Gaussian-gated mixture of experts by variational Bayes under a Dirichlet-process prior at a large truncation. The mixing measure ends up with many redundant, near-duplicate atoms spread along each branch.
Collapse the mixing measure
On the joint-Gaussian atoms (μ, V): merge atoms within the radius ω, truncate the negligible-weight ones, then merge again. One consistent estimator of the component count, with no model sweep.
A posterior, not a point
Randomizing the merge over resampled fits turns the estimate into a posterior over the number of experts, with a credible interval, the Bayesian uncertainty a single dendrogram cut cannot give.
Where the dendrogram demo builds a full agglomerative hierarchy and reads K̂ off a cut, the Bayesian MTM makes a single randomized merge pass whose repetitions become the uncertainty. Both act on the same mixing-measure atoms with the same joint-Gaussian distance, so they are directly comparable. For the model, the consistency theory (MTM recovers K0 as N grows) and the high-dimensional inverse-problem experiments, see Bayesian Nonparametric Mixture of Experts for Inverse Problems (Nguyen, Forbes, Arbel & Nguyen, J. Nonparametric Statistics 2024) and the published article.