Constraining the equation of state of dense matter requires matching models with data spanning from nuclear matter properties to neutron star radii. Manual tuning of multi-dimensional parameters is time-consuming. NNStar is an end-to-end AI agent that automates the entire pipeline: from constructing a relativistic mean-field model (from a Lagrangian) and solving field equations, to building the equation of state in β-equilibrium, matching it with the crust, integrating the Tolman–Oppenheimer–Volkoff equations, and evaluating results through Bayesian analysis of nuclear and astrophysical data. The agent is implemented as a portable 'skill' for an open-source LLM platform, combining symbolic and numerical physics engines. It autonomously reads the model, adjusts parameters, and outputs a full set of observables. NNStar creates a new paradigm of AI-driven analysis of nuclear matter and neutron stars.
Modern observations of neutron stars — from radio pulsars with masses around two solar masses (PSR J0740+6620) to gravitational-wave events and X-ray radius measurements with [instrument:NICER]NICER[/instrument] — provide unprecedented constraints on the equation of state of ultradense matter. Back in the 1930s, Fritz Zwicky predicted the existence of neutron stars, and the discovery of pulsars by Jocelyn Bell Burnell in 1967 confirmed their reality. However, theoretical models linking nuclear force properties to macroscopic stellar parameters require fine-tuning of many parameters. The traditional approach, where a physicist manually varies coupling constants and compares predictions with data, becomes extremely laborious. The emergence of large language models and autonomous scientific agents opens the way to automating this process.
The NNStar agent is implemented as a skill for an open-source LLM agent platform. It is not a hard-coded program but a documented specification linked to executable code that the LLM calls via tool calls. The physics backend consists of several layers: an analytical layer based on computer algebra automatically derives mean-field equations from a given Lagrangian; a numerical layer solves these equations for a given baryon density; a nuclear properties layer computes saturation parameters (binding energy, incompressibility, symmetry energy); and finally, the TOV layer builds the equation of state for β-equilibrium matter including the neutron star crust, integrates the equations following from Einstein's equations and the constancy of the speed of light (the Tolman–Oppenheimer–Volkoff equations), and outputs the mass-radius curve and tidal deformability. Statistical assessment is performed via Bayesian joint analysis, combining nuclear physics data and astrophysical observations, including gravitational waves from neutron star mergers (event GW170817, recorded by LIGO using interferometry).
When tested on classical Walecka-type models (TM1, NL3, FSU-δ6.7), the agent reproduced published saturation properties and mass-radius curves to within fractions of a percent, confirming the correctness of the entire computational chain. Discrepancies in incompressibility (~7%) are due to rounding of input parameters in cited works. The agent was then used to extend the model: a sextic scalar self-interaction (σ⁶) was added to TM1, and re-optimization was performed against the full set of constraints. As a result, the total χ² dropped from 25.5 to 7.2, and the model acquired more realistic values of incompressibility (231 MeV) and symmetry energy (30.1 MeV) while maintaining a maximum mass above two solar masses. Comparative testing of six modern LLMs showed that when using the skill, all models output deterministically accurate results, whereas without the skill their answers contained gross errors (e.g., negative incompressibility), highlighting the importance of grounding in verified physical tools.
The work demonstrates a paradigm shift in theoretical nuclear astrophysics: the labor-intensive process of direct modeling and parameter fitting is delegated to an AI agent, while the physicist focuses on problem formulation and result interpretation. This approach not only accelerates research but also makes it reproducible — anyone can download the skill, repeat the calculations, and modify the model. Moreover, the architecture separating the reasoning LLM from deterministic physical tools reduces the risk of hallucinations typical of purely language models. The equation of state of dense matter determines nucleosynthesis scenarios in neutron star mergers, so automating this analysis has interdisciplinary significance.
In the future, the skill may be extended to chiral effective models, enabling studies of QCD symmetries in dense matter. Plans include incorporating additional observables such as temperatures and transport coefficients, as well as describing exotic components — hyperons and quark matter in the cores of massive neutron stars. Improving benchmarks for LLM agents in scientific tasks will also be an important line of development.
The methodology will impact nuclear physics, compact object astrophysics, and gravitational-wave physics, and serve as an example for other fields requiring automation of multi-stage computational pipelines.
Next steps include expanding the skill's toolset and conducting large-scale benchmarking of various LLMs with a formalized quality metric.
The article is directly connected to the unsolved problem of the equation of state of cold dense matter, listed among fundamental questions in physics. The automated agent allows systematic exploration of parameter space and comparison of models with observational data, bringing us closer to answering the question of neutron star composition — whether their cores are hadronic, quark, or hybrid.
🎯 Interestingly, the agent can 'read' a scientific paper (in PDF format) and independently reconstruct the model described, computing all observable quantities — literally a machine capable of reproducing and verifying your work's results.
🎬 The idea of an AI steering scientific research echoes Ian Banks' 'Culture' concept, where sentient ships explore the Universe operating advanced physical models. NNStar is a modest step in that direction.