A comparison of Bayesian sampling algorithms for high-dimensional particle physics and cosmology applications

Joshua G. Albert, Csaba Balázs, Andrew Fowlie, Will Handley, N. T. Hunt-Smith, Roberto Ruiz de Austri, M. J. WhiteComput. Phys. Commun 2024

In the world of high-dimensional physics—from hunting for Supersymmetry at the LHC to mapping the Cosmic Microwave Background—everything comes down to "global fits." We have a model, we have data, and we need to find the probability distribution of the model's parameters. This is Bayesian inference, and for years, the community has been split between two camps: Markov Chain Monte Carlo (MCMC) and Nested Sampling (NS).

A new paper by the DarkMachines High Dimensional Sampling Group puts these algorithms to the test, and the results might make you rethink your default choice of sampler.

TL;DR

This paper provides a rigorous benchmark of modern Bayesian sampling algorithms across "pathological" test functions and real-world physics problems. The headline: modern MCMC algorithms (like parallel tempering and diffusion-based proposals) can often outperform Nested Sampling on complex, multimodal problems previously thought to be the exclusive domain of NS.

What Problem Does This Paper Address?

As physics models become more complex, their "posteriors" (the probability maps of their parameters) become nightmares to sample. They might have dozens of dimensions, multiple isolated peaks (multimodality), or "banana-shaped" degeneracies where parameters are tightly correlated.

The "lore" in the field is that MCMC is great for simple, single-peaked problems, while Nested Sampling is the heavy-duty tool required for multimodal landscapes and calculating "evidence" for model comparison. However, Nested Sampling is computationally expensive. The authors wanted to see if modern advancements in MCMC have closed the gap and which specific implementations of NS actually live up to the hype.

Methods

The researchers compared two broad classes of algorithms:

  1. MCMC Samplers: Including the classic emcee, the parallel-tempered ptemcee, the slice-sampling zeus, and a newer MCMC-diffusion algorithm that uses diffusion models to propose moves.
  2. Nested Samplers: A "who's who" of the field, including MultiNest, PolyChord, Dynesty, UltraNest, Nessai, JaxNS, and Nautilus.

To keep the comparison fair for the "typical user," they stuck mostly to default hyperparameters and limited run times. They measured Efficiency (effective samples produced per likelihood evaluation) and used the Wasserstein distance to check if the sampler actually converged to the true distribution.

Datasets

The study evaluated these tools on two fronts:

  • Analytic Test Functions: 10-dimensional versions of the "Eggbox" (highly multimodal), "Rosenbrock" (curving degeneracy), "Rastrigin" (many local minima), and "Spike-Slab" (representing sparse signals).
  • Physics Likelihoods:
    • $\Lambda$CDM (Cosmology): A 6D fit using Planck CMB data. To speed up the millions of evaluations needed for benchmarking, they trained a deep neural network to emulate the likelihood.
  • MSSM7 (Particle Physics): A 12D fit of the Minimal Supersymmetric Standard Model. This is a notoriously difficult, "disjointed" parameter space. Again, they used a neural network interpolator based on data from the GAMBIT collaboration.

Key Insights and Ideas

  • MCMC's Multimodal Comeback: The most surprising finding was that ptemcee and MCMC-diffusion handled the highly multimodal Eggbox and Rastrigin functions better than many Nested Samplers. In the Eggbox test, MCMC-diffusion was significantly more efficient than the best-performing NS tool.
  • Implementation Matters More than Class: There is no "best" algorithm. PolyChord was the only NS tool to truly crack the Spike-Slab problem, while Nautilus was the efficiency king for the complex MSSM7 physics case.
  • The "Gold Standard" is Nuanced: While Nested Sampling is designed to handle multimodality, "region-based" samplers (like MultiNest) can struggle as dimensionality increases (the "curse of dimensionality"), whereas "path-based" samplers (like PolyChord) scale better but are slower in low dimensions.

Key Results

  • Efficiency: For the 10D Eggbox, MCMC-diffusion achieved an efficiency of 0.111, while the best NS tool (Dynesty) trailed far behind at $7.59 \times 10^{-5}$.
  • Cosmology: For the standard 6D $\Lambda$CDM model, almost everything worked. However, MultiNest was the most efficient, reaching a satisfactory answer with only ~8,200 likelihood evaluations.
  • Particle Physics: In the 12D MSSM7 fit, Nautilus (NS) was the overall winner in efficiency (0.0559), but ptemcee (MCMC) was a very close second (0.0495), proving that MCMC is viable even for "broken" likelihood surfaces.

Limitations and Future Work

The authors acknowledge that using neural network emulators for likelihoods is a double-edged sword. While it allows for massive benchmarking, NNs tend to smooth out "glitches" or extremely sharp features that might exist in raw physics code, which could make the sampling task slightly easier than in the "wild."

Future work could explore even higher dimensions (>20D), where the efficiency of region-based nested samplers is expected to collapse entirely. The authors also suggest that the next frontier is better automated hyperparameter tuning, so users don't have to be experts to get these high-performance results.

Reference: Albert, J., et al. (2024). A comparison of Bayesian sampling algorithms for high-dimensional particle physics and cosmology applications. arXiv:2409.18464v2 [hep-ph].

Summary updated

Abstract

For several decades now, Bayesian inference techniques have been applied to theories of particle physics, cosmology and astrophysics to obtain the probability density functions of their free parameters. In this study, we review and compare a wide range of Markov Chain Monte Carlo (MCMC) and nested sampling techniques to determine their relative efficacy on functions that resemble those encountered most frequently in the particle astrophysics literature. Our first series of tests explores a series of high-dimensional analytic test functions that exemplify particular challenges, for example highly multimodal posteriors or posteriors with curving degeneracies. We then investigate two real physics examples, the first being a global fit of the $Λ$CDM model using cosmic microwave background data from the Planck experiment, and the second being a global fit of the Minimal Supersymmetric Standard Model using a wide variety of collider and astrophysics data. We show that several examples widely thought to be most easily solved using nested sampling approaches can in fact be more efficiently solved using modern MCMC algorithms, but the details of the implementation matter. Furthermore, we also provide a series of useful insights for practitioners of particle astrophysics and cosmology.
BibTeX
@article{albert2024comparison,
  author = {Joshua G. Albert and Csaba Balázs and Andrew Fowlie and Will Handley and N. T. Hunt-Smith and Roberto Ruiz de Austri and M. J. White},
  title = {{A comparison of Bayesian sampling algorithms for high-dimensional particle physics and cosmology applications}},
  journal = {Comput. Phys. Commun.},
  year = {2024},
}
Figure