Recognition: 1 theorem link
Cobaya: Code for Bayesian Analysis of hierarchical physical models
Pith reviewed 2026-05-14 21:53 UTC · model grok-4.3
The pith
Cobaya automatically detects interdependencies in model pipelines to cache results and block parameters by dependency and cost for faster sampling.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
Cobaya exploits interdependencies between different stages of a model pipeline for sampling efficiency: intermediate results are automatically cached, and parameters are grouped in blocks according to their dependencies and optimally sorted, taking into account their individual computational costs, so as to minimize the cost of their variation during sampling, thanks to a novel algorithm.
What carries the argument
A novel algorithm that groups parameters into dependency blocks and then optimally sorts those blocks by computational cost to minimize re-evaluation during sampling.
Where Pith is reading between the lines
- The same automatic blocking logic could be applied to optimization or emulation tasks outside Bayesian sampling, such as training surrogate models for expensive simulators.
- Because the method assumes pipelines with inspectable stages, it may need explicit extensions for fully black-box or dynamically generated models.
- Integration with graph-based computation frameworks used in machine learning could make the dependency detection even more general.
Load-bearing premise
The internal structure of an arbitrary user-supplied model pipeline can be automatically inspected and exploited for caching and blocking without requiring user-written dependency declarations or custom code.
What would settle it
A concrete test case in which a hidden or non-static dependency exists between pipeline stages that the automatic inspector fails to detect, producing incorrect cached values and therefore a biased or incorrect posterior.
read the original abstract
We present Cobaya, a general-purpose Bayesian analysis code aimed at models with complex internal interdependencies. Without the need for specific code by the user, interdependencies between different stages of a model pipeline are exploited for sampling efficiency: intermediate results are automatically cached, and parameters are grouped in blocks according to their dependencies and optimally sorted, taking into account their individual computational costs, so as to minimize the cost of their variation during sampling, thanks to a novel algorithm. Cobaya allows exploration of posteriors using a range of Monte Carlo samplers, and also has functions for maximization and importance-reweighting of Monte Carlo samples with new priors and likelihoods. Cobaya is written in Python in a modular way that allows for extendability, use of calculations provided by external packages, and dynamical reparameterization without modifying its source. It can exploit hybrid OpenMP/MPI parallelization, and has sub-millisecond overhead per posterior evaluation. Though Cobaya is a general purpose statistical framework, it includes interfaces to a set of cosmological Boltzmann codes and likelihoods (the latter being agnostic with respect to the choice of the former), and automatic installers for external dependencies.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The manuscript presents Cobaya, a modular Python framework for Bayesian inference on hierarchical physical models. It automatically exploits pipeline interdependencies via intermediate-result caching and a novel algorithm that groups parameters into blocks according to dependencies and sorts them by individual computational cost to minimize variation expenses during sampling. The code supports a range of Monte Carlo samplers, maximization, importance reweighting, hybrid OpenMP/MPI parallelization, dynamical reparameterization, and provides interfaces to cosmological Boltzmann solvers and likelihoods with automatic dependency installers.
Significance. If the implementation matches the description, the work supplies a practical, extensible tool that reduces sampling costs for complex models without requiring users to declare dependencies explicitly. The released code, low-overhead design, and cosmological interfaces constitute verifiable strengths that can improve efficiency and reproducibility in fields such as cosmology.
minor comments (3)
- [Abstract] Abstract: the sub-millisecond overhead claim would be more convincing if accompanied by a brief reference to benchmark timings or a table in the main text.
- [Section 4] Section 4 (or equivalent on the blocking algorithm): a short pseudocode listing or explicit optimality criterion would help readers verify the generality of the automatic inspection for arbitrary pipelines.
- Figure captions: ensure all panels include explicit axis labels and units so that the efficiency gains are immediately readable without consulting the main text.
Simulated Author's Rebuttal
We thank the referee for their positive and accurate summary of the manuscript. We are pleased that the referee recognizes the practical value of Cobaya's automatic caching, novel parameter-blocking algorithm, and interfaces to cosmological codes, and we appreciate the recommendation to accept the paper.
Circularity Check
No significant circularity
full rationale
The paper describes a software package and its novel algorithm for automatic dependency inspection, parameter blocking, and caching in Bayesian sampling. No equations, fitted parameters, or self-referential derivations are present; the central claims are implemented in released, inspectable code rather than reduced to inputs by construction. Self-citations are absent from the load-bearing description of the algorithm.
Axiom & Free-Parameter Ledger
Forward citations
Cited by 25 Pith papers
-
Late-time reconstruction of non-minimally coupled gravity with a smoothness prior
Non-parametric reconstruction of non-minimally coupled gravity with a smoothness prior on CMB, DESI BAO, supernovae, and DES data yields a 2.8σ hint for coupling and a preference for phantom divide crossing stabilized...
-
DESI DR2 Results II: Measurements of Baryon Acoustic Oscillations and Cosmological Constraints
DESI DR2 BAO data exhibits 2.3 sigma tension with CMB in Lambda-CDM but prefers evolving dark energy (w0 > -1, wa < 0) at 3.1 sigma with CMB and 2.8-4.2 sigma when including supernovae.
-
DESI 2024 VI: Cosmological Constraints from the Measurements of Baryon Acoustic Oscillations
First-year DESI BAO data are consistent with flat LambdaCDM and, when combined with CMB, show a 2.5-3.9 sigma preference for evolving dark energy (w0 > -1, wa < 0) that strengthens with certain supernova datasets.
-
New Isocurvature Constraints from JWST UV Luminosity Function
First UVLF-based constraints on model-agnostic isocurvature power spectra for CDM, baryon, neutrino, and dark radiation modes yield consistent 95% credible envelopes over k ~ 0.5-10 Mpc^{-1}.
-
Axion dark matter from extended misalignment with a constant-$\omega_\phi$ pre-oscillatory phase and dark radiation
The extended misalignment model with constant-ω_φ pre-oscillatory phase and dark radiation coupling is constrained by cosmological data to favor negative ω_φ and f_φ in [80, 1.5×10^10] TeV without resolving H0 or S8 tensions.
-
Axion dark matter from extended misalignment with a constant-$\omega_\phi$ pre-oscillatory phase and dark radiation
Extended misalignment for axion-like particles with constant-ω_ϕ pre-oscillation and dark radiation coupling yields data-driven constraints favoring negative ω_ϕ and f_ϕ in [80, 1.5×10^10] TeV but does not ease cosmol...
-
Saturation Mechanisms in the Interacting Dark Sector
Nonlinear dark-sector interaction models with a half-saturation sparseness scale are observationally preferred over their linear counterparts at >95% confidence for two of three cases.
-
Into the Gompverse: A robust Gompertzian reionization model for CMB analyses
A Gompertzian reionization model with three nuisance parameters demotes optical depth to a derived quantity, reducing its uncertainty by a factor of three and revealing potential neutrino mass tension in CMB analyses.
-
Non-minimally coupled quintessence with sign-switching interaction
A new quintessence model with non-minimal coupling produces an effective sign-switching interaction that fits current data better than LambdaCDM or w0waCDM and accounts for late-time dark energy weakening without phan...
-
Ultra-light axion constraints from Planck and ACT: the role of nonlinear modelling
Naive nonlinear modelling of non-cold matter produces an artificial preference for a subdominant ultralight axion dark matter component at m ≈ 10^{-24} eV via a lensing-like enhancement in the CMB power spectrum.
-
Constraints on the inflationary vacuum and reheating era from NANOGrav
NANOGrav data favors a blue-tilted tensor spectrum with nt ≈ 2.2, radiation-dominated reheating, and alpha-vacuum states over standard Bunch-Davies, with a frequency-dependent alpha suggested to resolve the blue-tilt tension.
-
The End of the First Act: Spectral Running, Interacting Dark Radiation, and the Hubble Tension in Light of ACT DR6 Data
Including spectral running α_s, β_s and self-interacting dark radiation relaxes the ACT DR6 bound on ΔN_eff to <0.58 and lowers the Hubble tension to 2.2σ with three extra parameters.
-
Cosmological Impact of Redshift-Dependent Type Ia Supernovae Calibration
A phenomenological redshift-dependent SNIa magnitude correction shows no evidence in ΛCDM but is preferred at 4.3σ with dynamical dark energy, reducing Hubble tension to 1.5σ.
-
SWIM: Stochastic Warm Inflation Module to generate and analyse Warm Inflationary power spectrum
SWIM is a publicly available numerical platform that generates full Warm Inflation scalar power spectra and enables MCMC parameter estimation with CMB data for arbitrary potentials and dissipation forms.
-
Model-Independent Analysis of Type Ia Supernova Datasets and Implications for Dark Energy
Apparent dynamical dark energy signals from SNe Ia with DESI data are consistent with LambdaCDM when accounting for dataset-specific Omega_m inconsistencies rather than requiring evolving dark energy.
-
FolpsD: combining EFT and phenomenological approaches for joint power spectrum and bispectrum analyses
FolpsD combines EFT power spectrum and tree-level bispectrum with damping to enable joint analyses that improve cosmological constraints from DESI-like galaxy mocks by up to 30% on As and omega_cdm while extending the...
-
Joint Curvature and Growth Rate measurements with Supernova Peculiar Velocities and the CMB
SN peculiar velocities plus Planck CMB data give joint constraints on σ8, γ, and Ωk, with hints of positive curvature (Ωk ≈ -0.01) at 2-3σ and γ values consistent with GR.
-
Is the $w_0w_a$CDM cosmological parameterization evidence for dark energy dynamics partially caused by the excess smoothing of Planck PR4 CMB anisotropy data?
Planck PR4 CMB data mildly favors dynamical dark energy, but this preference weakens when accounting for possible excess smoothing, indicating the signal may partly arise from data processing issues.
-
Exploring the interplay of late-time dynamical dark energy and new physics before recombination
Model-independent reconstruction finds 96.7-98.5% probability of phantom crossing if recombination is standard, but early new physics to ease Hubble tension weakens this preference while requiring unrealistically high...
-
GetDist: a Python package for analysing Monte Carlo samples
GetDist implements boundary-corrected KDE with automatic smoothing for analyzing weighted and correlated Monte Carlo samples, plus plotting and diagnostic tools.
-
Single field matter bounce with dark energy era: comparison with CMB Planck 2018 data and best fit parameters
A matter bounce model driven by a scalar field with exponential potential fits Planck 2018 CMB data comparably to inflationary ΛCDM, with the potential slope λ directly setting the scalar spectral index ns.
-
The Status of Gravitational Vector Perturbations with Recent CMB Data
Recent CMB datasets tighten 95% CL upper bounds on vector-mode amplitude r_v to 1.3e-4 (neutrino isocurvature), 6.8 (octupole), and 4.2 (sourced) at k=0.05 Mpc^-1, with no significant detection.
-
New constraints on primordial non-Gaussianity from large-scale cross-correlations of CMB lensing and the cosmic infrared background
Dust-cleaned CIB and CMB lensing cross-correlations yield f_NL^local = 43 ± 23, tightening constraints on local primordial non-Gaussianity.
-
Model-independent consistency tests of DESI DR2 BAO and SN Ia
DESI DR2 BAO and Pantheon+/Union3 SN Ia datasets are mutually consistent at 1-2 sigma using crossing statistics, supporting a reconstruction suggestive of evolving dark energy at low redshift.
-
Extended Dark Energy analysis using DESI DR2 BAO measurements
Extended analysis of DESI DR2 data confirms robust evidence for dynamical dark energy with phantom crossing preference, stable under parametric and non-parametric modeling.
Reference graph
Works this paper leans on
-
[1]
(as long as its elements can be serialized in plain text). We show an example in Fig. 2, including specifi- cation of parameter roles and dynamic parameter defini- tion, as well as definition of the likelihood and prior for the simple case where everything is just a basic Python function. Describing complex models and pipelines can take a large amount of inp...
-
[2]
On their way out of the model (i.e
Parameterization The Parameterization class controls the flow of pa- rameters into and out of the Model, taking into account their roles with respect to different parts of the code. On their way out of the model (i.e. from the point of view of the Sampler), parameters can play three different roles: • Sampled parameters are the ones whose value is to be vari...
-
[3]
They are inter- faced directly from the 1D continuous distributions of scipy.stats3
Prior Priors for the sampled parameters can be specified in two different ways: • The prior keyword for each parameter defines a separable product of 1D priors. They are inter- faced directly from the 1D continuous distributions of scipy.stats3. In the example in Fig. 2, these are the uniform priors (x,y )∈ (0, 2)2. • Additional, possibly-multi-dimensional p...
-
[4]
lambda x , y : stats . norm . logpdf ( x - y , loc =0 , scale =0.3)
Likelihood and theory In general there can be multiple theory and likelihood components in a single model, with each theory compo- nent calculating some quantity required as input to the likelihoods or to another theory component. Likelihoods are just a special subclass of a general Theory class that directly return likelihood values. Both inherit a cachi...
work page 2018
- [5]
-
[6]
Efficient sampling of fast and slow cosmological parameters
A. Lewis, Phys. Rev. D 87, 103529 (2013), arXiv:1304.4473 [astro-ph.CO]
work page internal anchor Pith review Pith/arXiv arXiv 2013
-
[7]
W. J. Handley, M. P. Hobson, and A. N. Lasenby, MN- RAS 450, L61 (2015), arXiv:1502.01856 [astro-ph.CO]
work page internal anchor Pith review Pith/arXiv arXiv 2015
-
[8]
W. J. Handley, M. P. Hobson, and A. N. Lasenby, MN- RAS 453, 4384 (2015), arXiv:1506.00171 [astro-ph.IM]
work page internal anchor Pith review Pith/arXiv arXiv 2015
-
[9]
T. E. Oliphant, Computing in Science Engineering 9, 10 (2007)
work page 2007
-
[10]
Improving the Flexibility and Robustness of Model-Based Derivative-Free Optimization Solvers
C. Cartis, J. Fiala, B. Marteau, and L. Roberts, arXiv e-prints (2018), arXiv:1804.00154 [math.OC]
work page internal anchor Pith review Pith/arXiv arXiv 2018
-
[11]
The BOBYQA algorithm for bound constrained optimization without deriva- tives,
M. J. D. Powell, “The BOBYQA algorithm for bound constrained optimization without deriva- tives,” Tech. Rep. DAMTP 2009/NA06, University of Cambridge (2009), http://www.cityu.edu.hk/rcms/ publications/preprint26.pdf
work page 2009
-
[12]
Efficient Computation of CMB anisotropies in closed FRW models
A. Lewis, A. Challinor, and A. Lasenby, ApJ 538, 473 (2000), arXiv:astro-ph/9911177 [astro-ph]
work page internal anchor Pith review Pith/arXiv arXiv 2000
-
[13]
CMB power spectrum parameter degeneracies in the era of precision cosmology
C. Howlett, A. Lewis, A. Hall, and A. Challi- nor, J. Cosmology Astropart. Phys. 1204, 027 (2012), arXiv:1201.3654 [astro-ph.CO]
work page internal anchor Pith review Pith/arXiv arXiv 2012
-
[14]
The Cosmic Linear Anisotropy Solving System (CLASS) I: Overview
J. Lesgourgues, ArXiv e-prints (2011), arXiv:1104.2932 [astro-ph.IM]
work page internal anchor Pith review Pith/arXiv arXiv 2011
-
[15]
D. Blas, J. Lesgourgues, and T. Tram, J. Cosmology As- tropart. Phys. 1107, 034 (2011), arXiv:1104.2933 [astro- ph.CO]
work page internal anchor Pith review Pith/arXiv arXiv 2011
-
[16]
Cosmological parameters from CMB and other data: a Monte-Carlo approach
A. Lewis and S. Bridle, Phys. Rev. D 66, 103511 (2002), arXiv:astro-ph/0205436 [astro-ph]. 16
work page internal anchor Pith review Pith/arXiv arXiv 2002
-
[17]
B. Audren, J. Lesgourgues, K. Benabed, and S. Prunet, J. Cosmology Astropart. Phys. 2013, 001 (2013), arXiv:1210.7183 [astro-ph.CO]
work page internal anchor Pith review Pith/arXiv arXiv 2013
-
[18]
MontePython 3: boosted MCMC sampler and other features
T. Brinckmann and J. Lesgourgues, Phys. Dark Univ. 24, 100260 (2019), arXiv:1804.07261 [astro-ph.CO]
work page internal anchor Pith review Pith/arXiv arXiv 2019
-
[19]
CosmoSIS: modular cosmological parameter estimation
J. Zuntz, M. Paterno, E. Jennings, D. Rudd, A. Man- zotti, S. Dodelson, S. Bridle, S. Sehrish, and J. Kowalkowski, Astron. Comput. 12, 45 (2015), arXiv:1409.3409 [astro-ph.CO]
work page internal anchor Pith review Pith/arXiv arXiv 2015
-
[20]
S. K. Lam, A. Pitrou, and S. Seibert, in Proceedings of the Second Workshop on the LL VM Compiler Infrastruc- ture in HPC , LLVM ’15 (ACM, New York, NY, USA,
- [21]
-
[22]
The YAML data serialization standard,
“The YAML data serialization standard,” https:// yaml.org/
-
[23]
N. Metropolis, A. W. Rosenbluth, M. N. Rosenbluth, A. H. Teller, and E. Teller, J. Chem. Phys. 21, 1087 (1953)
work page 1953
- [24]
-
[25]
A. Gelman and D. Rubin, Stat. Sci. 7, 457 (1992), http://www.stat.columbia.edu/~gelman/research/ published/itsim.pdf
work page 1992
-
[26]
S. P. Brooks and A. Gelman, J. Comp. Graph. Stat. 7, 434 (1998), http://www.stat.columbia.edu/~gelman/ research/published/brooksgelman2.pdf
work page 1998
-
[27]
McKinney, in Proceedings of the 9th Python in Sci- ence Conference, edited by S
W. McKinney, in Proceedings of the 9th Python in Sci- ence Conference, edited by S. van der Walt and J. Mill- man (2010) pp. 51 – 56,http://conference.scipy.org/ proceedings/scipy2010/pdfs/mckinney.pdf
work page 2010
-
[28]
GetDist: a Python package for analysing Monte Carlo samples
A. Lewis, (2019), https://getdist.readthedocs.io, arXiv:1910.13970 [astro-ph.IM]
work page internal anchor Pith review arXiv 2019
-
[29]
S. van der Walt, S. C. Colbert, and G. Varoquaux, Com- puting in Science Engineering 13, 22 (2011)
work page 2011
-
[30]
R. E. Smith, J. A. Peacock, A. Jenkins, S. D. M. White, C. S. Frenk, F. R. Pearce, P. A. Thomas, G. Efstathiou, and H. M. P. Couchmann (VIRGO Consortium), MN- RAS 341, 1311 (2003), arXiv:astro-ph/0207664 [astro- ph]
work page internal anchor Pith review Pith/arXiv arXiv 2003
-
[31]
Revising the Halofit Model for the Nonlinear Matter Power Spectrum
R. Takahashi, M. Sato, T. Nishimichi, A. Taruya, and M. Oguri, ApJ 761, 152 (2012), arXiv:1208.2701 [astro- ph.CO]
work page internal anchor Pith review Pith/arXiv arXiv 2012
-
[32]
A. Mead, J. Peacock, C. Heymans, S. Joudaki, and A. Heavens, MNRAS 454, 1958 (2015), arXiv:1505.07833 [astro-ph.CO]
work page internal anchor Pith review Pith/arXiv arXiv 1958
- [34]
-
[35]
The Simons Observatory: Science goals and forecasts
J. Aguirre et al. (Simons Observatory), JCAP 1902, 056 (2019), arXiv:1808.07445 [astro-ph.CO]
work page internal anchor Pith review Pith/arXiv arXiv 1902
-
[36]
N. Aghanim et al. (Planck), A&A 641, A8 (2020), arXiv:1807.06210 [astro-ph.CO]
-
[37]
B. D. Sherwin and M. Schmittfull, Phys. Rev. D 92, 043005 (2015), arXiv:1502.05356 [astro-ph.CO]
work page internal anchor Pith review Pith/arXiv arXiv 2015
-
[38]
Demonstration of cosmic microwave background delensing using the cosmic infrared background
P. Larsen, A. Challinor, B. D. Sherwin, and D. Mak, Phys. Rev. Lett. 117, 151102 (2016), arXiv:1607.05733 [astro-ph.CO]
work page internal anchor Pith review Pith/arXiv arXiv 2016
-
[39]
CMB Delensing Beyond the B Modes
D. Green, J. Meyers, and A. van Engelen, J. Cosmol- ogy Astropart. Phys. 1712, 005 (2017), arXiv:1609.08143 [astro-ph.CO]
work page internal anchor Pith review Pith/arXiv arXiv 2017
-
[40]
Planck 2018 results. VI. Cosmological parameters
N. Aghanim et al. (Planck), Astron. Astrophys. 641, A6 (2020), arXiv:1807.06209 [astro-ph.CO]
work page internal anchor Pith review Pith/arXiv arXiv 2020
- [41]
-
[42]
Skilling, Bayesian Analysis 1, 833 (2006)
J. Skilling, Bayesian Analysis 1, 833 (2006)
work page 2006
-
[43]
R. M. Neal, arXiv e-prints , physics/0009028 (2000), arXiv:physics/0009028 [physics.data-an]. 17 import numpy as np from cobaya . theory import Theory def f e a t u r e _ e n v e l o p e (k , c , w ) : """ R e t u r n s the value of the e n v e l o p e at k . The e n v e l o p e f u n c t i o n a l form is env ( k ) = exp ( - 0 . 5 ( log10 ( k / c ) / w )...
work page internal anchor Pith review Pith/arXiv arXiv 2000
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.