EnvTrace: Simulation-Based Semantic Evaluation of LLM Code via Execution Trace Alignment -- Demonstrated at Synchrotron Beamlines
Noah van der Vleuten, Anthony Flores, Shray Mathur, Max Rakitin, Thomas Hopkins, Kevin G. Yager, Esther H. R. Tsai

TL;DR
EnvTrace introduces a simulation-based evaluation method for LLM-generated control code using execution trace alignment, demonstrated at synchrotron beamlines, enabling more accurate assessment of models' semantic understanding in physical system control.
Contribution
The paper presents EnvTrace, a novel simulation-based evaluation framework that assesses LLMs' control code through execution trace alignment, bridging the gap between language models and physical system validation.
Findings
Many top-tier LLMs approach human-level performance in control code generation.
EnvTrace effectively evaluates functional correctness across multiple behavioral dimensions.
Digital twins enable pre-execution validation and safe testing of control code.
Abstract
Evaluating large language models (LLMs) for instrument control requires methods that go beyond standard, stateless algorithmic benchmarks, since the behavior of physical systems cannot be fully captured by unit tests alone. Here we introduce EnvTrace, a simulation-based method that evaluates execution traces to assess semantic code equivalence. EnvTrace is demonstrated with a beamline control-logic digital twin to facilitate the evaluation of instrument control code, with the digital twin itself also enabling the pre-execution validation of live experiments. Over 30 LLMs were evaluated using trace alignment to generate a multi-faceted score for functional correctness across key behavioral dimensions, showing that many top-tier models can approach human-level performance in rapid control-code generation. This is a first step toward a broader vision where LLMs and digital twins work…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMachine Learning in Materials Science · Domain Adaptation and Few-Shot Learning · Computational Physics and Python Applications
