# Learned harmonic mean estimation of the Bayesian evidence with normalizing flows

arXiv: https://arxiv.org/abs/2405.05969 · HTML: https://mlsanity.com/paper/2405.05969/

## Key facts

- Cited by 7 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 9 May 2024.

## Built on by (most cited first, 7 of 7)

- [Open Source Planning & Control System with Language Agents for Autonomous Scientific Discovery](https://mlsanity.com/paper/2507.07257/) (2025)
- [The future of cosmological likelihood-based inference: accelerated high-dimensional parameter estimation and model comparison](https://mlsanity.com/paper/2405.12965/) (2024)
- [mathttemuflow: Normalising Flows for Joint Cosmological Analysis](https://mlsanity.com/paper/2409.01407/) (2024)
- [FlowVAT: Normalizing Flow Variational Inference with Affine-Invariant Tempering](https://mlsanity.com/paper/2505.10466/) (2025)
- [Accelerated Bayesian parameter estimation and model selection for gravitational waves with normalizing flows](https://mlsanity.com/paper/2410.21076/) (2024)
- [A comparison of Bayesian sampling algorithms for high-dimensional particle physics and cosmology applications](https://mlsanity.com/paper/2409.18464/) (2024)
- [Learned harmonic mean estimation of the marginal likelihood for multimodal posteriors with flow matching](https://mlsanity.com/paper/2601.18683/) (2026)

## Abstract (arXiv)

We present the learned harmonic mean estimator with normalizing flows - a robust, scalable and flexible estimator of the Bayesian evidence for model comparison. Since the estimator is agnostic to sampling strategy and simply requires posterior samples, it can be applied to compute the evidence using any Markov chain Monte Carlo (MCMC) sampling technique, including saved down MCMC chains, or any variational inference approach. The learned harmonic mean estimator was recently introduced, where machine learning techniques were developed to learn a suitable internal importance sampling target distribution to solve the issue of exploding variance of the original harmonic mean estimator. In this article we present the use of normalizing flows as the internal machine learning technique within the learned harmonic mean estimator. Normalizing flows can be elegantly coupled with the learned harmonic mean to provide an approach that is more robust, flexible and scalable than the machine learning models considered previously. We perform a series of numerical experiments, applying our method to benchmark problems and to a cosmological example in up to 21 dimensions. We find the learned harmonic mean estimator is in agreement with ground truth values and nested sampling estimates. The open-source harmonic Python package implementing the learned harmonic mean, now with normalizing flows included, is publicly available.
