FEABench: Evaluating Language Models on Multiphysics Reasoning Ability

Nayantara Mudur, Hao Cui, Subhashini Venugopalan, Paul Raccuglia, Michael P. Brenner, Peter Norgaard

TL;DR

FEABench is a novel benchmark designed to evaluate the ability of Large Language Models (LLMs) to solve complex physics and engineering problems using Finite Element Analysis (FEA). By tasking models with generating executable Java API calls for COMSOL Multiphysics®, the researchers highlight a critical bottleneck: while LLMs can handle high-level planning, translating physics reasoning into precise simulation code remains an outstanding challenge. To address this, the authors introduce an interactive multi-agent framework that boosts code executability to 88%.

What Problem Does This Paper Address?

While LLMs have shown remarkable progress in analytical mathematics, basic coding, and symbolic science, real-world engineering workflows demand something more complex: the integration of scientific reasoning with specialized simulation software.

Developing modern hardware—like a smartphone or an aircraft wing—requires simulating interacting physical phenomena (thermal, mechanical, electrical) using Finite Element Analysis (FEA). Engineers typically do this via graphical user interfaces (GUIs) or complex software APIs. This paper addresses the lack of standardized benchmarks evaluating whether LLMs can act as autonomous engineering assistants capable of translating natural language problem descriptions into precise, executable simulation scripts.

Methods

The authors evaluate LLMs in both a baseline (single-turn) setup and a novel interactive multi-agent setting.

  1. Baseline Prompting: Models are evaluated using One-Shot prompting and PhyDoc In-Context prompting, the latter providing the model with a structured list of valid physics interfaces and features to minimize hallucinations.
  2. Multi-Agent System: To handle the low-resource nature of the COMSOL API, the authors design an interactive loop consisting of several specialized agents:
  3. ControllerAgent: Manages the overall workflow and tracks the best solutions using an MCMC-inspired acceptance criterion.
  4. Evaluator: Executes the code in a COMSOL sandbox, returning raw syntax errors and utilizing a VerifierLLM to check for physical alignment (e.g., correct units) once syntax errors drop.
  5. ToolLookupAgent & CorrectorSubAgent: Propose code corrections by leveraging specialized tools, including a semantic code search tool (RetrieveAnnotatedSnippets) that queries a pre-compiled library of valid code examples.
Figure 2: An overview of the agent and environment design.

Datasets

The paper introduces FEABench, which consists of three core components:

  • FEABench Gold: A high-quality, manually verified dataset of 15 problems spanning diverse physics domains (Heat Transfer, Structural Mechanics, Mathematics, Electrodynamics, Acoustics, and Optics). Every problem is engineered to export a single, quantitatively verifiable numerical target value.
  • FEABench Large: A larger, automatically parsed dataset containing 200 tutorial problems from the COMSOL Application Gallery, used to evaluate broader code generation capabilities without strict numerical verification.
  • Annotated Library: A reference set of 768 code snippets paired with natural language summaries (generated via Gemini-1.5-Flash) to facilitate agentic tool retrieval.
Figure 1: Left: Illustrative abbreviated example of Model Specifications for one of the heat transfer problems. Right: Distribution of FEABench Gold problems by physics domain.

Key Insights and Ideas

  • The Physics Bottleneck: Breaking down code performance block-by-block reveals that the physics configuration block (defining boundary conditions, equations, and material properties) is the absolute hardest part for LLMs, yielding the lowest executability scores.
  • Syntax vs. Planning: Interestingly, providing the model with an explicit step-by-step modeling plan (Plan task) does not consistently outperform giving it a raw engineering specification (ModelSpecs task). LLMs often follow natural language instructions so literally that they hallucinate API names (e.g., writing Heat Transfer in Solids instead of the exact syntax HeatTransfer).
  • Textual Metrics Fail: Traditional text-based similarity metrics (like string matching) are highly ineffective for evaluating simulation code due to the high volume of boilerplate code and functional equivalence (different code blocks achieving identical model setups). Structural metrics like the Model Tree Score are required.

Key Results

  • Baseline Performance: State-of-the-art closed-source models achieve moderate baseline executability (60–79%), with Claude 3.5 Sonnet consistently leading across both Gold and Large benchmarks. Open-weights models (like the Gemma family) struggle significantly with alignment and physics recall.
  • Agentic Improvements: The interactive multi-turn agent dramatically improves code quality, raising the executability of generated scripts from a baseline of 62% to 88% on the ModelSpecs task.
  • The Hard Truth of Precision: Despite high executability, actually solving the physics problem perfectly (getting within 10% of the true numerical target value) remains incredibly rare for LLMs in the COMSOL environment.
  • Python Alternative: When the tasks were ported to Python using an LLM agent (SWE-agent) with numpy and scipy, syntax errors disappeared, but the models failed at numerical precision because they had to write complex differential equation solvers from scratch, successfully solving only 4 out of 15 problems.

Limitations and Future Work

The authors note several limitations that pave the way for future research:

  • Geometry Complexity: The current benchmark restricts problems to simpler geometries built from primitives, avoiding complex external CAD model imports.
  • Lack of Visual/GUI Interaction: Human engineers heavily rely on visual feedback from the software's GUI. Integrating multimodal LLMs that can look at the simulation UI remains an open frontier.
  • Dataset Scale: Expanding the human-verified Gold dataset to include more intricate multiphysics interactions will be vital for driving further progress in autonomous engineering systems.

Summary updated

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