HIcosmo : a differentiable JAX -based framework for cosmology inference

and Xin Zhang · 2026

Read HIcosmo : a differentiable JAX -based framework for cosmology inference by and Xin Zhang (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2606-28175.txt.

Introduction

A team including Xin Zhang presents HIcosmo, an open-source software framework for drawing conclusions about the universe from telescope and survey data. The framework targets the flood of data expected from next-generation sky surveys, which will deliver observations on a scale no earlier survey has matched.

HIcosmo is built on JAX, a library that computes derivatives automatically, so every step from model to likelihood to sampling can supply exact gradients. Zhang and colleagues checked it against reference codes: key values agreed closely, and final constraints differed by only a small fraction of the uncertainty. Sampling ran several times faster than a standard rival on ordinary processors, and far faster still on graphics hardware at survey scale.

Catalog record

CREATORand Xin Zhang
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE65 KB
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2606.28175

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

HIcosmo : a differentiable JAX -based framework for cosmology inference and Xin Zhang Abstract The Stage IV cosmological surveys, such as Euclid, LSST, DESI, and SKA, will deliver observational data of unprecedented volume, calling for efficient and reliable inference tools. This paper presents HIcosmo (High-performance Inference for Cosmology), an open-source JAX -based framework for cosmology inference. In HIcosmo , the forward model, distance integrals, likelihood evaluations, posterior sampling, and Fisher forecasts are all built from JAX primitives, so that gradients and Hessians of the log-likelihood are obtained directly by automatic differentiation, without any finite-difference approximation. The framework implements the Λ \Lambda CDM, w w CDM, w 0 ​ w a w_{0}w_{a} CDM, and interacting dark-energy models, and provides likelihoods for Type Ia supernovae (Pantheon+, DES-SN5YR, Union3), baryon acoustic oscillations (DESI DR1/DR2, SDSS), Planck 2018 distance priors, local H 0 H_{0} measurements, and strong-lensing time delays. Its scope is restricted to background cosmology, with Boltzmann solvers and full perturbation-level likelihoods left to external tools. We validate HIcosmo against the reference implementation of each likelihood and against Cobaya. χ 2 \chi^{2} values agree to absolute differences of 10 − 6 10^{-6} – 10 − 2 10^{-2} , and the marginalized constraints from the two codes differ by less than 0.2 ​ σ 0.2\sigma in every analysis tested. Leveraging just-in-time compilation and automatic differentiation, HIcosmo achieves about 8.7 × 8.7\times the end-to-end sampling throughput of Cobaya on CPU. As the dataset grows to survey scale, GPU acceleration over CPU reaches up to 20 × 20\times . As applications, we present multi-probe Λ \Lambda CDM joint constraints, dark-energy equation-of-state constraints, and Fisher forecasts for six 21 cm intensity-mapping surveys, including SKA1, MeerKAT, BINGO, Tianlai, and CHIME. 1 Introduction Nearly a century of cosmological observations has established the six-parameter \Lambda cold dark matter ( \Lambda CDM) model as the standard model of cosmology, supported by a wide range of data [ 1 , 2 , 3 , 4 , 5 ] , with the Planck satellite [ 6 , 7 ] testing the model to unprecedented precision. As the measurements have been improved, however, inconsistencies have emerged between several key parameters inferred from the early and the late Universe [ 7 , 8 , 9 , 10 ] . The most prominent is the Hubble constant tension, the significant difference between the H_{0} value inferred from Planck data and that inferred from local SNe Ia calibrated with the Cepheid distance ladder. The S_{8} tension between cosmic-shear surveys and Planck 2018 [ 11 ] , as well as the enhanced lensing amplitude in the CMB power spectrum [ 12 ] , also challenges the standard model. These tensions suggest that our understanding of the Universe within the standard model may be incomplete, and their clarification requires further investigation. To clarify these tensions and further improve the parameter measurements, a new generation of cosmological surveys is under construction or being planned. Euclid [ 13 ] will measure the shapes and redshifts of more than a billion galaxies, and LSST [ 14 ] is expected to detect \mathcal{O}(10^{5}) Type Ia supernovae over its ten-year survey. The BAO analysis of DESI [ 15 ] has already compressed the spectra of six million tracers into 12 measurements of D_{M}/r_{d} and D_{H}/r_{d} at seven effective redshifts. 21 cm intensity-mapping (IM) experiments will further provide three-dimensional maps of large-scale structure in the radio band, with the SKA1 Band 1 survey alone covering 20{,}000 deg 2 over 0.3<z<3 . Data on this scale place new demands on the efficiency and reliability of cosmological inference tools. The computational cost of cosmological inference depends largely on the level to which the data are compressed. At the background level, likelihoods operate on distances, distance ratios, and distance moduli, and the parameter space for \Lambda CDM or w_{0}w_{a} CDM typically has only d\sim 5 – 7 dimensions. Probes at this level have been used extensively to constrain cosmological parameters and to test the theory of gravity and fundamental principles of cosmology, with data including CMB, BAO, SNe Ia, strong-lensing time delays, gravitational wave standard sirens, fast radio bursts, and other cosmological probes [ 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 34 , 35 , 36 , 37 , 38 , 39 ] , and mature codes such as Cobaya [ 40 ] handle such analyses comfortably on an ordinary workstation. The situation at the perturbation level is very different. Weak-lensing and galaxy-clustering 3\times 2 pt analyses require repeated evaluations of the matter power spectrum P(k,z) by Boltzmann solvers such as CAMB [ 41 ] or CLASS [ 42 ] , the parameter dimension reaches d\sim 30 – 50 for a single survey, and multi-survey combinations easily exceed 150 parameters [ 43 ] . At such dimensionality, the efficiency of random-walk Metropolis–Hastings (MH) sampling degrades rapidly [ 44 ] . Piras et al. [ 43 ] estimate that a traditional nested-sampling analysis of a 157-parameter Stage IV problem would cost about 10^{4} CPU core-days. Gradient-based samplers offer a way out of this high-dimensional sampling problem. The No-U-Turn Sampler (NUTS) [ 45 ] is an adaptive variant of Hamiltonian Monte Carlo (HMC), whose mixing time for smooth high-dimensional targets scales roughly as d^{1/4} , far better than the d scaling of random-walk MH [ 44 ] . The difficulty is that the mature cosmological pipelines, including CosmoMC [ 46 ] , Cobaya [ 40 ] , emcee [ 47 ] , and MontePython [ 48 ] , are not implemented as differentiable programs. Gradients of the log-likelihood can be approximated by finite differences, but each gradient then costs O(d) extra likelihood evaluations and is sensitive to the choice of step size. The development of automatic differentiation (AD) [ 49 ] and JAX [ 50 ] has changed this situation. JAX brings automatic differentiation, just-in-time (JIT) compilation, vectorization, and a unified CPU/GPU/TPU execution interface to the Python ecosystem on which most cosmological codes rely. Piras et al. [ 43 ] have demonstrated the potential of this approach at the perturbation level, where their JAX -based Stage IV 3\times 2 pt pipeline completed a 157-parameter inference in about 8 days on 24 GPUs, an estimated 545\times speedup over the equivalent nested-sampling analysis. Several JAX -native cosmological tools have appeared. jax-cosmo [ 51 ] implements differentiable distance calculations and weak-lensing power spectra, while CosmoPower [ 52 ] replaces the Boltzmann solver with neural-network emulators of C_{\ell} and P(k) , whose forward pass and gradients have been ported to JAX [ 43 ] . At the background level, however, there is still no systematically validated JAX -native inference pipeline that provides differentiable likelihoods, NUTS sampling, and AD-based Fisher forecasts within a single framework, with end-to-end comparisons against the reference codes commonly used in cosmology at every step. This work fills that gap. In this paper, we present HIcosmo ( H igh-performance I nference for Cosmo logy), a differentiable JAX -based framework for background-cosmology inference. HIcosmo implements four background models, namely \Lambda CDM, w CDM, w_{0}w_{a} CDM, and an interacting dark-energy model. The supported likelihoods

Read the complete text