FEABench: Evaluating Language Models on Real World Physics Reasoning Ability

Nayantara Mudur, Hao Cui, Subhashini Venugopalan, Paul Raccuglia, Michael Brenner, Peter Christian Norgaard · Submission to ICLR 2025 · Rejected

TL;DR

FEABench evaluates whether modern LLMs and interactive agents can solve complex, real-world engineering problems end-to-end by driving finite element analysis (FEA) software. By testing models on COMSOL Multiphysics® API scripting, the authors find that while multi-turn agent architectures achieve up to 88% API call executability, current state-of-the-art LLMs fail to completely and correctly solve a single benchmark problem.

What Problem Does This Paper Address?

While large language models (LLMs) have made remarkable strides in pure mathematics, competitive programming, and symbolic science, they remain largely detached from numerical simulation-intensive engineering workflows. Real-world engineering—from designing smartphones to aerospace structures—relies heavily on Finite Element Analysis (FEA) software (such as COMSOL, Ansys, or Abaqus) to solve partial differential equations over discretized geometric meshes.

Automating these workflows requires an agent to bridge high-level physical reasoning with strict domain-specific code execution: interpreting spatial dimensions and boundary conditions, choosing correct mathematical formulations, and issuing precise API calls. This paper investigates whether current LLMs and interactive agent architectures can autonomously formulate and execute these simulation pipelines.

Methods

The authors build an execution environment and benchmarking harness around COMSOL Multiphysics® via an automated Python–Java bridge (MPh / JPype).

  • Task Formulations:
  • ModelSpecs: Natural language specification describing geometry, material properties, loading, and boundary conditions (mimicking realistic engineering briefs).
  • Plan: Explicit, step-by-step instructions describing GUI actions to take.
  • Evaluation Framework: Standard metrics like pass@k fail when solutions partially crash. The authors introduce continuous intermediate metrics:
  • Executability: Fraction of generated API lines that execute in the COMSOL sandbox without error.
  • Model Tree Score: Structural similarity between the generated simulation tree (geometry, physics, mesh, solver) and the ground truth.
  • Physics Metrics: Interface factuality (avoiding hallucinated module names), feature recall, and spatial feature dimensionality (e.g., verifying a boundary condition is applied to a 1D edge vs. a 2D surface).
  • Target Relative Error | Strict: Verification that the exported output table is non-default and within 10% relative error of the ground truth target.
  • Multi-Turn Agent Architecture:
  • ControllerAgent: Samples an initial population of 20 candidate scripts using in-context physics documentation, applying an MCMC-inspired acceptance criterion to iteratively propose and refine solutions over 40 steps.
  • ToolLookupAgent: Equipped with tools to inspect valid physics interfaces, query model tree properties, and perform semantic code snippet retrieval from an annotated library of 768 code blocks.
  • Evaluator & VerifierLLM: Provides linewise API error feedback, and triggers high-level physics consistency reviews when executability surpasses 90%.

Datasets

  • FEABench Gold: 15 manually verified, quantitatively verifiable benchmark problems spanning heat transfer, structural mechanics, acoustics, electromagnetics, and applied mathematics. Each problem possesses a verified numerical scalar target.
  • FEABench Large: 200 tutorial problems algorithmically parsed from the COMSOL Application Gallery, used for broader code-similarity and structural evaluation.
  • Annotated Snippet Library: 768 categorized code snippets mapped to natural language summaries, used exclusively as an agent retrieval tool.

Key Insights and Ideas

  • Syntax is learned, but physics interfaces are hallucinated: SOTA models grasp the general Java API grammar from a single prompt example (60–79% executability out of the box), but frequently hallucinate interface names. For instance, models frequently call HeatTransferInSolids (the natural language GUI label) instead of the syntactically required HeatTransfer.
  • Explicit instructions don't always help: Giving models step-by-step tutorial plans (Plan) did not consistently outperform high-level specifications (ModelSpecs). Models often attempted to translate natural language GUI instructions verbatim into API commands, introducing syntax errors.
  • Cascading failures in simulation graphs: A single upstream mistake invalidates everything downstream. Setting up a 2D rectangle in a 3D geometry causes the geometry node to fail silently or crash, which subsequently breaks meshing, physics definitions, and solver execution.
  • Fine-tuning pitfalls: Fine-tuning Gemini-1.5-Flash on truncated API scripts improved zero-shot executability (0.08 to 0.50) but severely degraded structural alignment (Model Tree Score dropped to 0.24 compared to 0.49 for one-shot prompting), showing that models memorized code templates while losing task grounding.

Key Results

  • Single-Turn LLM Benchmarking: Claude 3.5 Sonnet led across single-turn setups on FEABench Gold (0.79 executability, 0.69 Model Tree Score, 0.85 interface factuality), outperforming GPT-4o and Gemini-1.5-Pro. Open-weight models (Gemma-2-27B, Gemma-2-9B, CodeGemma-7B) struggled significantly with physics alignment (feature recall $\le 0.17$).
  • Agentic Multi-Turn Performance: The multi-turn agent raised execution rates from 0.62 to 0.88 and physics feature recall from 0.39 to 0.75.
  • The Grand Challenge (Accuracy): Despite high executability, 0 out of 15 problems were genuinely solved by any model or agent. While 1–2 runs produced numbers within 10% error, qualitative inspection revealed these were trivial software default values (such as COMSOL's default ambient temperature of 293.15 K / 20°C) rather than genuine converged solutions.

Limitations and Future Work

  • Dataset Scale: FEABench Gold is intentionally high-precision and human-verified, but small ($N=15$). Expanding the gold set will provide sharper statistical resolution.
  • Visual Modality: Current setups rely on text descriptions of boundary and domain selections. In practice, engineers use visual GUIs; incorporating multimodal vision agents to select geometry faces and edges directly is a natural next step.
  • CAD Geometries: The benchmark restricts itself to geometries built programmatically from primitives rather than imported industry-standard CAD files.

Summary updated

BibTeX
@inproceedings{mudur2024feabench,
  author = {Nayantara Mudur and Hao Cui and Subhashini Venugopalan and Paul Raccuglia and Michael Brenner and Peter Christian Norgaard},
  title = {{FEABench: Evaluating Language Models on Real World Physics Reasoning Ability}},
  booktitle = {MATH-AI @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=2z4U9reLm9},
}
Figure