首页 > AI前沿 > Your Simulation Runs but Solves the Wrong Physics: Verifying What LLM-Generated Simulation Code Encodes

Your Simulation Runs but Solves the Wrong Physics: Verifying What LLM-Generated Simulation Code Encodes

arXiv自然语言 2026-12-01 13:00 4 阅读 查看原文

Code generated by large language models (LLMs) is commonly accepted once it runs. We show that, for scientific simulation, this acceptance is unsafe. Running the single-shot outputs of three LLMs on MooseBench, a 220-case multiphysics benchmark that we release, we find that 41-60% of the MOOSE inputs that run, and 39-56% of those that run to completion, violate the expert reference: they run while solving a different problem. The gap persists in newer models such as GPT-6 Sol (68% of its runnable inputs), even when the model first writes down the specification it intends to implement. These violations usually change the solution: on a 98-case subset, 56 of 63 comparable violating outputs deviate from the reference solution by more than 1%, against 6 of 48 outputs that satisfy every check. Such failures are invisible to execution but checkable from the code. In MOOSE, each Kernel and boundary-condition object adds a known weak-form term, so our verifier reads the encoded PDE off the input and compares it with the intended one, with no solver run and no LLM judge. It accepts all 962 physics-preserving rewrites of the expert references and flags 1,286 of 1,313 physics-changing mutations without accepting any. As repair feedback, its report helps as much as the specification is right: checked against a model's own reading of the request, it can carry that reading's errors into the code; as they are corrected, it turns from worse than a self-check to better. We hope these results encourage verifying simulation code against the equations it is meant to solve, not only against whether it runs.