Diffusion-HMC: Parameter Inference with Diffusion Model driven Hamiltonian Monte Carlo

Nayantara Mudur, Carolina Cuesta-Lázaro, Douglas P. FinkbeinerarXiv 2024 · DOI

Abstract

Traditional cosmological inference often relies on summary statistics like the power spectrum, which fail to capture the rich non-linear information present in small-scale cosmic structures. We present Diffusion-HMC, a method that leverages conditional diffusion models to perform field-level inference. By treating the diffusion model's variational lower bound as a differentiable likelihood, we employ Hamiltonian Monte Carlo (HMC) to recover fundamental cosmological parameters. Our results demonstrate that Diffusion-HMC provides tighter constraints than standard methods and exhibits superior robustness to observational noise.

Introduction

A central goal in cosmology is to determine the fundamental parameters governing the universe's evolution, such as the matter density ($\Omega_m$) and the amplitude of fluctuations ($\sigma_8$). While the power spectrum effectively describes large-scale linear physics, the "cosmic web" of dark matter at smaller scales contains significant non-linear information that is typically lost in simplified statistical summaries.

Extracting this information requires two components: a fast, high-fidelity emulator capable of generating realistic matter distributions, and a robust inference engine. While N-body simulations provide the necessary detail, their computational cost is prohibitive for iterative inference. Diffusion-HMC addresses both needs using a single generative framework.

Methodology: The Diffusion-HMC Framework

The core of this approach is a Conditional Denoising Diffusion Probabilistic Model (DDPM) trained on 2D cold dark matter (CDM) density fields. Unlike standard generative models, this architecture is conditioned on cosmological parameters, learning to map specific values of $\Omega_m$ and $\sigma_8$ to their corresponding spatial structures.

Visualizing the cosmic web: The diffusion model generates distinct dark matter density fields conditioned on different values of $\Omega_m$ and $\sigma_8$.

From Generation to Inference

The innovation of Diffusion-HMC lies in repurposing the generative model for inference. The training objective of a diffusion model involves optimizing a Variational Lower Bound (VLB) of the log-likelihood. The authors utilize this VLB as a proxy for the likelihood of an observed field given a set of parameters.

To navigate the parameter space efficiently, the team employs Hamiltonian Monte Carlo (HMC). HMC uses the gradients of the VLB—calculated via backpropagation through the diffusion model—to sample the posterior distribution. To optimize performance, they discovered that the first few timesteps of the diffusion process (where noise is lowest) contain the most cosmological information. By truncating the VLB sum to just the first 20 steps, they made inference significantly faster without losing precision.

Datasets and Training

The model was trained using the CAMELS Multifield Dataset (CMD), specifically the IllustrisTNG suite. The training set comprised 15,000 2D dark matter density maps at redshift $z=0$. Evaluation was performed across several specialized sets, including Latin Hypercube (LH) simulations for generalizability and Cosmic Variance (CV) sets to test the model's ability to capture statistical diversity.

Key Results and Performance

Diffusion-HMC demonstrates remarkable fidelity in reproducing both the power spectrum and the pixel-level density distributions of the training data.

Statistical fidelity: Comparison of the power spectrum $P(k)$ and density distribution $\log \delta$ between true simulations (black) and diffusion-generated fields (blue) across various cosmological parameters.

Precision and Robustness

  • Accuracy: The model achieved high precision, with a mean absolute bias of only 1.26% for $\sigma_8$.
  • Noise Robustness: A critical advantage of the diffusion approach is its inherent resilience to noise. When tested against unseen white noise, standard inference networks saw error rates spike from ~1% to 23%. In contrast, Diffusion-HMC remained stable, with errors contained around 10%.
  • Capturing Variance: Unlike many generative models, the diffusion model successfully captured the full "cosmic variance"—the natural statistical diversity of the universe for a fixed set of initial conditions.

Limitations and Future Outlook

While promising, several challenges remain for scaling Diffusion-HMC to real-world observations. The current study utilized small 25 Mpc/h simulation boxes; applying this to large-scale surveys will require significant architectural scaling. Furthermore, the model must eventually incorporate complex "baryonic physics"—the effects of gas, stars, and black holes—which introduce additional layers of non-linearity. Future work will also focus on calibrating uncertainty estimates, as current posterior widths tend to be slightly overconfident.

Conclusion

Diffusion-HMC represents a significant step toward "field-level" cosmological inference. By unifying generative modeling and Bayesian sampling, it provides a powerful tool for extracting the maximum possible information from our observations of the cosmic web.

Source: Mudur et al., "Diffusion-HMC: Parameter Inference with Diffusion-model-driven Hamiltonian Monte Carlo" (2024).

Summary updated

BibTeX
@misc{mudur2024diffusion,
  author = {Nayantara Mudur and Carolina Cuesta-Lázaro and Douglas P. Finkbeiner},
  title = {{Diffusion-HMC: Parameter Inference with Diffusion Model driven Hamiltonian Monte Carlo}},
  year = {2024},
  eprint = {2405.05255},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.05255},
}
Figure