FEM-Bench: A Structured Scientific Reasoning Benchmark for Evaluating Code-Generating LLMs

Saeed Mohammadzadeh, Erfan Hamdi, Joel Shor, Emma Lejeune
12/23/2025
cs.LGcs.AIcs.SE

No confident code implementation found for this paper. 5 possible matches can be shown below.

Abstract

As LLMs advance their reasoning capabilities about the physical world, the absence of rigorous benchmarks for evaluating their ability to generate scientifically valid physical models has become a critical gap. Computational mechanics, which develops and applies mathematical models and numerical methods to predict the behavior of physical systems under forces, deformation, and constraints, provides an ideal foundation for structured scientific reasoning evaluation. Problems follow clear mathematical structure, enforce strict physical and numerical constraints, and support objective verification. The discipline requires constructing explicit models of physical systems and reasoning about geometry, spatial relationships, and material behavior, connecting directly to emerging AI goals in physical reasoning and world modeling. We introduce FEM-Bench, a computational mechanics benchmark designed to evaluate the ability of LLMs to generate correct finite element method (FEM) and related code. FEM-Bench 2025 contains a suite of introductory but nontrivial tasks aligned with material from a first graduate course on computational mechanics. These tasks capture essential numerical and physical modeling challenges while representing only a small fraction of the complexity present in the discipline. Despite their simplicity, state-of-the-art LLMs do not reliably solve all of them. In a five attempt run, the best performing model at function writing, Gemini 3 Pro, completed 30/33 tasks at least once and 26/33 tasks all five times. The best performing model at unit test writing, GPT-5, had an Average Joint Success Rate of 73.8%. Other popular models showed broad performance variation. FEM-Bench establishes a structured foundation for evaluating AI-generated scientific code, and future iterations will incorporate increasingly sophisticated tasks to track progress as models evolve.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 5 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{mohammadzadeh2025fembench,
  title  = {FEM-Bench: A Structured Scientific Reasoning Benchmark for Evaluating Code-Generating LLMs},
  author = {Saeed Mohammadzadeh and Erfan Hamdi and Joel Shor and Emma Lejeune},
  year   = {2025},
  eprint = {2512.20732},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.20732v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2512.20732.svg)](https://codeofpaper.com/paper/2512.20732)

Discussion