Skip to main content

Applied ML

Deep Generative Models for Cosmic Structures

GANs, normalizing flows, and diffusion models as fast surrogates for N-body simulations: halo catalogs, cosmological field generation, and simulation-based inference of cosmological parameters.

AdvancedTier 3Current~15 min
0

Why This Matters

Cosmological inference compares observed large-scale structure to predictions from N-body simulations. A single high-resolution simulation of a 11 Gpc box costs 10510^5 to 10610^6 CPU-hours. Bayesian parameter inference requires sampling the cosmological parameter space (Ωm\Omega_m, σ8\sigma_8, ww, hh, neutrino masses) at thousands of points. The simulation budget is the bottleneck for next-generation surveys (Rubin LSST, Euclid, DESI, SKA).

Deep generative models attack this from two directions. Emulators learn the mapping from cosmological parameters to summary statistics (matter power spectrum, halo mass function) at 10410^4 to 10610^6 times the speed of running the simulation. Field-level generative models go further: produce full 3D density fields or 2D weak-lensing maps statistically indistinguishable from simulation outputs. Both feed into simulation-based inference, where the likelihood is replaced by samples from a learned conditional distribution.

The science payoff is the ability to use all of the data, not just the two-point function. Higher-order statistics, peak counts, and field-level likelihoods carry information about non-Gaussian structure that the power spectrum throws away.

Core Ideas

GANs for halo catalogs and weak-lensing maps. Mustafa et al. (2019, Computational Astrophysics and Cosmology 6; arXiv 1706.02390) trained a DCGAN on weak-lensing convergence maps from N-body simulations. Generated maps matched the power spectrum, peak counts, and Minkowski functionals of training data within a few percent across angular scales of 11 to 2020 arcmin. Subsequent work extended to 3D density fields and conditional generation on cosmological parameters.

Normalizing flows for cosmological fields. CosmoFlow (Mathuriya et al. 2018, arXiv 1808.04728) used 3D CNN regression for parameter prediction; later work used flow-based models (Rouhiainen, Münchmeyer 2022, arXiv 2206.05014; Dai, Seljak 2022, PNAS 119) to learn tractable densities over field configurations. Flows give exact likelihoods, which is the property simulation-based inference wants.

Diffusion models as the new default. Score-based and diffusion models now match or beat GANs on cosmological field generation (Mudur, Finkbeiner 2022, arXiv 2211.12444; Park et al. 2023). Training is more stable, mode coverage is better, and conditional generation on (Ωm,σ8)(\Omega_m, \sigma_8) is straightforward. The cost is sampling speed, partially addressed by flow matching and consistency models.

Simulation-based inference (SBI). The Cranmer-Brehmer-Louppe review (2020, PNAS 117; arXiv 1911.01429) frames the broader program: when the simulator defines an implicit likelihood, train a conditional density estimator qϕ(θx)q_\phi(\theta \mid x) on simulator runs and use it as the posterior. Methods include neural posterior estimation (NPE), neural likelihood estimation (NLE), and neural ratio estimation (NRE). SimBIG (Hahn et al. 2023, arXiv 2211.00723) applied SBI to BOSS galaxy clustering and recovered σ8\sigma_8 with field-level information beyond the standard two-point analysis.

Common Confusions

Watch Out

A GAN that matches the power spectrum has not learned cosmology

Matching low-order summary statistics is necessary but not sufficient. A generator can reproduce the power spectrum while failing on peak counts, bispectrum, or filament topology. Validation must include statistics orthogonal to the training objective. The community standard is to check power spectrum, bispectrum, peak counts, and Minkowski functionals independently, plus parameter inference posteriors against ground truth.

Watch Out

SBI posteriors require coverage tests

A neural posterior estimator can be sharp and wrong. Standard practice now demands simulation-based calibration (SBC) or expected coverage probability diagnostics (Hermans et al. 2021) on a held-out set of simulator runs. A posterior that fails coverage is unsafe to publish regardless of how tight the credible intervals look.

References

Related Topics

Last reviewed: April 18, 2026

Prerequisites

Foundations this topic depends on.

Next Topics