[Paper Review] Capse.jl: efficient and auto-differentiable CMB power spectra emulation
Capse.jl is a neural network-based emulator that predicts CMB temperature, polarization, and lensing power spectra in microseconds with sub-0.1σ error across scales relevant to CMB-S4. It enables Bayesian inference up to 6 orders of magnitude faster than traditional methods by combining differentiable architecture with gradient-based samplers like NUTS and Pathfinder, achieving Planck-like cosmological constraints in under a second.
We present Capse.jl, a novel neural network-based emulator designed for rapid and accurate prediction of Cosmic Microwave Background (CMB) temperature, polarization, and lensing angular power spectra. The emulator computes predictions in just a few microseconds with emulation errors below $0.1σ$ for all the scales relevant for the upcoming CMB-S4 survey. Capse.jl can also be trained in an hour's time on a 8-cores CPU. We test Capse.jl on Planck 2018, ACT DR4, and 2018 SPT-3G data and demonstrate its capability to derive cosmological constraints comparable to those obtained by traditional methods, but with a computational efficiency that is three to six orders of magnitude higher. We take advantage of the differentiability of our emulators to use gradient-based methods, such as Pathfinder and Hamiltonian Monte Carlo (HMC), which speed up the convergence and increase sampling efficiency. Together, these features make Capse.jl a powerful tool for studying the CMB and its implications for cosmology. When using the fastest combination of our likelihoods, emulators, and analysis algorithm, we are able to perform a Plancky TT + TE + EE analysis in less than a second. To ensure full reproducibility, we provide open access to the codes and data required to reproduce all the results of this work.
Motivation & Objective
- Address the high computational cost of CMB likelihood evaluations in Bayesian cosmological inference using traditional Boltzmann solvers like CAMB.
- Develop a highly efficient, accurate, and differentiable emulator for CMB angular power spectra across temperature, polarization, and lensing.
- Enable rapid sampling and optimization using gradient-based inference methods such as Hamiltonian Monte Carlo and Pathfinder.
- Achieve computational speedups of 3–6 orders of magnitude compared to standard MCMC pipelines using CAMB and Cobaya.
- Ensure full reproducibility and open access to code and training data for community adoption and validation.
Proposed method
- Train a deep neural network to emulate CMB angular power spectra (TT, TE, EE, BB, and lensing) across a broad cosmological parameter space.
- Leverage automatic differentiation in Julia to make the emulator fully differentiable, enabling gradient-based inference algorithms.
- Apply Chebyshev polynomial decomposition to reduce output dimensionality and accelerate likelihood evaluation, improving computational efficiency.
- Use a multi-scale training strategy with synthetic parameter combinations to ensure accuracy across the full range of multipoles relevant to CMB-S4.
- Integrate the emulator into a full Bayesian inference pipeline using the Cobaya framework, replacing CAMB in likelihood evaluations.
- Benchmark performance using gradient-based samplers: NUTS, MicroCanonical HMC, and Pathfinder, comparing convergence and sampling efficiency.

Experimental results
Research questions
- RQ1Can a differentiable neural network emulator achieve sub-0.1σ accuracy in predicting CMB power spectra across all relevant scales for upcoming surveys?
- RQ2To what extent can gradient-based samplers like NUTS and Pathfinder accelerate cosmological inference when used with a differentiable emulator?
- RQ3How does the computational performance of Capse.jl compare to traditional CAMB-based pipelines in terms of wall-clock time for Planck, ACT DR4, and SPT-3G datasets?
- RQ4Can Chebyshev polynomial decomposition significantly enhance the efficiency of likelihood evaluation without sacrificing accuracy?
- RQ5Is the emulator robust and accurate enough to reproduce cosmological constraints comparable to those from CAMB and Cobaya on real data?
Key findings
- Capse.jl computes CMB power spectra in under 10 microseconds per call, with emulation errors below 0.1σ across all scales relevant to CMB-S4.
- The emulator achieves full cosmological constraints comparable to CAMB-based pipelines on Planck 2018, ACT DR4, and SPT-3G 2018 data, with posteriors differing by less than 0.1σ.
- A Planck TT+TE+EE analysis using Capse.jl, the fastest likelihood combination, and NUTS sampling completes in less than one second, compared to ~100 CPU hours with CAMB and Cobaya.
- The use of gradient-based samplers like NUTS and Pathfinder reduces analysis time by 2–6 orders of magnitude: 0.5 CPU hours for Planck, 1 hour for ACT, and 14 hours for SPT-3G.
- MicroCanonical HMC outperforms standard NUTS by a factor of 2–3 in efficiency while producing nearly identical posteriors.
- Chebyshev polynomial decomposition improves Planck analysis efficiency by nearly an order of magnitude and enables scalable, high-precision emulation with potential extension to galaxy clustering analyses.

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.