Cosmology with AI
A research book can pass on more than a set of ideas to the next generation. It is able to leave problems with defined inputs, scope, control answers, and clear failure conditions. Then the scientist working with the artificial intelligence starts with a testable foundation. He can change the assumption, see which conclusion disappears, and decide what calculation or measurement really needs to be done next. Such a foundation allows you to accumulate results without turning each new attempt into a repetition of all previous work.
In this chapter we take a first limited step. For the redshift drift, a discriminability map of two given cosmological models was made. For early disturbances and dark matter, the following problems have been formulated, but have not yet been brought to the analysis of observations. The artificial intelligence was not trained on these tasks within the scope of the book; assessments of the accuracy of neural networks and claims about the discovery of new physics are absent here. A research design is proposed in which each subsequent improvement can be compared with an open benchmark calculation.
Three different roles of artificial intelligence
The first role is that of a research assistant. The system searches for the required definition, suggests a transformation of the equation, writes a program, lists possible degeneracies and selects a counterexample. The useful result of this work should exist separately from the dialogue: in the form of output, code, a table, or a document indicating the underlying assumptions. If the text seems convincing, but the calculation cannot be reconstructed from it, it has not yet become a scientific result. The speed of preparation of such a text does not say anything about the correctness of the physical model.
A simple check procedure is needed here. First, the question and acceptable approximations are fixed. Dimensions, signs, limiting cases, and conservation of general parameters are then independently checked. The program is then compared with the answer obtained by another method. AI can suggest all these actions, but the test should not consist of asking the same system again whether it agrees with its own answer. A more reliable computable commitment: when a new interaction is turned off, the known limit must be restored with a given numerical accuracy.
The second role is the emulator. The full numerical solver receives the physical parameters and calculates the observed quantity; the emulator learns to quickly approximate this display. Its input can be the component densities and parameters of the initial spectrum, and the output can be a set of power spectra. Acceleration is especially useful when the same type of calculation needs to be repeated many times. However, a new theory, a new parameter range, or a different instrument model may move the problem beyond the training set. agreement within the former area does not automatically transfer there.
The third role is solving the inverse problem of simulations, simulation-based inference, or SBI. The simulator creates possible observations given the given parameters; the trained model approximates the connections between parameters and data necessary for inference. It can estimate the posterior distribution, likelihood function, or likelihood ratio when direct calculation of the desired value is difficult. This family of methods is associated with a specific data generator and a set of assumptions. An overview by its developers explains which inverse problems open up this possibility. [159]
Confusing these roles creates false expectations. Well-written code does not yet test the emulator; an accurate emulator does not yet check the physics of the original solver; A careful restoration of the parameters of the artificial Universe does not yet show that the real Universe is structured the same way. In our problem set these levels are separated. For each, the required inputs, the controlled error and the result, which can be considered completion of the work, are indicated. This allows the use of different AI systems without changing the meaning of the research task itself.
Speed up calculations and preserve physics
A practical example of emulation is given by CosmoPower. The paper on the complete cosmological emulation and inference process discusses the preparation, packaging, and testing of approximate solvers for specific models and parameter ranges. A useful principle for our book here is that along with a fast predictor, information about what it approximates and where it has been tested should be shared. Using a ready-made emulator does not mean that an arbitrary new scalar field is already included in its training. Such an extension will require new reference calculations and separate verification. [160]
The control we propose begins with a selected sample of points that the training did not see. On it, you need to measure the error in the predicted observations, and then check how much this error shifts the conclusion about the physical parameters. A rare large error near the boundary of the allowed region may be more significant than a small average error over the entire volume. Therefore, the distribution of errors and specific cases of failure should be published. If the emulation accuracy is insufficient, the disputed point must be recalculated by the original solver and the difference must be stored in the verification log.
Another useful example is the CAMELS project, in which simulations relate changes in cosmological parameters to changes in astrophysical prescriptions. The original work compares hydrodynamic realizations with different descriptions of the processes of galaxy formation and evolution. This shows the practical possibility of studying the dependence of the output on cosmology and astrophysics simultaneously. For the program proposed here, such sets serve as a model for organizing an experiment. We did not train the algorithm on CAMELS and did not obtain new restrictions on dark matter from this project. [161]
In future work, some of the implementations should remain entirely outside the scope of training. It is important to separate samples not only by random initial numbers, but also by physical requirements, if it is the resistance to them that is being tested. An algorithm that works successfully with new implementations of the previous simulator may make errors after changing feedback from stars or active cores. This transfer should be checked separately. However, several consonant simulators do not cover all possible errors: they may use the same approximation, which is not present in nature.
Engraving 29. Fast calculation and accurate standard. Two conventional images of the structure are compared as a reference calculation and its fast approximation. The highlighted area reminds you to check for local errors, including rare cases of failure. The engraving does not represent the results of AI training in the book: it explains the future procedure for comparing the emulator with the original computer.
Why proper calibration is not enough
Bayesian inference connects the selected model, data, and prior information. If the physical parameters are denoted by θ and the observation by x, then its usual notation is:
The M symbol is significant here. It includes a physical description, an observation generator, and error conventions. Even a perfect calculation of the right-hand side remains conditional with respect to M. For a new cosmological hypothesis, it is necessary to separately study the computational accuracy of the method and the sufficiency of the model itself. Otherwise, a narrow parameter interval may express confidence within an overly restricted family of artificial worlds. The suspicion of such an effect is verified by expanding the setup and independent observations, and not just by increasing the training sample.
Simulation-based calibration, SBC, proposes to control the algorithm on parameters and data generated from a declared joint distribution. It is checked whether the position of the parameter that generated the data among the posterior samples is consistent with the expected rank distribution. The method is useful for finding computational errors. But successful calibration against a given simulator does not establish the physical truth of that simulator and does not guarantee good behavior in every small parameter range. It is the boundaries of this conclusion that should accompany the result of the test. [162]
The work of Alokda, Porciani and Eggemeier on the derivation of primary non-Gaussianity examines a specific example where average coverage testing alone is not sufficient. The authors compare the neural network method with explicit likelihood inference and consider the behavior of distributions for fixed parameters. In the cases studied, combining the power spectrum and bispectrum could produce wider neural network distributions than the explicit likelihood inference used, although the usual average test did not reveal the problem. This is the result of a certain comparison of methods; it is not evidence of the overall failure of SBI, nor does it constitute a test of transfer between different simulators. [163]
For our purposes, this implies a specific requirement for the future protocol. It is necessary to separately check the recovery of parameters in different areas, sensitivity to the boundaries of the prior distribution, and behavior when combining statistics. Predictive tests should also be performed on features that were not used during training. Finally, testing on a different error model or a different physical generator is required. Such a test examines resistance to a declared nonconformity; even its success leaves the possibility of an unknown common error among all selected generators.
Map of distinguishability of two worlds
Before training a complex system, it is useful to solve a simpler problem: is there a difference in the selected observations that cannot be absorbed by parameter tuning? In the chapter on dark energy, an example of a scalar field with a brief deviation of the equation of state from the cosmological constant is constructed. Its drift prediction without added noise is now compared with the ΛCDM family of models. Eight points are located at z = 0.25; 0.5; 0.75; 1; 1.5; 2; 2.5 and 3. This is a fictitious grid and not a list of actual spectroscopic targets.
In the competing model, H0, the fraction of matter Ωm0, and the total additional shift B vary freely. The parameter B represents the unknown constant component of the velocity displacement. In addition to the independent error of each point, one correlated mode is introduced, depending on the redshift. Its shape and amplitude are announced in advance. Therefore, you can reproduce the result and then see how much it changes with a different covariate. The assumption of correlations is part of the problem, not a hidden setup of the calculation.
The independent error σ refers to the accumulated velocity shift and is the same for all eight points. A correlated mode describes a random amplitude with zero mean and a Gaussian distribution. Its effect is already included in C. Free B acts equally on all points; it differs from the centered non-uniform mode u. The covariance is considered known and does not change when selecting cosmological parameters. A real instrument will require a more complex description, which must be derived from the characteristics of the spectra and control of the stability of the measurements.
Let y be the vector of shifts without the added noise of the scalar model, and fΛ the prediction of the model with the cosmological constant. For each combination of accuracies, the minimum squared discrepancy is calculated. Additionally, you can specify a conditional independent external Gaussian constraint H0 with center 70 km/s/Mpc and width sH:
Without an external constraint, the last term is missing. This formula uses a well-known profiling method, and the novelty of the exercise lies in the specific formulation and calculated results. Q shows how much dissimilarity remains after adjustment. It is not a sigma number, probability of detection, or expected information gain. For such conclusions, another calculation is needed: random data from both models, a predetermined decision rule and a check of the frequency of its errors. Here only the deterministic stage is performed.
For twenty years at σ = 1 cm/s, Q = 0.316615 was obtained. The fitted Λ-model selects H0 around 55.66 km/s/Mpc, Ωm0 around 0.3232 and B around 0.2403 cm/s. These numbers are not estimates of the parameters of the real Universe. They show how, by changing the allowed parameters, the alternative model approximates the selected curve. The conditional limitation H0 = 70 ± 1 km/s/Mpc increases the minimum to Q = 1.565071: the previous compensation becomes too expensive for the accepted functionality.
The result of joint verification is especially useful. If we separately limit B to the value 0 ± 0.1 cm/s, we only get Q = 0.331525. If we add the same constraint to the external H0, we get Q = 3.420077. This means that the effect of calibration depends on what other freedom of adjustment has already been eliminated. In this problem, two constraints complement each other. This behavior cannot be inferred from a list of precisions in isolation; it has to be calculated for the joint model and the general error system.
Figure 9. Profiled divergence map Q: two observation durations, nine independent σ errors, seven external constraint options H0. The correlated amplitude τ = 0.5 cm/s is fixed; "no" means no external limit H0. When moving from 20 to 40 years, the errors in the accumulated velocity shift are preserved. This is a conditional map, not a forecast of the device; Q is not statistically significant. Full values and assumptions are available in the computational appendix.
A total of 126 combinations are calculated, and additional comparisons also include the conditional constraint Ωm0 = 0.3 ± 0.01. When moving from twenty to forty years, the covariance of the velocity shift is artificially preserved. Without external restrictions, Q therefore increases exactly fourfold: the signal and the optimal B double, the quadratic measure increases fourfold. This is a useful check of the program. The actual benefit of long-term observation may differ due to instrument aging, sampling changes, error correlations, and costs of repeat spectroscopy.
With σ = 0.2 cm/s, a twenty-year calculation without external restrictions gives Q = 7.795838, and with the specified limitation H0 - 26.349304. The numbers are useful as a control of playback and an indication of the production's sensitivity to accuracy. They do not determine the required accuracy of the future telescope. To do this, we need to include spectral lines, accessible objects, the sources' own accelerations, the calibration procedure, and the likelihood of obtaining different results. The real outer measurement of H0 may also depend on cosmology and share systematic errors with the underlying data.
How to choose the next experiment
The discrepancy map helps to find directions, but does not select the optimal experiment. It considers one given scalar prediction and does not average over unknown parameters, candidate data, or observation costs. The next step is to identify a variety of feasible plans: for example, improving instrument stability, expanding the redshift range, or independently constraining a parameter. For each plan, errors, resources, and acceptable physical models must be described in the same way. Otherwise, the comparison will be reduced to the advantage of arbitrarily chosen assumptions.
One well-known way of making this choice is through expected information gain. If the goal is to distinguish between models, the utility of a design can be defined as the average change in the probability distribution of their index after an eventual measurement. Bayesian planning requires prior model probabilities, parameter distributions, and predictive distributions of the data. Methods for approximate calculation of such utility are explored, in particular, by Foster et al. In our code this value is not calculated; the calculated map Q does not replace it. [164]
Three tasks for an open continuation
The first task already has a working narrow standard: to reproduce the drift map and its control values. Its next level is the same analysis of noise implementations for each competing model. The accelerator can then be trained, compared to the direct calculation, and tested for transfer to new covariances. The physical layer will require realistic spectra and accessible objects. An AI system is considered useful if it reduces computational costs with a pre-declared acceptable error or finds a specific previously missed degeneracy that can be confirmed by an independent calculation.
The second challenge concerns early features. It is necessary to select a completely defined pair of mechanisms and find the region where their power spectra are close after an acceptable adjustment. Bispectra and observed polarization consequences are then calculated from the same parameters. You cannot allow each statistic to have its own independent form of singularity: then the test of single origin disappears. In an open set this is still a specification. We need a correct generator of primary disturbances, transfer to observable quantities and general covariance; The book does not contain such a full-fledged analysis.
The third problem connects populations of objects with the general microphysics of dark matter. For the chosen law of self-scattering, it is necessary to simultaneously predict the properties of ensembles of galaxies and clumps detected by gravitational lenses. The comparison must take into account the distribution of formation histories and astrophysical feedback. Part of the population is left for independent testing, and the interaction parameters are kept common. This task is also written as a specification. It cannot be turned into a constraint on the scattering cross section until a proven generator, selection model, and suitable observations are obtained.
Checking Mathematical Sense
Another possible AI assistance is to translate individual statements into a form that can be verified by a proof system. The HepLean project shows examples of formalizing the definitions and derivations of high energy physics in Lean. FormalScience's work examines automated formalization with human participation and specifically focuses on preserving the meaning of the original task. For a book, a reasonable first step is limited: formally verify the chosen algebraic lemma or corollary of the stated assumptions. A complete formalization of cosmological models has not been completed here. [165] [166]
Even a successful formal test operates within the written definitions. If during translation the condition of positive energy has disappeared or the meaning of the observed quantity has changed, the proof may be logically correct and physically inapplicable. Therefore, along with the formal statement, it is necessary to store the original record, the correspondence of notations and the scope of applicability. Numerical verification of limiting cases and formal proof have different objectives. Numerical checks were performed in the drift calculation; to call them a machine proof of the entire physical structure would be incorrect.
How to check it
The test begins with reproducing the standard. An independent researcher runs the published code, obtains the Q table, and compares it to the benchmark numbers. Then it checks the profile with another optimizer, turns off the correlated mode and restores the previous independent case. For our implementation, such a comparison has been made: at four control points the difference in minimums is less than 3 × 10−13. An exact quadruple change in Q without external constraints when doubling the interval tests the adopted scaling model. These results refer to calculation, not to nature's confirmation of a scalar hypothesis.
The next level requires pre-announced tests on artificial data. A rule for distinguishing models must be defined, observations must be generated from both sides of the comparison, and the rates of mis-selection and omission of differences must be measured. For trained methods, accuracy relative to the direct solver, behavior in different parameter ranges, and results under modified physical prescriptions are separately checked. The training, validation, and final test sets must have fixed boundaries; learning the last set to tweak the method turns it into another part of the training.
Engraving 30. Checking on deferred data. Separate sets of conventional cosmological maps represent training, intermediate testing and final testing. The last set remains closed to configure the method. This is an image of a research discipline, and not a ready-made protocol for dividing a real catalog: common calibrations and physical dependencies of data require separate consideration, even when the sheets are depicted separately.
At the physical level, a measurement with a verifiable instrument model and independent control of significant uncertainties is required. For drift, this means a stable spectroscopic scale and a description of the sources; for early features - joint analysis of statistics with transfer and foregrounds; for dark matter - accounting for populations and selection. The next researcher can start at any level, but must name it. A scientific contribution occurs where a new test is performed, a persisting difference is discovered, or a limitation is proven that the previous formulation had hidden.



![Q_* =\min_{H_0,\Omega_{m0},B}\left[\big(\mathbf y-\mathbf f_\Lambda-B\mathbf1\big)^{\mathsf T}C^{-1}\big(\mathbf y-\mathbf f_\Lambda-B\mathbf1\big)+\frac{(H_0-70)^2}{s_H^2}\right]](/assets/figures/82ebe2db242be8de1154a120.webp)

