CosmoAgent Makes LLMs Search Modified Gravity Like a Pro

CosmoAgent turns dark-energy and modified-gravity model discovery into a physics-constrained search: LLMs propose covariant Lagrangians, a pipeline derives equations, fits DES/DESI data, and ranks by AIC. All 8 benchmark LLMs found better nominal AIC than flat ΛCDM—ΔAIC down to −3.328—without claiming observational preference.
The finding CosmoAgent’s LLM-powered search produced candidate models with improved nominal AIC versus flat ΛCDM, with a best ΔAIC of −3.328.
The method It constrains LLM outputs to covariant Lagrangians, then derives equations of motion, solves background dynamics, and scores against DES 5-year SNe Ia and DESI DR2 BAO.
The caveat Despite better AIC nominal fits, the modest improvements don’t establish observational preference for these alternatives over flat ΛCDM.
1st MONTH FREE Basic or Pro • code FREE
Claim Offer

The Short Answer

CosmoAgent uses LLM agents to propose covariant Lagrangians for dark-energy and modified-gravity theories, then validates them with a deterministic physics pipeline and DES/DESI data—finding better nominal AIC than flat ΛCDM (best ΔAIC = −3.328).

So what: instead of “guessing” phenomenological fits, this workflow searches theory structure first, then filters candidates with physics checks before likelihood ranking, making it useful as an early sieve for model selection.

Caveat: the AIC improvements are not strong enough to claim an observational preference over flat ΛCDM, so the results are an initial ranking step rather than a definitive detection.

CosmoAgent Makes LLMs Search Modified Gravity Like a Pro

Dark energy and modified gravity are still “open mystery” territory: we know the universe’s expansion is accelerating late-time, but we don’t know whether that’s because of something like a cosmological constant, a dynamical field, or a tweak to gravity itself. A new research effort—CosmoAgent: AI Agent for Theoretical Cosmology (Stephon Alexander, Loukas Gouskos, Savvas M. Koushiappas, Cooper Niu, Wenrong Sun)—tries to turn this uncertainty into a systematic search problem by using LLM-powered agents to propose candidate theories and then validate them with deterministic physics and real data.

What’s especially interesting is how the system is built. Instead of asking an AI to “guess” a model fit to curves, CosmoAgent searches in a space of covariant Lagrangians (i.e., candidate actions from which equations of motion can be derived). The pipeline then computes the background cosmological evolution, compares it to observations using DES 5-year Type Ia supernovae and DESI DR2 BAO, and ranks candidates using Akaike Information Criterion (AIC) to balance fit quality against model complexity. The paper benchmarks 8 LLMs (across frontier models like ChatGPT, Claude, Gemini, Qwen, DeepSeek, and Kimi) and finds that all of them can produce candidates with better nominal AIC than flat ΛCDM—with a best improvement of ΔAIC = −3.328—even though those AIC gains aren’t strong enough to claim an observational preference.

In other words: CosmoAgent is a serious proof-of-concept for agentic “theory discovery” in cosmology, where the AI’s creativity is constrained by physics checks and actual likelihood evaluation. That’s a big deal for how we might use AI to explore vast theoretical spaces without losing control of scientific reliability.

Why This Matters: Agentic AI Meets the Reality of Physics Filters

This is significant right now because cosmology is entering a phase where data quality keeps improving, but the theory space keeps exploding. Manually scanning modified-gravity and dark-energy models is slow, and “blind” fitting of parametric forms can miss the structural reasons a theory is viable (or not). What CosmoAgent does is change the workflow: the AI proposes theory structures, and the deterministic pipeline enforces “physics common sense” through derived equations of motion, derivative-order constraints, and background evolution checks before any likelihood ranking happens.

A concrete “today” scenario: imagine a physics group with limited manpower trying to prioritize which models deserve the expensive next steps (perturbation stability, gravitational-wave propagation constraints, Solar System tests, etc.). CosmoAgent already provides a pathway to generate lots of background-valid candidates and rank them. Even if background-only results can’t “close the case,” they’re extremely useful as an early filtering layer—like using a sieve that catches the obviously broken theories before you spend weeks on the survivors.

How does this compare to previous AI-for-physics efforts? Earlier work using AI in theory discovery often focused on function fitting (searching equations of state, reconstruction of expansion histories, symbolic regression, etc.). CosmoAgent’s key novelty is that candidates are actions (Lagrangians), not just phenomenological curves. That means the system’s outputs are closer to what theorists actually need: objects you can analyze for stability, equivalences, and parameter regimes. The paper positions this as a shift toward AI discovering models that are validated structurally, not only statistically—while also explicitly addressing the classic “LLM hallucination” risk by wrapping the agent in a deterministic workflow harness built with LangGraph.

