# Robust Simulation-Based Inference in Cosmology with Bayesian Neural Networks

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

## Key facts

- Cited by 11 papers in the map (data through 14 Oct 2026).
- Builds on 15 of its 58 references that are in the map.
- First posted on arXiv 18 Jul 2022.

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

- [Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning](https://mlsanity.com/paper/1506.02142/) (2015)
- [Masked Autoregressive Flow for Density Estimation](https://mlsanity.com/paper/1705.07057/) (2017)
- [A Simple Baseline for Bayesian Uncertainty in Deep Learning](https://mlsanity.com/paper/1902.02476/) (2019)
- [The frontier of simulation-based inference](https://mlsanity.com/paper/1911.01429/) (2019)
- [Bayesian Deep Learning and a Probabilistic Perspective of Generalization](https://mlsanity.com/paper/2002.08791/) (2020)
- [MADE: Masked Autoencoder for Distribution Estimation](https://mlsanity.com/paper/1502.03509/) (2015)
- [Stochastic Gradient Descent as Approximate Bayesian Inference](https://mlsanity.com/paper/1704.04289/) (2017)
- [Probabilistic Backpropagation for Scalable Learning of Bayesian Neural Networks](https://mlsanity.com/paper/1502.05336/) (2015)
- [Flexible statistical inference for mechanistic models of neural dynamics](https://mlsanity.com/paper/1711.01861/) (2017)
- [Likelihood-free inference by ratio estimation](https://mlsanity.com/paper/1611.10242/) (2016)
- [Lossy Image Compression with Normalizing Flows](https://mlsanity.com/paper/2008.10486/) (2020)
- [A Bayesian neural network predicts the dissolution of compact planetary systems](https://mlsanity.com/paper/2101.04117/) (2021)
- [Fast and Credible Likelihood-Free Cosmology with Truncated Marginal Neural Ratio Estimation](https://mlsanity.com/paper/2111.08030/) (2021)
- [Massive data compression for parameter-dependent covariance matrices](https://mlsanity.com/paper/1707.06529/) (2017)
- [Split personalities in Bayesian Neural Networks: the case for full marginalisation](https://mlsanity.com/paper/2205.11151/) (2022)

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

- [L-C2ST: Local Diagnostics for Posterior Approximations in Simulation-Based Inference](https://mlsanity.com/paper/2306.03580/) (2023)
- [Adversarial robustness of amortized Bayesian inference](https://mlsanity.com/paper/2305.14984/) (2023)
- [Effortless, Simulation-Efficient Bayesian Inference using Tabular Foundation Models](https://mlsanity.com/paper/2504.17660/) (2025)
- [Jensen-Shannon Divergence Based Novel Loss Functions for Bayesian Neural Networks](https://mlsanity.com/paper/2209.11366/) (2022)
- [A Comprehensive Guide to Simulation-based Inference in Computational Biology](https://mlsanity.com/paper/2409.19675/) (2024)
- [Fast and robust Bayesian Inference using Gaussian Processes with GPry](https://mlsanity.com/paper/2211.02045/) (2022)
- [Low-Budget Simulation-Based Inference with Bayesian Neural Networks](https://mlsanity.com/paper/2408.15136/) (2024)
- [How many simulations do we need for simulation-based inference in cosmology?](https://mlsanity.com/paper/2503.13755/) (2025)
- [Parallelized Acquisition for Active Learning using Monte Carlo Sampling](https://mlsanity.com/paper/2305.19267/) (2023)
- [Isolated pulsar population synthesis with simulation-based inference](https://mlsanity.com/paper/2312.14848/) (2023)
- [Misspecification-robust amortised simulation-based inference using variational methods](https://mlsanity.com/paper/2509.05724/) (2025)

## Abstract (arXiv)

Simulation-based inference (SBI) is rapidly establishing itself as a standard machine learning technique for analyzing data in cosmological surveys. Despite continual improvements to the quality of density estimation by learned models, applications of such techniques to real data are entirely reliant on the generalization power of neural networks far outside the training distribution, which is mostly unconstrained. Due to the imperfections in scientist-created simulations, and the large computational expense of generating all possible parameter combinations, SBI methods in cosmology are vulnerable to such generalization issues. Here, we discuss the effects of both issues, and show how using a Bayesian neural network framework for training SBI can mitigate biases, and result in more reliable inference outside the training set. We introduce cosmoSWAG, the first application of Stochastic Weight Averaging to cosmology, and apply it to SBI trained for inference on the cosmic microwave background.
