Solver to System: LLM Reasoning Across Representations and Execution in Scientific Simulation

Eliza Berman, Rohan Subramanian, Shreya Jha, Lohit Jagarapu, Romain Lopez, Rajesh RanganatharXiv 2026

The promise of AI in science often hinges on Large Language Models (LLMs) acting as "agents" that can write, debug, and interpret scientific code. However, a major hurdle remains: a simulator can be syntactically perfect and execute without errors while being physically "hallucinated."

In their paper, "Solver to System: LLM Reasoning Across Representations and Execution in Scientific Simulation," researchers from NYU investigate whether LLMs truly understand the underlying physics of the code they handle or if they are simply pattern-matching their way through scientific tasks.

TL;DR

The authors introduce Solver2System, a benchmark that tests LLMs on their ability to reconcile different representations of physical systems (code, math, text, and data). They find that while execution helps models identify physical errors, LLMs often rely on superficial lexical cues (like variable names) and frequently reach the right conclusion for the wrong physical reasons.

What Problem Does This Paper Address?

In scientific computing, a Partial Differential Equation (PDE) solver is more than just code; it’s a representation of a physical law. To work with these solvers effectively, an agent must reason across multiple layers of abstraction: the mathematical equation ($\partial_t u = \dots$), the natural language description ("heat diffusion in a rod"), the source code (the implementation), and the numerical trajectory (the resulting data).

The core challenge is that code can be "valid" in a programming sense (it runs) but "invalid" in a scientific sense (it violates conservation laws or has a sign flip that causes unphysical behavior). Current benchmarks often focus on whether code runs, but this paper asks if LLMs can detect when the physics is broken, especially when different representations of the same system disagree.

Figure 1: Experimental overview of Solver2System’s two evaluation settings.

Methods

The researchers evaluated eight open-weight models (like Qwen and Nemotron) and two frontier models (Gemini 2.5 and 3.7 Flash) using two primary tasks:

  1. Cross-Representation Consistency: Models are shown four views of a system (Code, Math, Trajectory, Description). In some cases, one view is "corrupted" (e.g., the math says "diffusion" but the code implements "advection"). The LLM must identify if they agree and, if not, find the "outlier."
  2. Static and Agentic Validity Judgment: Models judge if a piece of code is physically valid. In the "agentic" version, they are given a budget of actions to modify the code, run diagnostics, and observe the output before making a final judgment.

To ensure models weren't just relying on "cheating" cues, the authors used lexical perturbations: removing comments, corrupting comments with misleading info, or obfuscating variable names (e.g., changing diffusion_coeff to foobar1).

Datasets

The authors introduced the Solver2System dataset, which consists of:

  • 32 base PDE solvers covering four families: Heat, Wave, Burgers, and Navier-Stokes equations.
  • A mix of human-written (textbook-style) and synthetic (LLM-generated) implementations.
  • Controlled Corruptions: Physically invalid variants created by introducing small but consequential defects like sign flips or spurious terms.
  • Aligned Representations: For every solver, the dataset includes the corresponding LaTeX equations, natural language descriptions, and numerical trajectories.

Key Insights and Ideas

  • The Trust Hierarchy: LLMs exhibit an "implicit hierarchy" of trust. When evidence conflicts, they are much more likely to trust the mathematical equations or text descriptions over the numerical trajectories. They often "blame" the trajectory as the outlier even when it is the only correct representation.
  • Lexical Crutches: Obfuscating variable names doesn't just make the code harder to read; it actually degrades the model's ability to reason about the other unchanged representations (like the math). This suggests models use variable names as a primary anchor for their physical "mental model."
  • Execution is a Double-Edged Sword: While running code (agentic reasoning) significantly improves a model's ability to spot invalid physics, weaker models often find the "right" answer for the "wrong" reason. For example, a model might correctly label code as invalid because it saw a NaN (Not a Number) error, but completely miss the actual causal defect (like a reversed sign in the flux calculation).

Key Results

  • High False Alarms: Models are highly skeptical, incorrectly reporting disagreements in 47% of perfectly consistent cases.
  • Detection Gaps: Corrupted code was the hardest outlier to detect (63% detection rate), whereas corrupted trajectories were the easiest (up to 88%).
  • Obfuscation Impact: Removing informative variable names dropped the models' ability to identify the correct outlier by 4.0 percentage points across all corrupted items.
  • Agentic Gains: Gemini 2.5 Flash saw a 9.3pp jump in accuracy when allowed to execute code, though it still struggled with "causal misdiagnosis."
Evaluating reasoning quality for each agent using LLM-as-judge.
Figure 6 shows that while models like Gemini 3.7 are robust, weaker models (Gemini 2.5) often fail to name the real physical defect even when they correctly guess the code is invalid.

Limitations and Future Work

The authors acknowledge that their corpus is relatively small (32 base solvers) and consists of "textbook-style" code rather than high-fidelity, production-grade scientific software.

Future research could expand this to more complex multi-physics simulations and explore how to better align LLMs to "trust" numerical data. The paper concludes that while LLMs are becoming powerful scientific assistants, we must remain wary of their tendency to reach correct conclusions through flawed physical reasoning—a "right for the wrong reasons" failure mode that could be dangerous in sensitive scientific applications.

Summary updated

Abstract

Simulators based on partial differential equations (PDEs) are widely used to model physical systems, but generating and interpreting PDE solver code with large language models (LLMs) remains challenging. Scientific simulation code is a useful testbed for LLM scientific reasoning because (1) one system can be represented by code, equations, natural language, and numerical trajectories and (2) code can execute successfully while implementing invalid physics. We introduce Solver2System, a dataset of PDE solvers with multiple representations, controlled corruptions, and lexical perturbations, to evaluate whether LLMs can recover the underlying physical system through (1) cross-representation consistency and (2) static and agentic detection of physical invalidity. Across eight open-weight models, LLMs systematically favor some representations when evidence conflicts, and lexical perturbations to code alter interpretation of other unchanged representations. Execution improves physical-validity judgments, but weaker agents can judge correctly without identifying the causal defect. Thus, LLMs may reach correct judgments despite inconsistent representation reconciliation or causal misdiagnosis.
BibTeX
@misc{berman2026solver,
  author = {Eliza Berman and Rohan Subramanian and Shreya Jha and Lohit Jagarapu and Romain Lopez and Rajesh Ranganath},
  title = {{Solver to System: LLM Reasoning Across Representations and Execution in Scientific Simulation}},
  year = {2026},
  eprint = {2611.21964},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.21964},
}
Figure