[Paper Review] CONNECT: A neural network based framework for emulating cosmological observables and cosmological parameter inference
CONNECT is a PyTorch-based neural network framework that emulates cosmological observables from the CLASS Boltzmann solver, enabling fast and accurate cosmological parameter inference. By using iteratively optimized Latin hypercube sampling to generate efficient training data, it reduces CLASS evaluations by two orders of magnitude and accelerates MCMC inference by orders of magnitude, with posterior differences of less than 0.1 standard deviations compared to full CLASS runs.
Bayesian parameter inference is an essential tool in modern cosmology, and typically requires the calculation of $10^5$--$10^6$ theoretical models for each inference of model parameters for a given dataset combination. Computing these models by solving the linearised Einstein-Boltzmann system usually takes tens of CPU core-seconds per model, making the entire process very computationally expensive. In this paper we present extsc{connect}, a neural network framework emulating extsc{class} computations as an easy-to-use plug-in for the popular sampler extsc{MontePython}. extsc{connect} uses an iteratively trained neural network which emulates the observables usually computed by extsc{class}. The training data is generated using extsc{class}, but using a novel algorithm for generating favourable points in parameter space for training data, the required number of extsc{class}-evaluations can be reduced by two orders of magnitude compared to a traditional inference run. Once extsc{connect} has been trained for a given model, no additional training is required for different dataset combinations, making extsc{connect} many orders of magnitude faster than extsc{class} (and making the inference process entirely dominated by the speed of the likelihood calculation). For the models investigated in this paper we find that cosmological parameter inference run with extsc{connect} produces posteriors which differ from the posteriors derived using extsc{class} by typically less than $0.01$--$0.1$ standard deviations for all parameters. We also stress that the training data can be produced in parallel, making efficient use of all available compute resources. The extsc{connect} code is publicly available for download at \url{https://github.com/AarhusCosmology}.
Motivation & Objective
- To address the high computational cost of Bayesian parameter inference in cosmology, which typically requires 10^5–10^6 evaluations of the Einstein-Boltzmann solver.
- To reduce the number of expensive CLASS evaluations needed for training a neural emulator by developing a novel iterative sampling strategy.
- To create a plug-and-play framework that enables fast, accurate parameter inference using trained neural networks without retraining for new datasets.
- To make the emulator compatible with standard MCMC samplers like MontePython and Cobaya, ensuring broad usability in existing cosmological workflows.
- To provide a fully reproducible, open-source solution with support for custom cosmological outputs and GPU acceleration potential.
Proposed method
- Uses a fully connected feedforward neural network to emulate cosmological observables (e.g., CMB power spectra, matter power spectra) computed by CLASS.
- Employs an iterative Latin hypercube sampling strategy to generate high-quality training data, minimizing the number of required CLASS evaluations by two orders of magnitude.
- Trains the neural network on a dataset of cosmological parameters and their corresponding CLASS outputs, with customizable output variables defined via input configuration files.
- Integrates seamlessly with MontePython and Cobaya via a plugin that replaces CLASS calls with fast neural network inference.
- Supports user-defined loss functions and network architectures through modular code structure, enabling customization for specific cosmological models.
- Generates training data in parallel, enabling efficient use of high-performance computing resources.
Experimental results
Research questions
- RQ1Can a neural network emulator trained on a reduced set of CLASS evaluations achieve high-precision emulation of cosmological observables?
- RQ2To what extent can iterative sampling strategies reduce the number of required CLASS evaluations while maintaining emulator accuracy?
- RQ3How accurate are cosmological parameter posteriors derived using the emulator compared to those from full CLASS computations?
- RQ4Can the emulator be reused across different dataset combinations without retraining, and how does this affect inference speed and accuracy?
- RQ5To what extent can the framework be integrated into existing MCMC sampling pipelines like MontePython with minimal code changes?
Key findings
- CONNECT reduces the number of required CLASS evaluations for training by two orders of magnitude compared to standard inference runs, significantly lowering data generation costs.
- Cosmological parameter inference using CONNECT produces posteriors that differ from those obtained with full CLASS by less than 0.01–0.1 standard deviations for all parameters.
- The framework enables MCMC inference to be completed in hours rather than days or weeks, with inference time dominated by likelihood evaluation rather than model computation.
- The trained emulator is fully reusable across different dataset combinations without retraining, enabling rapid reanalysis when new data is added.
- The framework is compatible with MontePython and Cobaya, and the plugin interface requires no modifications to the original codebases.
- The training data can be generated in parallel, making optimal use of available HPC resources and enabling scalable data generation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.