# A Deep Learning Method for Comparing Bayesian Hierarchical Models

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

## Key facts

- Cited by 12 papers in the map (data through 14 Oct 2026).
- Builds on 21 of its 115 references that are in the map.
- First posted on arXiv 27 Jan 2023.

## Builds on (most cited first, 21 of 21)

- [Adam: A Method for Stochastic Optimization](https://mlsanity.com/paper/1412.6980/) (2014)
- [On Calibration of Modern Neural Networks](https://mlsanity.com/paper/1706.04599/) (2017)
- [Deep Sets](https://mlsanity.com/paper/1703.06114/) (2017)
- [The frontier of simulation-based inference](https://mlsanity.com/paper/1911.01429/) (2019)
- [Your Classifier is Secretly an Energy Based Model and You Should Treat it Like One](https://mlsanity.com/paper/1912.03263/) (2019)
- [BayesFlow: Learning complex stochastic models with invertible neural networks](https://mlsanity.com/paper/2003.06281/) (2020)
- [Inference Suboptimality in Variational Autoencoders](https://mlsanity.com/paper/1801.03558/) (2018)
- [Validating Bayesian Inference Algorithms with Simulation-Based Calibration](https://mlsanity.com/paper/1804.06788/) (2018)
- [Rank-normalization, folding, and localization: An improved widehatR for assessing convergence of MCMC](https://mlsanity.com/paper/1903.08008/) (2019)
- [Bayesian Model Selection, the Marginal Likelihood, and Generalization](https://mlsanity.com/paper/2202.11678/) (2022)
- [Bayesian Workflow](https://mlsanity.com/paper/2011.01808/) (2020)
- [Amortized Bayesian model comparison with evidential deep learning](https://mlsanity.com/paper/2004.10629/) (2020)
- [OutbreakFlow: Model-based Bayesian inference of disease outbreak dynamics with invertible neural networks and its application to the COVID-19 pandemics in Germany](https://mlsanity.com/paper/2010.00300/) (2020)
- [Toward a principled Bayesian workflow in cognitive science](https://mlsanity.com/paper/1904.12765/) (2019)
- [Some models are useful, but how do we know which ones? Towards a unified Bayesian model taxonomy](https://mlsanity.com/paper/2209.02439/) (2022)
- [Towards constraining warm dark matter with stellar streams through neural simulation-based inference](https://mlsanity.com/paper/2011.14923/) (2020)
- [Component-wise approximate Bayesian computation via Gibbs-like steps](https://mlsanity.com/paper/1905.13599/) (2019)
- [Meta-Uncertainty in Bayesian Model Comparison](https://mlsanity.com/paper/2210.07278/) (2022)
- [Workflow Techniques for the Robust Use of Bayes Factors](https://mlsanity.com/paper/2103.08744/) (2021)
- [Likelihood-free Model Choice](https://mlsanity.com/paper/1503.07689/) (2015)
- [Limitations of "Limitations of Bayesian leave-one-out cross-validation for model selection"](https://mlsanity.com/paper/1810.05374/) (2018)

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

- [BayesFlow: Amortized Bayesian Workflows With Neural Networks](https://mlsanity.com/paper/2306.16015/) (2023)
- [Consistency Models for Scalable and Fast Simulation-Based Inference](https://mlsanity.com/paper/2312.05440/) (2023)
- [Sensitivity-Aware Amortized Bayesian Inference](https://mlsanity.com/paper/2310.11122/) (2023)
- [Amortized Bayesian Multilevel Models](https://mlsanity.com/paper/2408.13230/) (2024)
- [Does Unsupervised Domain Adaptation Improve the Robustness of Amortized Bayesian Inference? A Systematic Evaluation](https://mlsanity.com/paper/2502.04949/) (2025)
- [BayesFlow 2: Multi-Backend Amortized Bayesian Inference in Python](https://mlsanity.com/paper/2602.07098/) (2026)
- [Improving the Accuracy of Amortized Model Comparison with Self-Consistency](https://mlsanity.com/paper/2508.20614/) (2025)
- [Discriminative calibration: Check Bayesian computation from simulations and flexible classifier](https://mlsanity.com/paper/2305.14593/) (2023)
- [A COMPASS to Model Comparison and Simulation-Based Inference in Galactic Chemical Evolution](https://mlsanity.com/paper/2507.05060/) (2025)
- [Scalable Simulation-Based Model Inference with Test-Time Complexity Control](https://mlsanity.com/paper/2603.15292/) (2026)
- [Latent Variable Sequence Identification for Cognitive Models with Neural Network Estimators](https://mlsanity.com/paper/2406.14742/) (2024)
- [Joint Neural Posterior Estimation and Model Selection for Chemical Reaction Networks](https://mlsanity.com/paper/2610.18825/) (2026)

## Abstract (arXiv)

Bayesian model comparison (BMC) offers a principled approach for assessing the relative merits of competing computational models and propagating uncertainty into model selection decisions. However, BMC is often intractable for the popular class of hierarchical models due to their high-dimensional nested parameter structure. To address this intractability, we propose a deep learning method for performing BMC on any set of hierarchical models which can be instantiated as probabilistic programs. Since our method enables amortized inference, it allows efficient re-estimation of posterior model probabilities and fast performance validation prior to any real-data application. In a series of extensive validation studies, we benchmark the performance of our method against the state-of-the-art bridge sampling method and demonstrate excellent amortized inference across all BMC settings. We then showcase our method by comparing four hierarchical evidence accumulation models that have previously been deemed intractable for BMC due to partly implicit likelihoods. Additionally, we demonstrate how transfer learning can be leveraged to enhance training efficiency. We provide reproducible code for all analyses and an open-source implementation of our method.
