Table of Contents
Fetching ...

Flinch: A Differentiable Framework for Field-Level Inference of Cosmological parameters from curved sky data

Andrea Crespi, Marco Bonici, Arthur Loureiro, Jaime Ruiz-Zapatero, Ivan Sladoljev, Zack Li, Adrian Bayer, Marius Millea, Uroš Seljak

TL;DR

Flinch.jl tackles field-level cosmological inference on the sphere by delivering a fully differentiable, end-to-end framework that propagates map-level gradients to cosmological parameters via a differentiable $C_\ell(\boldsymbol{\theta})$ emulator. It combines a hierarchical spherical model with AD-enabled spherical harmonic transforms and gradient-based samplers (HMC/NUTS/MCLMC) to reconstruct maps and infer parameters directly from pixel data, bypassing intermediate likelihoods over summary statistics. In simulations with masked CMB temperature maps, Flinch.jl yields up to ~40% tighter constraints than pseudo-$C_\ell$ approaches, with MCLMC providing orders-of-magnitude gains in sampling efficiency. The work lays the groundwork for scalable, spin-field extensions and application to upcoming CMB and LSS surveys, enabling truly end-to-end, information-rich cosmological analyses.

Abstract

We present Flinch, a fully differentiable and high-performance framework for field-level inference on angular maps, developed to improve the flexibility and scalability of current methodologies. Flinch is integrated with differentiable cosmology tools, allowing gradients to propagate from individual map pixels directly to the underlying cosmological parameters. This architecture allows cosmological inference to be carried out directly from the map itself, bypassing the need to specify a likelihood for intermediate summary statistics. Using simulated, masked CMB temperature maps, we validate our pipeline by reconstructing both maps and angular power spectra, and we perform cosmological parameter inference with competitive precision. In comparison with the standard pseudo-$C_\ell$ approach, Flinch delivers substantially tighter constraints, with error bars reduced by up to 40%. Among the gradient-based samplers routinely employed in field-level analyses, we further show that MicroCanonical Langevin Monte Carlo provides orders-of-magnitude improvements in sampling efficiency over currently employed Hamiltonian Monte Carlo samplers, greatly reducing computational expense.

Flinch: A Differentiable Framework for Field-Level Inference of Cosmological parameters from curved sky data

TL;DR

Flinch.jl tackles field-level cosmological inference on the sphere by delivering a fully differentiable, end-to-end framework that propagates map-level gradients to cosmological parameters via a differentiable emulator. It combines a hierarchical spherical model with AD-enabled spherical harmonic transforms and gradient-based samplers (HMC/NUTS/MCLMC) to reconstruct maps and infer parameters directly from pixel data, bypassing intermediate likelihoods over summary statistics. In simulations with masked CMB temperature maps, Flinch.jl yields up to ~40% tighter constraints than pseudo- approaches, with MCLMC providing orders-of-magnitude gains in sampling efficiency. The work lays the groundwork for scalable, spin-field extensions and application to upcoming CMB and LSS surveys, enabling truly end-to-end, information-rich cosmological analyses.

Abstract

We present Flinch, a fully differentiable and high-performance framework for field-level inference on angular maps, developed to improve the flexibility and scalability of current methodologies. Flinch is integrated with differentiable cosmology tools, allowing gradients to propagate from individual map pixels directly to the underlying cosmological parameters. This architecture allows cosmological inference to be carried out directly from the map itself, bypassing the need to specify a likelihood for intermediate summary statistics. Using simulated, masked CMB temperature maps, we validate our pipeline by reconstructing both maps and angular power spectra, and we perform cosmological parameter inference with competitive precision. In comparison with the standard pseudo- approach, Flinch delivers substantially tighter constraints, with error bars reduced by up to 40%. Among the gradient-based samplers routinely employed in field-level analyses, we further show that MicroCanonical Langevin Monte Carlo provides orders-of-magnitude improvements in sampling efficiency over currently employed Hamiltonian Monte Carlo samplers, greatly reducing computational expense.

Paper Structure

This paper contains 19 sections, 22 equations, 11 figures, 2 tables.

Figures (11)

  • Figure 1: Pictorial representation for our Bayesian hierarchical models. Left: baseline model following Loureiro_2023. A prior on the angular power spectra, $\pi(\mathbf{C})$, specifies the statistics of the latent field. Given these spectra, latent spherical-harmonic coefficients $\mathbf{a}$ are drawn from a zero-mean Gaussian with covariance set by $\mathbf{C}$. The observed data $\mathbf{d}$ are then generated from the likelihood $\mathcal{L}(\mathbf{d}|\mathbf{a},\mathbf{N})$, which combines the latent field with an additive noise component described by the covariance $\mathbf{N}$. Right: extended model introducing parameter vectors $\boldsymbol{\theta}$ with prior $\pi(\boldsymbol{\theta})$. The power spectra are no longer free variables but are tied to the parameters through the deterministic mapping $\mathbf{C}(\boldsymbol{\theta})$, implemented by a Dirac constraint. This reparameterization shifts the prior information from $\mathbf{C}$ to $\boldsymbol{\theta}$ while leaving the latent field layer $\mathbf{a}$ and the likelihood unchanged, enabling direct inference of the parameters from the data within the same generative structure.
  • Figure 2: Example of an adjoint-aware wrapper for a spherical-harmonic transform. The forward pass converts a set of harmonic coefficients alm into a map, while the pullback reconstructs the gradient in harmonic space by reusing the same routine and applying the parity fix for the highest modes. This illustrates how AD support can be added with only a few lines of code, once the mathematical rules are derived.
  • Figure 3: Reconstruction of a masked, noisy field. Panels: (a) fiducial noiseless map; for each reconstruction method, we show the mean map and the per‑pixel standard deviation: HMC (c–d), NUTS (e–f), and MCLMC (g–h). All maps share the same color scale. The uncertainty panels highlight higher variance within the masked region, while the mean reconstructions recover the large-scale structure beneath the mask.
  • Figure 4: Pixel residuals normalized by the recovered per-pixel uncertainty. For NUTS and MCLMC, the residual distributions nearly perfectly overlap a standard normal ($\mu=0$, $\sigma^2=1$), consistent with their high degree of convergence. In contrast, HMC shows a slight deviation from this behavior, reflecting its comparatively weaker convergence.
  • Figure 5: Power spectrum comparison. The dashed curve shows the underlying input (fiducial) theory, while the markers display the reconstructed spectra with their $3\sigma$ standard deviations. The lower panel reports residuals normalized by their corresponding standard deviations, highlighting consistency with the fiducial model across scales. For clarity, we rebinned the entire $C_\ell$'s range so that each bin contains 11 multipoles.
  • ...and 6 more figures