A method for predicting and estimating the primordial light element abundance
By constructing a neural network model integrating a multi-head attention mechanism and deep residual blocks, and combining it with the Markov chain Monte Carlo algorithm, the problem of low efficiency in traditional methods is solved, achieving efficient prediction and parameter estimation of the abundance of primordial light elements, improving computational efficiency and revealing the potential physical pathways of lithium abundance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG UNIV
- Filing Date
- 2026-04-30
- Publication Date
- 2026-06-02
AI Technical Summary
Traditional numerical methods are computationally expensive and inefficient in early universe research, making them difficult to integrate into modern data pipelines and unable to efficiently predict the abundance of primordial light elements.
We construct a deep network model that integrates a multi-head attention mechanism and deep residual blocks, combine it with the Markov chain Monte Carlo algorithm, and use the Cobaya Bayesian analysis framework for parameter estimation to achieve fast forward inference.
It achieves millisecond-level mapping from cosmological parameters to light element abundance, improving computational efficiency by three orders of magnitude. It can quantify the tension between lithium abundance observation data and reveal the potential physical path for rigid phase correction parameters to alleviate lithium problems.
Smart Images

Figure CN122133519A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically, to a method for predicting the abundance and estimating the parameters of primordial light elements. Background Technology
[0002] In early universe research, obtaining the abundance of primordial light elements primarily relied on solving highly nonlinear systems of second-order differential equations. Traditional numerical methods suffer from high computational overhead, low efficiency, and difficulty in integration into modern data pipelines when performing large-scale sampling analyses (such as Markov chain Monte Carlo simulations involving millions of calculations). To improve data processing efficiency while maintaining accuracy, a solution based on artificial intelligence technology is urgently needed. Summary of the Invention
[0003] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method for predicting the abundance and estimating the parameters of primary light elements.
[0004] To achieve the above objectives, the present invention adopts the following technical solution:
[0005] A method for predicting the abundance and estimating the parameters of primordial light elements includes the following steps:
[0006] Step S1: Set the sampling range of cosmological parameters and rigid phase correction factors, and use numerical calculation code to generate a structured dataset containing theoretical abundances of various light elements in batches.
[0007] Step S2: Construct a deep network model that integrates a multi-head attention mechanism and deep residual blocks, and establish a nonlinear mapping from the parameter space to the abundance space through supervised training.
[0008] Step S3: The trained model is encapsulated as a likelihood function interface and integrated into the Cobaya Bayesian analysis framework to perform forward inference using a computational kernel.
[0009] Step S4: Combining actual observation data constraints, the Markov chain Monte Carlo algorithm is used to automatically sample the parameter space and output the posterior probability density distribution of each physical parameter.
[0010] Furthermore, in step S1, the input parameters include baryon density parameter, effective neutrino species number, neutron lifetime, and rigid phase correction factor.
[0011] Furthermore, in step S1, the theoretical abundance of the generated light elements includes deuterium, helium-4, helium-3, and lithium-7.
[0012] Furthermore, in step S2, the model includes 8 parallel multi-head attention units and 8 layers of deep residual fully connected blocks, with a hidden layer dimension of 4096, and layer normalization and GELU activation function are used between layers.
[0013] Furthermore, in step S2, the forward computation logic of the model is as follows: the input vector is linearly transformed and activated by GELU to obtain initial features; then, the weighted interaction of the query, key, and value matrices is calculated through an attention mechanism, and the attention output is added to the initial features; wherein, the calculation formula of the attention mechanism is:
[0014]
[0015] In the formula, , , These represent the query matrix, key matrix, and value matrix, respectively. is the dimension of the key vector.
[0016] Furthermore, in step S2, the update rule for the depth residual block is: the current layer output equals the current layer input plus the result after linear transformation, GELU activation, and discarding.
[0017] Furthermore, in step S2, the rigid phase correction factor in the input parameters is preprocessed with a base-10 logarithmic transformation, and the output light element abundance is subjected to an inverse Box-Cox transformation or an inverse logarithmic transformation.
[0018] Furthermore, in step S3, a theoretical class inheriting from the Cobaya framework is defined to dynamically provide derived parameters and rigid phase correction factors, thereby enabling collaborative computation of multiple physics modules.
[0019] Furthermore, in step S4, the Gaussian likelihood function is used to assess the tension between the model's predicted abundance and the observed data, and its logarithmic form is:
[0020]
[0021] In the formula, Indicates different types of light elements; The theoretical abundance predicted by the model; To observe abundance; This represents the corresponding observation uncertainty; It is a constant.
[0022] The beneficial effects of this invention are:
[0023] This invention achieves millisecond-level mapping from cosmological parameters to light element abundances by constructing a neural network model integrating a multi-head attention mechanism and deep residual blocks. Combined with a Markov chain Monte Carlo sampling algorithm, it speeds up computation by more than three orders of magnitude compared to traditional numerical methods while maintaining physical accuracy. This method effectively solves the problem of low efficiency in solving high-dimensional rigid equations in primordial nucleosynthesis and can quantitatively analyze the tension between lithium abundance observation data, revealing the potential physical path for rigid phase correction parameters to alleviate lithium problems. Attached Figure Description
[0024] Figure 1 This is a flowchart of a method for predicting the abundance and estimating parameters of primary light elements in this embodiment;
[0025] Figure 2 This is a neural network topology diagram of the model in this embodiment;
[0026] Figure 3 This is a structural framework diagram of a single depth residual block in the model of this embodiment;
[0027] Figure 4 This is a statistical analysis chart of the prediction error of the model in the D / H output dimension in this embodiment;
[0028] Figure 5 This is a statistical analysis chart of the prediction error of the model in the Yp output dimension in this embodiment. Detailed Implementation
[0029] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0030] A method for predicting the abundance and estimating the parameters of primordial light elements is proposed. This method constructs a deep network model that integrates a multi-head attention mechanism and a deep residual block, encapsulates it into a likelihood function interface and integrates it into the Cobaya Bayesian analysis framework. The fast forward kernel is used in conjunction with the Markov chain Monte Carlo algorithm to perform large-scale parameter space sampling and output the posterior probability distribution of physical parameters.
[0031] Specifically, such as Figure 1 As shown, it includes the following steps:
[0032] Step S1, Construction of high-precision digital simulation dataset:
[0033] The sampling ranges for cosmological parameters and rigid phase correction factors are defined. Cosmological parameters include the baryon density parameter. Effective number of neutrino species neutron lifetime rigid phase correction factor Using numerical computation code (such as PArthENoPE), within a set parameter range, generate data containing deuterium (D) and helium-4 (H). 4 He, Helium-3 3 He) and Lithium-7 7 A structured dataset of the theoretical abundance of Li.
[0034] Step S2, Construction and training of the BBNet+ neural network model:
[0035] like Figure 2 and Figure 3 As shown, a deep network model integrating multi-head attention and deep residual blocks (ResMLPWithAttn) is constructed. This model contains 8 parallel multi-head attention units and 8 layers of deep residual fully connected blocks. The multi-head attention units are used to capture the physical correlation features between input parameters, and the deep residual fully connected blocks are stacked to fit higher-order nonlinear mappings. The hidden layer dimension is configured to 4096 dimensions, and layer normalization (LayerNorm) and GELU activation function are used between layers to prevent the gradient vanishing problem in deep network training. The specific calculation logic is as follows:
[0036] First, for the input parameter vector Perform a linear transformation and then activate using GELU to obtain the initial feature representation. :
[0037]
[0038] In the formula, and This represents the weight matrix and bias terms of the input layer.
[0039] Subsequently, the interaction weights among query, key, and value are calculated using a scaled dot product attention mechanism, and the attention output is then compared with the initial feature representation. Add them together to get the output of the attention layer. :
[0040]
[0041]
[0042] In the formula, , , These represent the query matrix, key matrix, and value matrix, respectively. is the dimension of the key vector.
[0043] The update rule for each depth residual block is: the current layer output equals the current layer input plus the result after linear transformation, GELU activation, and discarding. The expression is:
[0044]
[0045] In the formula, The input features are those of the l-th layer; The input features are those of the (l+1)th layer; The ratio was set to 0.3 to prevent overfitting; This represents a fully connected linear transformation.
[0046] stiff phase correction factor in input parameters Perform logarithmic preprocessing to base 10. The preprocessing formula is as follows:
[0047]
[0048] In the formula, This is one of the input features actually received by the neural network, representing the rigid phase correction factor after logarithmic compression and standardization. This preprocessing method helps improve the model's... Sensitivity to changes, thereby enhancing the ability to detect trace elements lithium hexaphosphate (LiH7). 7 The accuracy of Li abundance prediction.
[0049] Perform inverse Box-Cox or inverse logarithmic transformation on the output light element abundance to improve the model's performance for trace element lithium (LiH). 7 The prediction accuracy of Li).
[0050] A supervised learning approach is adopted, with mean squared error as the loss function. The network is trained using the dataset generated in step S1 until the relative prediction error of the model on the validation set meets the accuracy requirements (e.g., the relative error of the abundance of deuterium and helium-4 is less than 0.5%).
[0051] Step S3, Accelerated Integration of the Cobaya Analysis Pipeline:
[0052] The trained model is encapsulated as a Python likelihood function interface. This interface receives cosmological parameters and a rigid phase correction factor, and returns the corresponding predicted values of light element abundance. A derived parameter calculation module (e.g., through the SageNetTheoryFinal class) is defined within the Cobaya framework to map sampled parameters to derived physical quantities (such as neutrino species variation) in real time. With rigid phase correction factor The encapsulated likelihood function interface is integrated as a forward kernel into the Cobaya Bayesian analysis framework for rapid abundance prediction and likelihood calculation. After integration, the time for a single forward inference can be reduced to the millisecond level, supporting large-scale sampling. This integration scheme replaces the traditional numerical computation kernel to perform forward inference.
[0053] Step S4, Multidimensional Spatial Parameter Scanning and Estimation:
[0054] Define a Gaussian likelihood function to evaluate the tension between model-predicted abundance and actual observed data. The logarithmic form of this likelihood function is:
[0055]
[0056] In the formula, This indicates different types of light elements (including deuterium, helium-4, helium-3, and lithium-7); The theoretical abundance predicted by the model; To observe abundance; This represents the corresponding observation uncertainty; It is a constant.
[0057] Automated sampling in the parameter space is performed using Markov chain Monte Carlo algorithms (such as the Metropolis-Hastings sampler). During the sampling process, the fast likelihood interface integrated in step S3 is called to calculate the likelihood value at each step. Multiple Markov chains are run in parallel, and the Gelman-Rubin convergence criterion is monitored in real time. ,in To converge the diagnostic statistic, when Sampling stops when the value is less than 0.01. The final output includes the posterior probability density distribution and statistical constraints for all physical parameters.
[0058] Example 1: Model Construction and Hyperparameter Configuration
[0059] This embodiment uses the PyTorch framework to build the model. The model has an input dimension of 4, an output dimension of 4, and 8 hidden layers. Each layer consists of a linear layer, GELU activation, and residual connections. The number of hidden units is set to 4096, the number of attention heads is set to 8, and the dropout rate is set to 0.3.
[0060] The dataset was generated by the PArthENoPE numerical code within the following parameter range: baryon density parameter The range is 0.020~0.025, and the effective number of neutrino species is... The range is 2.0~4.0, neutron lifetime The range is 800~900 seconds, rigid phase correction factor The range is ~ .
[0061] The model was trained using the Adam optimizer with an initial learning rate of The weights are optimized by minimizing the mean squared error loss function. On the validation set, the relative error of the model in predicting the abundance of deuterium and helium-4 is less than 0.5%.
[0062] Example 2: Integration and Operation of the Cobaya Analysis Pipeline
[0063] This embodiment constructs a configuration dictionary using the `make_cobaya_info` function and introduces the encapsulated `bbnet_lithium_logp` function as an external likelihood interface. The sampling parameters include baryon density parameters. Hubble constant Correction factor for rigid phase Take the logarithm to the base 10 There are 10 physical dimensions. The pipeline uses the Metropolis-Hastings sampler and runs 4 Markov chains in parallel.
[0064] During operation, the pipeline is monitored in real time. Convergence criterion, when Sampling stops when the likelihood is less than 0.01. Single-step likelihood calculation time is less than 5 milliseconds, supporting fast scans of up to 1,000,000 steps.
[0065] Example 3: Pipeline Analysis Conclusions and Physical Findings
[0066] Through automated pipeline analysis using this method, this embodiment successfully reproduced the parameter constraint conclusions under the standard primordial nucleosynthesis (BBN) scenario. Furthermore, by comparing the abundance ratio (D / H) of deuterium to hydrogen and the mass abundance (Yp) of primordial helium-4 using only deuterium, this embodiment also demonstrates the effectiveness of this method in replicating the results of primordial nucleosynthesis (BBN) using only deuterium to hydrogen, and the results of primordial helium-4 containing lithium-7 (BHN). 7 Li) Two likelihood configurations were used to analyze the tension between the observed data using pipeline quantification and to reveal the rigid phase correction parameters. Potential physical pathways to alleviate the lithium-7 problem.
[0067] like Figure 4 As shown in the figure, the statistical analysis of the prediction error of D / H (deuterium-hydrogen abundance ratio) by this method displays the distribution of the relative percentage error between the predicted and observed values. The frequency is concentrated near zero error, indicating that the model has a high-precision prediction capability for D / H. Figure 5 As shown in the figure, the statistical analysis of the prediction error for Yp (primordial helium-4 mass abundance) also shows good error concentration, verifying the accuracy and stability of the model in multiple light element abundance output dimensions.
[0068] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A method for predicting the abundance and estimating the parameters of primordial light elements, characterized in that, Includes the following steps: Step S1: Set the sampling range of cosmological parameters and rigid phase correction factors, and use numerical calculation code to generate a structured dataset containing theoretical abundances of various light elements in batches. Step S2: Construct a deep network model that integrates a multi-head attention mechanism and deep residual blocks, and establish a nonlinear mapping from the parameter space to the abundance space through supervised training. Step S3: The trained model is encapsulated as a likelihood function interface and integrated into the Cobaya Bayesian analysis framework to perform forward inference using a computational kernel. Step S4: Combining actual observation data constraints, the Markov chain Monte Carlo algorithm is used to automatically sample the parameter space and output the posterior probability density distribution of each physical parameter.
2. The method for predicting the abundance and estimating parameters of primary light elements according to claim 1, characterized in that, In step S1, the input parameters include baryon density parameter, effective neutrino species number, neutron lifetime, and rigid phase correction factor.
3. The method for predicting the abundance and estimating parameters of primary light elements according to claim 1, characterized in that, In step S1, the theoretical abundance of the generated light elements includes deuterium, helium-4, helium-3, and lithium-7.
4. The method for predicting the abundance and estimating the parameters of primordial light elements according to claim 1, characterized in that, In step S2, the model includes 8 parallel multi-head attention units and 8 layers of deep residual fully connected blocks. The hidden layer dimension is 4096, and layer normalization and GELU activation function are used between layers.
5. The method for predicting the abundance and estimating parameters of primordial light elements according to claim 4, characterized in that, In step S2, the forward computation logic of the model is as follows: the input vector is linearly transformed and activated by GELU to obtain initial features; then, the weighted interaction of the query, key, and value matrices is calculated through an attention mechanism, and the attention output is added to the initial features; wherein, the calculation formula of the attention mechanism is: In the formula, , , These represent the query matrix, key matrix, and value matrix, respectively. is the dimension of the key vector.
6. The method for predicting the abundance and estimating parameters of primordial light elements according to claim 4, characterized in that, In step S2, the update rule for the depth residual block is: the current layer output equals the current layer input plus the result after linear transformation, GELU activation and discarding.
7. The method for predicting the abundance and estimating the parameters of primary light elements according to claim 1, characterized in that, Step S2 further includes performing a base-10 logarithmic preprocessing on the rigid phase correction factor in the input parameters, and performing an inverse Box-Cox transformation or an inverse logarithmic transformation on the output light element abundance.
8. The method for predicting the abundance and estimating the parameters of primary light elements according to claim 1, characterized in that, In step S3, a theoretical class inheriting from the Cobaya framework is defined to dynamically provide derived parameters and rigid phase correction factors, thereby enabling collaborative computation of multiple physics modules.
9. The method for predicting the abundance and estimating the parameters of primordial light elements according to claim 1, characterized in that, In step S4, the Gaussian likelihood function is used to evaluate the tension between the model's predicted abundance and the observed data, and its logarithmic form is: In the formula, Indicates different types of light elements; The theoretical abundance predicted by the model; To observe abundance; This represents the corresponding observation uncertainty; It is a constant.