How CosmoAgent Searches Theory Space Without Wandering Off a Cliff

CosmoAgent’s core idea is simple to say but hard to execute: let an LLM guide which modified-gravity Lagrangians to test next, but don’t trust it to do the physics. The physics happens in a deterministic pipeline.

A grammar of covariant Lagrangians (so the AI can’t write random nonsense)

The search space is organized using an effective-field-theory style approach, sorting operators by mass dimension up to a truncation level (the paper focuses on covariant operators through mass-dimension six). CosmoAgent stores each proposal as a Lagrangian density with three disjoint operator sectors:

  • pure-curvature operators,
  • nonminimal scalar–curvature operators,
  • generated pure-scalar operators,

plus a scalar sector that can represent either:
- quadratic (“canonical”) quintessence potentials, or
- axion-like / periodic potentials (pseudo-Nambu–Goldstone-boson style).

Crucially, there’s a covariant grammar that restricts what “legal” proposals look like. After algebraic index symmetries and redundancy removal on a flat FLRW background, the implemented operator dictionary contains 141 operators. The paper is careful not to claim this is a complete basis—it’s a deliberately finite grammar-generated space to explore.

Mini-superspace reduction + physical filtering before any likelihood

Once a candidate Lagrangian is proposed, CosmoAgent doesn’t immediately compare it to data. It first reduces the theory onto a spatially flat FLRW background, derives the minisuperspace equations of motion, and applies filters designed to prevent obvious pathologies.

One of the most important filters is about derivative order. Higher-curvature and certain scalar–curvature operators can introduce third- or higher-time derivatives in the FLRW equations. That can lead to Ostrogradsky ghosts in non-degenerate theories. The pipeline applies a background derivative-order filter, enforcing coefficient relations so that retained FLRW dynamics are at most second order. About two-thirds of grammar-legal proposals are rejected by these background and numerical checks in their pipeline.

Also: the system explicitly checks constraint structure through the lapse equation (the Hamiltonian constraint role), ensuring constraint propagation works consistently after gauge fixing. This helps avoid numerical traps where the system seems solvable but violates the underlying constraint logic.

Observable predictions: DES supernovae + DESI BAO under the same background solution

After a candidate passes the physical checks, CosmoAgent computes late-time observables from the candidate’s background expansion:

  • Supernova distances: it computes the supernova distance modulus and uses the DES 5-year Type Ia supernova sample, with the DES-Dovekie recalibration (1820 objects).
  • BAO distances: it computes BAO distance combinations to compare with DESI DR2 BAO (13 data entries).

An important nuance: in this analysis, the BAO comparison treats the BAO scale as a nuisance parameter, so this is best thought of as a relative-distance test of late-time expansion rather than a full early-universe recalculation of the sound horizon for each model.

Ranking: AIC beats “fit-only thinking,” but doesn’t settle the story alone

CosmoAgent ranks candidates using the Akaike Information Criterion (AIC), which penalizes model complexity (nominal parameter count) while rewarding likelihood improvement. The paper also computes BIC as a complementary check.

For context, the paper reports a flat-ΛCDM reference value of χ^2_{ΛCDM} = 1645.28 and uses the nominal parameter count k = 3 for AIC. The qualitative takeaway they emphasize is: even if a candidate gets a lower AIC than ΛCDM, that alone is not an observational win—especially given finite search budgets and search-induced chance improvements.

What the Benchmark Shows: 8 LLM Agents Can Beat ΛCDM’s Nominal AIC (But Not Cleanly Win)

The paper benchmarks 8 frontier LLMs as candidate selectors under the same grammar and the same deterministic physics + likelihood pipeline. Each run uses the same search protocol, operator grammar, and parameter sampling schedule.

Benchmark setup: what “fair comparison” means here

The benchmark includes LLMs from several vendors/models, evaluated with:

  • 8 LLM runs
  • 1000 completed initial theory proposals per LLM run
  • each initial theory (parent) is paired with parameter samples
  • accepted structures get additional scans if they already look promising

The authors also stress that each LLM run maintains its own search history and proposal priors, so the runs are operationally comparable rather than “blindly identical.”

Results at a glance: every LLM finds AIC-improved candidates

All eight LLM-guided searches report at least one candidate with nominal AIC better than flat ΛCDM, with best improvement:

  • best ΔAIC improvement: ΔAIC = −3.328
  • best nominal AIC case: Kimi K3 run (lowest recorded nominal AIC)

