Mind the peak: improving cosmological constraints from GWTC-4.0 spectral sirens using semiparametric mass models Matteo Tagliazucchi, Michele Moresco, Nicola Borghi, Chiara Ciapetti Abstract Gravitational wave spectral sirens can provide cosmological constraints by using the shape of the binary black hole (BBH) mass distribution (MD). However, the precision and accuracy of these constraints depends critically on the capturing all the MD features. In this work, we analyze 137 BBH events from the latest GWTC-4.0 with a novel data-driven semiparametric approach based on Bspline that adaptively places knots around the most informative structures in the MD, while keeping the dimensionality of the parameter space moderate. Our flexible models resolve three distinct peaks at ∼ 10 \sim 10 , 18 18 , and 33 ​ M ⊙ 33\,\mathrm{M}_{\odot} and are statistically preferred over standard parametric models, with Bayes factors up to 226. Because these features are correlated with H 0 H_{0} , the semiparametric model yields, under different prior assumptions, 12%-21% improvement in the precision of H 0 H_{0} relative to parametric models, providing H 0 = 57.8 − 20.6 + 21.9 ​ km / s / Mpc H_{0}=57.8^{+21.9}_{-20.6}\,\mathrm{km/s/Mpc} in the best case. Our results demonstrate that capturing the full complexity of the BBH mass distribution is essential for realizing the cosmological potential of spectral sirens as gravitational wave catalogs continue to grow. 1 Introduction Since their first discovery 10 years ago ( 7 ) , gravitational-wave (GW) events from compact binary systems have proven to be an extremely promising cosmological probe for directly measuring the expansion rate of the Universe ( 39 , standard sirens,) . By combining the luminosity distance from GWs with redshift information, they offer an independent test to address the tension between local and early-Universe measurements of the Hubble constant ( 34 , H_{0} ; e.g, see) . In this work, we focus on the “spectral siren” method, which extracts redshift information by statistically breaking the mass-redshift degeneracy using features in the source-frame mass distribution (MD) of compact binaries ( 19 ; 41 ; 31 ; 22 ; 18 ; 30 ) . A critical aspect of this technique is the accurate modeling of the MD, as incorrect assumptions and simplified templates can introduce biases in the inferred H_{0} and reduce the constraining power of this method ( 36 ; 14 , e.g.,) . So far, most of the mass modeling for spectral siren cosmology has followed a template-driven approach in which a parametric form is assumed and eventually revised as more observations are made. For instance, the baseline binary black hole (BBH) MD adopted in the GWTC-3 cosmological analysis was a power law plus a single Gaussian peak ( 10 ) , whereas recent results from GWTC-4 are obtained using a model with two Gaussian peaks ( 3 ) . While flexible, these parametric models may not capture the full complexity of BBH MD. Moreover, guessing the correct MD shape in advance can be a challenge for the spectral siren method. We address these limitations by using a semiparametric model, similar to the one used in population studies by 20 , that is sufficiently flexible to capture unknown substructures in the BBH MD. Recent nonparametric studies have employed Gaussian processes for the primary mass distribution ( 23 ; 29 ) and BSpline for cosmic expansion H(z) ( 35 ) . Employing BSpline basis functions together with a novel data-driven optimization of knot positions, we demonstrate that a more detailed reconstruction of the BBH MD enables a significantly more powerful extraction of cosmological information. We include this model within the CHIMERA pipeline ( 16 ; 40 ; 17 ) , which we use to jointly infer H_{0} and population parameters from a subset of GWTC-4.0 BBHs. 2 Data We analyze the same dataset adopted in the GWTC-4.0 cosmology paper ( 3 ) , consisting of 137 BBHs detected between the first and the first part of the fourth observing run (O1 to O4a) of the LIGO-Virgo-KAGRA (LVK) collaboration ( 8 ; 1 ; 13 ; 15 ) , with a false alarm rate (FAR) of less than 0.25 per year. In particular, 3 of these BBHs are from the O1, 7 from O2, 52 from O3 and 75 from O4a ( 9 ; 12 ; 11 ; 6 ) . This dataset conservatively excludes GW231123_135430, as its extreme properties (high spins and mass) push waveform models beyond their well-calibrated regime ( 2 ) . We approximate the source property distributions for all events using 5000 posterior-estimate (PE) samples obtained with a single waveform model, consistent with the approach of ( 3 ) to minimize waveform systematics. For the O1–O3 events, we use the IMRPhenomXPHM model, while for O4a events we use its updated version, IMRPhenomXPHM_SpinTaylor . We use the PE samples publicly released by the LVK collaboration ( 42 ; 43 ; 45 ) . The injections used to account for selection effects are from the public O3–O4a set in 4 ; 44 , with O1–O2 search sensitivity estimate handled via a semi-analytic model ( 21 ) . We marginalize over spin parameters, as they are not included in this analysis. 3 Methods We use a hierarchical Bayesian framework ( 32 ; 47 ; 24 ) to infer cosmological and population parameters from GW data. The framework employs a hyper-likelihood that describes the probability of observing the data given an astrophysical population model. The latter includes the source-frame primary mass distribution, p(m_{1}) , whose features are exploited in the spectral siren approach to break the mass-redshift degeneracy. In this work, we consider two different functional forms of p(m_{1}) , a parametric and a semiparametric one. The parametric function is the Power Law + Double Peak ( pl2p ), consisting of a truncated power law summed with two Gaussian peaks and multiplied by a low-edge smoothing factor. We include this model both to compare it with the semiparametric one and to validate our code against LVK cosmological pipelines ( 33 ; 25 ) . The semiparametric model is built as ( 20 ) p(m_{1})\propto\mathcal{SP}(m_{1};\alpha,m_{\rm low},m_{\rm high},\delta_{m})\exp\left(s^{(d)}(m_{1};\boldsymbol{c},\boldsymbol{k})\right), (1) where \mathcal{SP}(m_{1};\alpha,m_{\rm low},m_{\rm high},\delta_{m}) is a power law truncated in the range [m_{\rm low},m_{\rm high}] , smoothed at the lower edge, and with spectral index -\alpha ( 3 , see Eqs. C25-C26 of) , and s^{(d)}(m_{1}) is a BSpline defined as s^{(d)}(m_{1};\boldsymbol{c},\boldsymbol{k})=\sum_{i=1}^{N_{\rm coeff}}c_{i}\cdot B_{d,i}(m_{1};\boldsymbol{k}) (2) Here, B_{d,i}(m_{1};\boldsymbol{k}) are the spline basis functions of degree d defined recursively from the knot sequence \boldsymbol{k}=\{k_{1},k_{2},\dots,k_{N_{\rm knots}}\} using the Cox-de Boor formula, and \{c_{i}\} are the spline coefficients that scale each basis function. These are the free parameters of the BSpline that flexibly control deviations from the underlying truncated power law. Knot positions are fundamental as they determine the total number of spline coefficients, N_{\rm coeff}=N_{\rm knots}+d-1 , and define the Greville abscissae as the averages of consecutive d+1 knots. The latter corresponds to the nodes in the m_{1} -space where p(m_{1}) can deviate from the baseline power law, according to the values of \{c_{i}\} . In this work, we consider cubic, d=3 , BSplines and we explore different knot configurations. In one configuration, knots are logarithmically spaced ( 20 , as in) across the whole m_{1} -interval that can be explored within the prior range considered (see Footnote 2 ). In the other configurations, spline-knot positions are determined with a novel data-driven procedure that captures the full complexity of the MD while avoiding an unnecessary increase in knot number. For a given value of H_{0} , we compute the mean observed source-frame primary mass distribution of all GW events (top panel of Figure 1 ). We then identify the knot positions for each specific H_{0} value as the points of highest variation in this distribution, corresponding to the peaks of the derivative of its logarithm (bottom panel of Figure 1 ). This procedure is repeated for various H_{0} values drawn from its prior, resulting in a collection of possible knots. The final set of knots is identified using a clustering algorithm, which fits the collection of knots with a series of Gaussian Mixture Models characterized by a different number of components. The optimal number of clusters is found by minimizing the Bayesian Information Criterion, which effectively penalizes model complexity to prevent overfitting. The final knot positions are the centers of the resulting clusters. Figure 1 : Mean observed source-frame primary MD for different H_{0} values (top) and its log-derivative (bottom) used to determine knot positions (dots) at different thresholds (dashed lines). Green points are knots for the pls-log-14 model. The number of knots is determined by the threshold used in the peak-finding algorithm. We examine four different thresholds, shown in Figure 1 , which produce four sets of knots: 10 ( pls-dd-10 ), 12 ( pls-dd-12 ), 14 ( pls-dd-14 ), and 16 ( pls-dd-16 ). For the logarithmically spaced configuration, we use 14 knots ( pls-log-14 ) for a direct comparison with the data-driven pls-dd-14 case. A Gaussian prior \mathcal{G}_{\mu,\sigma} with mean \mu=0 is imposed on each spline coefficient. For pls-dd-14 , we test several values of standard deviation \sigma : 0.5 , 1 , 2 , 3 , and 5 . In all other cases, \sigma is fixed to 2 , which yielded the best results in pls-dd-14 (see Section 4 ). To sample the likelihood implemented in CHIMERA , we use pocoMC ( 26 ; 27 ) , an adaptive Sequential Monte Carlo sampler that estimates the posterior distribution and the evidence of each model. Figure 2 : Median of the PPD of the primary mass and H_{0} posterior derived from GWTC-4.0 using different models. Top: Results for the 14 data-driven knots ( pls-dd-14 ) with varying prior widths ( \sigma ) on the spline coefficients. Bottom: the data-driven knot sets with different knot counts N (red curves), alongside the logarithmic case ( pls-log-14- \mathcal{G}_{2} ; green curve), all using \sigma=2 . 4 Results 4.1 Model comparison We quantitatively compare the results obtained with different models using the Bayes Factor (BF), computed relative to the pl2p baseline, and the Deviance Information Criterion (DIC). A BF ¿ 20 (150) indicates strong (very strong) evidence for a model over pl2p , while a \Delta\text{DIC} ¿ 6 (relative to the model with the lowest DIC) suggests a substantially worse fit ( 28 ; 38 ) . The results are summarized in Table 2 , where we also present posterior predictive checks for each model. According to the BF criterion, none of the PLS models are disfavored relative to pl2p . A narrow Gaussian prior ( \sigma=0.5 ) or fewer knots ( N=10,12 ) penalize the emergence of structures in the MD, and are basically equivalent to the pl2p (BF \lesssim 5.3 ). Stronger evidence emerges when spline coefficients are allowed to vary sufficiently ( \sigma\geq 2 ), with the best model being pls-dd-14- \mathcal{G}_{2} (BF = 226). A model with the same prior and number of knots, but logarithmically spaced, performs considerably worse (BF = 7.28). Adding more knots ( pls-dd-16- \mathcal{G}_{2} ) does not improve the evidence. The \Delta DIC criterion identifies the most flexible model ( pls-dd-14- \mathcal{G}_{5} ) as the best one, although all models with \sigma\geq 2 are similarly favored over pl2p . In accordance with the previous criterion, models with few knots, low \sigma , or logarithmic knot spacing knot, show large \Delta\text{DIC} values and are practically indistinguishable from pl2p . 4.2 Mass distribution constraints We plot the median of the predictive posterior distribution (PPD) for the primary mass for different models in the left panels of Figure 2 , with the corresponding error bars provided in Appendix B . For the pls-dd-14 model, when \sigma\geq 2 , three distinct peaks emerge at approximately 10 , 18 , and 33\,\mathrm{M}_{\odot} . These substructures, also reported by 5 and 46 (see Appendix B for a direct comparison), are not captured for \sigma<2 . We also note that the gap between the first and second peaks becomes more pronounced with increasing \sigma . In contrast, the pl2p model recovers only two broader peaks: around 9.9\,\mathrm{M}_{\odot} and 31.5\mathrm{M}_{\odot} ; the latter seems to smooth out the 18 and 33 \mathrm{M}_{\odot} peaks observed in the spline model. Increasing the number of knots reveals a small bump at \sim 60\mathrm{M}_{\odot} , consistent with findings by 37 , though its presence in our model is not fully evident. Conversely, using fewer knots or logarithmically spaced knots produces a fit essentially equivalent to the pl2p model, capturing only the two broader peaks as these models are not flexible enough to capture the structures of p(m_{1}) suggested by the data. 4.3 H_{0} constraints We find that models that capture substructures in p(m_{1}) generally lead to tighter constraints on H_{0} , as shown in the right panels of Figure 2 . The model pls-dd-14- \mathcal{G}_{2} , favored by the BF, yields H_{0}=57.8^{+21.9}_{-20.6}\,\mathrm{km/s/Mpc}, (3) an improvement of \sim 12\% over pl2p . The tightest constraint comes from pls-dd-14- \mathcal{G}_{5} , which is the model with the lowest DIC and that exhibits more pronounced features in p(m_{1}) . This model gives H_{0}=61.7^{+19.3}_{-14.9}\,\mathrm{km/s/Mpc}, (4) corresponding to a \sim 21\% improvement relative to pl2p . Conversely, when fewer knots are used or when they are spaced logarithmically across the full prior range, the constraints on H_{0} are much weaker, as not all the MD features are captured. Figure 3 : Spearman correlation coefficients between H_{0} and the parameters of p(m_{1}) (medians in black). To determine which features in the MD contribute most to constraining H_{0} , we compute Spearman correlation coefficients between H_{0} and the parameters describing p(m_{1}) , that are m_{\rm low} and m_{\rm high} (all models), Gaussian peak positions ( pl2p ), and the spline coefficients ( pls models). The results are shown in Figure 3 . In pl2p , the two peaks are slightly anticorrelated with H_{0} and determine the constraint on H_{0} . In pls-dd models with N\geq 12 , spline coefficients before each peak correlate with H_{0} , while those after anticorrelate. The net constraint on H_{0} comes from the combination of these opposing correlations. For pls-dd-10 and pls-log-14 , this pattern is less clear due to insufficient nodes near the peaks, thus proving the importance of placing knots around the relevant structure of the mass distribution. The strongest correlations with H_{0} come from spline coefficients near the first peak. However, in best-performing models, pls-dd-14 with \sigma=2 and 5 , the second and third peak also contribute, almost equally between each other, to constraining H_{0} . The presence of an additional substructure in the MD, together with the correlation-anticorrelation pattern of spline coefficients before and after each peak, can explain the better constraints on H_{0} . 5 Conclusions In this work, we derived constraints on cosmological and population parameters from a subset of GWTC-4.0 BBHs. We adopted a semiparametric mass model based on BSplines . We show that when the spline coefficients are given sufficient freedom, the model captures more substructures in the mass distribution than simpler parametric models. Using statistical tests, we confirm that capturing such substructures gives tighter constraints on H_{0} , yielding improvements of 12\% to 21\% for the models favored by BF and DIC. We also present a data-driven method to place spline knots efficiently around features in the observed mass distribution. This avoids the computational cost of adding dozens of knots and keeps the model dimensionality manageable. This method still depends on a few hand-tuned parameters, whose effect has been investigated in this work. A future extension of this work could include more optimized data-driven methods for defining spline knot positions. A natural next step is also to extend the BSpline method to the mass distribution of all compact binaries coalescences, not only of BBH. Overall, our work demonstrates the importance of accurately modeling all substructures in the mass distribution to increase the constraining power on cosmological parameters, a crucial step to exploit spectral sirens as a robust and precise cosmological probe. Acknowledgements. We acknowledge the ICSC for awarding this project access to the EuroHPC supercomputer LEONARDO, hosted by CINECA (Italy). This material is based upon work supported by NSF’s LIGO Laboratory which is a major facility fully funded by the National Science Foundation. MT acknowledges the funding from the European Union - NextGenerationEU, in the framework of the HPC project – “National Center for HPC, Big Data and Quantum Computing” (PNRR - M4C2 - I1.4 - CN00000013 – CUP J33C22001170001). MM acknowledges the financial contribution from the grant PRIN-MUR 2022 2022NY2ZRS 001 “Optimizing the extraction of cosmological information from Large Scale Structure analysis in view of the next large spectroscopic surveys” supported by NextGenerationEU. MM and NB acknowledge the financial contribution from the grant ASI n. 2024-10-HH.0 “Attività scientifiche per la missione Euclid – fase E”. Appendix A Priors and statistical significance of the results Figure 4 : Posterior predictive check for all the models tested in this work. In darker colors are shown the observed cumulative distribution of the BBH population, while in lighter colors the predicted one, given the considered models (reported at the top of each panel). Solid black lines are the medians of the predicted CDFs of m_{1} . In Footnote 2 we summarize the population and cosmological parameters, and the relative priors adopted in this work. Here, we used a new version of the CHIMERA pipeline, which we release along with this paper 1 1 1 The updated CHIMERA version is publicly available at https://github.com/cosmoStatGW/chimera . . In Table 2 we present the constraints on H_{0} , the BF, and the \Delta DIC for each model studied in this work. In Figure 4 we show the predictive posterior check (PPC) for each model that we explored. In particular, we plot both the predicted and observed cumulative distribution functions (CDF) of m_{1} for each model considered. Overall, all models produce an observed distribution that is compatible with the predicted one, thus proving that none of them is ruled out based only on the PPC. However, as discussed in the letter, the BG and \Delta DIC clearly show that simpler models are disfavored by data. Table 1 : 2 2 2 Notes. The symbol \mathcal{U}(\cdot) denotes a uniform prior distribution, while \mathcal{G} denotes a Gaussian distribution with mean \mu and standard deviation \sigma . Symbol Description Model Prior Cosmology (flat \Lambda CDM) H_{0} Hubble constant [km/s/Mpc] All \mathcal{U}(10.0,200.0) \Omega_{\rm m,0} Matter energy density All Fixed to 0.3065 Mass distributions \alpha Primary power law slope All \mathcal{U}(1.5,12) \beta Secondary power law slope All \mathcal{U}(-4,12) \delta_{m} Smoothing parameter [\mathrm{M}_{\odot}] All \mathcal{U}(0.001,10) m_{\rm low} Power laws upper limit [\mathrm{M}_{\odot}] All \mathcal{U}(2,10) m_{\rm high} Power laws upper limit [\mathrm{M}_{\odot}] All \mathcal{U}(50,200) \mu^{\rm low}_{g} Position of the first Gaussian peak [\mathrm{M}_{\odot}] pl2p \mathcal{U}(5,100) \sigma^{\rm low}_{g} Width of the first Gaussian peak [\mathrm{M}_{\odot}] pl2p \mathcal{U}(0.4,5) \mu^{\rm high}_{g} Position of the second Gaussian peak [\mathrm{M}_{\odot}] pl2p \mathcal{U}(5,100) \sigma^{\rm high}_{g} Width of the second Gaussian peak [\mathrm{M}_{\odot}] pl2p \mathcal{U}(0.4,10) \lambda^{\rm low}_{g} Mixing fraction of the first Gaussian peak pl2p \mathcal{U}(0,1) \lambda^{\rm high}_{g} Mixing fraction of the second Gaussian peak pl2p \mathcal{U}(0,1) c_{i} Spline coefficients pls \mathcal{G}(\mu=0,\sigma=0.5,1,2,3,5) Rate evolution (Madau-like) \gamma Slope at zz_{p} All \mathcal{U}(0,6) z_{\rm p} Peak redshift All \mathcal{U}(0,4) Table 2 : Median and 68\% confidence interval of H_{0} , BF, and \Delta DIC per model. Model H_{0}\,\mathrm{[km/s/Mpc]} Bayes factor \Delta DIC pl2p 72.6^{+42.7}_{-27.5} 1.0 20.1 pls-dd-14 - \mathcal{G}_{0.5} 54.6^{+36.5}_{-30.7} 2.59 18.2 pls-dd-14 - \mathcal{G}_{1} 55.4^{+28.0}_{-26.6} 81.8 9.42 pls-dd-14 - \mathcal{G}_{2} 57.8^{+21.9}_{-20.6} 226 2.65 pls-dd-14 - \mathcal{G}_{3} 59.4^{+19.2}_{-16.2} 134 0.26 pls-dd-14 - \mathcal{G}_{5} 61.7^{+19.3}_{-14.9} 24.1 0.00 pls-dd-10 - \mathcal{G}_{2} 102.1^{+51.2}_{-36.3} 5.27 13.4 pls-dd-12 - \mathcal{G}_{2} 56.8^{+32.5}_{-23.4} 60.8 7.93 pls-dd-16 - \mathcal{G}_{2} 52.0^{+26.2}_{-16.5} 114 5.41 pls-log-14 - \mathcal{G}_{2} 93.0^{+48.6}_{-30.8} 7.28 13.3 Appendix B Mass distribution results In Figure 5 we show the constraints on the PPD for the primary mass for each model considered in this work. In particular, we plot the median and 68% confidence interval of p(m_{1}) for each model. In the same figure, we also compare the model studied against results obtained with a different BSpline model by 5 . In this comparison, it is important to underline that 5 does not vary the cosmological parameters, but fixes them to some fiducial values, and uses a slightly different dataset with 16 more BBHs. Nevertheless, the comparison is extremely interesting, since we note that the peak at around 20 \mathrm{M}_{\odot} present in the BSpline model is also derived by the preferred pls models in our analysis. We conclude that using pls models with a sufficient number of knots and enough freedom in the spline coefficients leads to a more accurate reconstruction of the mass distribution. This, in turn, improves the inferred cosmological parameters, as the additional features enhance the constraining power of the spectral sirens approach. Figure 5 : Median and 68% confidence interval of the PPD for the primary mass for each model. We compare these results with those found using another weakly-parametrized approach by 5 (black dashed line).