They also find:

  • Seven agents recover a quadratic-quintessence basin, with minimum-AIC solutions that are very close in AIC values (spread of about 0.065 in their reported minima across the seven).
  • There is an exception: Claude Sonnet 5 selects an axion-like potential in its minimum-AIC solution under the original nominal parameter count.

AIC vs BIC: the plot twist is that BIC likes ΛCDM

Across the minimum-AIC representatives, the paper reports a consistent pattern:

  • AIC modestly favors certain modified gravity / dark energy models in nominal terms.
  • BIC favors flat ΛCDM for all reported minimum-AIC representatives.

That doesn’t mean the models are “ruled out.” It means that—under the fixed likelihood and nominal parameter count assumptions used—the complexity penalty and evidence accounting don’t support a strong departure from ΛCDM.

Here’s the core comparison logic the paper uses, phrased as a table:

Criterion What it rewards What it penalizes What it implies in this paper
AIC improved data fit nominal parameter count All 8 LLM searches find candidates with lower nominal AIC than flat ΛCDM; best ΔAIC = −3.328
BIC improved data fit (with a stronger complexity penalty) nominal parameter count + stronger scaling BIC favors flat ΛCDM for the reported minimum-AIC representatives

The null-model check: could the search procedure “manufacture” AIC wins?

This is where scientific caution shows up. The authors run a diagnostic applying the search to one mock dataset generated from flat ΛCDM:

  • They generate a synthetic data vector using Ωm0 = 0.306, with profiled SN and BAO nuisance choices, and preserve full covariance blocks.
  • Then they refit and run the CosmoAgent pipeline on 250 parent proposals (with an empty search memory for that mock).

Their result: after search, the best AIC still remains above the refitted mock ΛCDM reference. They report the lowest candidate on mock data has AIC not improving as ΔAICmock < 0—in fact they state the lowest mock result is above the refitted reference (no AIC-improvement recorded in that run).

A single mock realization can’t fully calibrate the global “look-elsewhere” effect, but it does support the idea that the observed-data minima aren’t guaranteed artifacts of the search.

What Models Actually Pop Out: Quintessence Dominates, Then Weird Stuff Appears (and Needs More Checks)

A key point of CosmoAgent is that the LLM isn’t just fitting parameters; it keeps generating action structures. What happens when you look at representative survivors?

The “familiar” winners: quadratic quintessence keeps reappearing

For the minimum-AIC representatives from seven of eight runs, CosmoAgent reduces them (after applying the derivative-order constraints) into essentially the same canonical family:

  • general relativity plus a single canonical scalar (quintessence) with a quadratic potential

The paper highlights the recovered solution K301 from the Kimi K3 run:

  • They report ΔAIC = −3.328 relative to flat ΛCDM
  • and a present-day scalar mass on the order of the Hubble scale (m1 ≈ 1.465 × 10^−33 eV, with m1/H0 ≈ 1.006).

But even more important than the mass scale is the behavior: the scalar’s equation of state is not just stuck at w = −1. Over the fitted redshift interval, it evolves (including a case where wϕ changes from about −0.08 at z = 2.33 to around −0.85 near z = 0.38, then to roughly −0.82 today). The model is still close enough to w = −1 to get a competitive distance fit, but it’s not numerically “guaranteed” to be a cosmological constant.

That’s exactly the kind of target perturbation and stability analyses would need: a background that looks viable but is produced by dynamics you could falsify later.

The axion-like exception: transient hilltop acceleration

Claude Sonnet 5’s minimum-AIC representative C794 (under original nominal parameter counting) reduces to an axion-like periodic potential. It’s distinct because the scalar experiences a hilltop turnaround, leading to transient acceleration: acceleration happens roughly for 0.009 ≲ z ≲ 0.69, and it has already returned to mild deceleration by today (z = 0).

This illustrates something useful for people thinking about model discovery: even when two theories are both “dark energy,” the underlying dynamics can differ in qualitatively testable ways.

Redundancy and equivalence: the system can miss “same physics, simpler description”

The paper finds an instructive failure mode. In one representative selection (C962), the nominal parameter count suggests it’s a different theory from C794, but after accounting for integration-by-parts relations and an invertible field redefinition, they belong to the same equivalence class.

When the effective parameter counting is corrected, the effective-AIC ranking changes. The authors explicitly flag that future versions should canonicalize proposals under integration-by-parts and field redefinitions—potentially with a numerical Hessian-rank test before assigning effective parameter counts.

So CosmoAgent is already sophisticated, but model equivalence bookkeeping is still a tricky corner for LLM-driven symbolic search.

Beyond Einstein–Hilbert: Induced Gravity and Scalar–Gauss–Bonnet Appear—and Stability Tests Matter

CosmoAgent also explores “non–Einstein–Hilbert” structures by running a separate search that excludes a bare Einstein–Hilbert term at proposal time.

This produces more exotic models, including:

  • Induced gravity-type structures, where an evolving scalar background effectively determines the Planck mass.
  • Scalar–Gauss–Bonnet couplings, where a scalar couples to curvature through the Gauss–Bonnet invariant.

Induced gravity example: background looks okay, scalar no-ghost fails

A DeepSeek V4 Pro run identifies an induced-gravity two-field structure where there’s no field-independent Einstein–Hilbert term. Instead, the effective Planck mass M_*^2(ϕ2) depends on the second scalar’s background value.

On the background level, they check positivity and regularity of the tensor sector in a way that suggests the tensor kinetic and gradient structure is healthy (and they show M_*^2 stays finite, positive, and of order M_p^2). But when they transform to the Einstein frame and evaluate the scalar kinetic matrix entry, they find a scalar no-ghost violation: the relevant coefficient becomes negative at z = 0 and remains negative along the evaluated trajectory.

The takeaway: background agreement is not enough. CosmoAgent is good at background discovery, but full perturbative viability requires additional checks, and the paper shows those checks can genuinely eliminate candidates.

Scalar–Gauss–Bonnet completion: tensor speed constraints complicate the story

A Qwen proposal reduces to a model involving a quadratic nonminimal coupling and a linear scalar–Gauss–Bonnet interaction. The evaluated tensor propagation speed at the redshift of GW170817 (z = 0.009783) is found to be substantially nonluminal (they report c_T^−1 ≃ 0.937).

However, they emphasize an escape hatch: the EFT cutoff scale Λ used in the fit is extremely low (Λ ≈ 1.9363 × 10^−30 eV), far below LIGO-band frequencies (~10^−13 eV). That means you can’t straightforwardly extrapolate the low-energy tensor speed to the gravitational-wave band without understanding the theory above the cutoff. The paper retains the example as an exploration of what the search can find, while stressing what additional work is needed to make a clean observational statement.

Key Takeaways

  • CosmoAgent is an agentic framework for cosmology that searches actions, not just fitted curves. LLM proposals are validated through deterministic equation-derivation and background checks before likelihood ranking.
  • Using DES SN (1820 objects) and DESI DR2 BAO (13 entries), CosmoAgent’s searches (8 LLMs, 1000 parent theory proposals each) find candidates with lower nominal AIC than flat ΛCDM in every run.
  • The best nominal improvement reported is ΔAIC = −3.328, while BIC favors flat ΛCDM for the reported minimum-AIC representatives. So the work demonstrates search capability, not a decisive observational preference.
  • Most minimum-AIC survivors collapse into quadratic-quintessence behavior—showing the system can “rediscover” familiar structures even within a much broader grammar.
  • The paper also demonstrates why extra physics checks are non-negotiable: exotic models like induced gravity and scalar–Gauss–Bonnet structures can pass background-level tests yet fail scalar no-ghost conditions or run into tensor-speed complications.
  • Practically, this kind of workflow could help groups prioritize which theories deserve expensive perturbation/stability and multi-probe analysis, saving time and reducing the bias of manual theory selection.

If you want, I can also write a follow-up post that focuses purely on the workflow design—i.e., how to think about agentic “LLM + deterministic physics” pipelines and where the failure modes tend to show up (parameter counting, equivalence classes, and stability gaps).

Sources Used

This article is a plain-English breakdown of the following peer-reviewed preprint. Read the original for full methodology and results:

Where To Go Next

LLMs and Research Productivity: Testing the “Timing Trap” Effect

Idea2Prior: Auditable paper search from vague research ideas

UDHR Rights Test for LLMs: UDHRBench Explained

Browse the free Prompt Database or tune your own prompts with the Prompt Optimizer.

Frequently Asked Questions

Limited Time Offer

Unlock the full power of AI.

Ship better work in less time. No limits, no ads, no roadblocks.

1ST MONTH FREE Basic or Pro Plan
Code: FREE
Full AI Labs access
Unlimited Prompt Builder*
500+ Writing Assistant uses
Unlimited Humanizer
Unlimited private folders
Priority support & early releases
Cancel anytime • 10,000+ members
*Fair usage applies on unlimited features to prevent abuse.