ChronoLLM: Customizing Language Models for Physics-Based Simulation Code Generation

📅 2025-08-19
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This study addresses the challenge of adapting pre-trained large language models (LLMs) into domain-specific virtual assistants for physics-based simulation. Focusing on PyChrono—a multi-body dynamics simulation framework—we propose the first systematic framework unifying adaptation strategies for both open- and closed-weight LLMs, enabling robust generation of simulation scripts across scenarios ranging from simple pendulums to complex vehicle–terrain interactions. Our methodology integrates instruction fine-tuning, domain-specific data augmentation, explicit injection of PyChrono API knowledge, and a quantitative evaluation protocol grounded in executable correctness and functional accuracy. Empirical results demonstrate substantial improvements over baseline LLMs: generated scripts exhibit markedly higher runtime validity and physical fidelity; the assistant reliably answers API queries, recommends appropriate modeling strategies, and delivers production-ready script templates for expert users. Collectively, this work lowers the entry barrier for cross-domain physics simulation tools while advancing the principled integration of LLMs into scientific computing workflows.

Technology Category

Application Category

📝 Abstract
This contribution is concerned with the following issue: can pretrained large language models (LLMs) be refined and customized to the point where they become virtual assistants helping experts with the effective use of a simulation tool? In this case study, the ``simulation tool'' considered is PyChrono, an open source multi-physics dynamics engine for multibody systems. We present a framework for refining and customizing both open- and closed-source LLMs to harness the power of AI in generating scripts that perform PyChrono virtual experiments. We refine and customize several classes of LLMs through a process that leads to a quantifiable improvement in the quality of the generated PyChrono simulation scripts. These scripts can range from simple single-pendulum simulations to complex virtual experiments involving full vehicles on deformable terrain. While the generated scripts are rarely perfect, they often serve as strong starting points for the user to modify and improve on. Additionally, the LLM can answer specific API questions about the simulator, or recommend modeling approaches. The framework discussed is general and can be applied to lower the entry barrier for simulation tools associated with other application domains.
Problem

Research questions and friction points this paper is trying to address.

Customizing LLMs for physics simulation code generation
Improving quality of PyChrono simulation scripts via AI
Lowering entry barrier for complex simulation tools
Innovation

Methods, ideas, or system contributions that make the work stand out.

Refining LLMs for PyChrono simulation script generation
Customizing open- and closed-source language models
Generating physics simulation scripts through AI framework
🔎 Similar Papers
No similar papers found.
J
Jingquan Wang
Department of Mechanical Engineering, University of Wisconsin-Madison, 1513 University Avenue, 53706, Madison, USA
A
Andrew Negrut
Department of Computer Science, Rice University, 6100 Main Street, 77005, Houston, TX, USA
H
Harry Zhang
Department of Mechanical Engineering, University of Wisconsin-Madison, 1513 University Avenue, 53706, Madison, USA
K
Khailanii Slaton
Department of Mechanical Engineering, University of Wisconsin-Madison, 1513 University Avenue, 53706, Madison, USA
S
Shu Wang
Department of Mechanical Engineering, University of Wisconsin-Madison, 1513 University Avenue, 53706, Madison, USA
Radu Serban
Radu Serban
University of Wisconsin - Madison
Jinlong Wu
Jinlong Wu
University of Wisconsin-Madison
Computational Fluid DynamicsScientific Machine LearningData AssimilationStochastic ProcessesUncertainty Quantification
Dan Negrut
Dan Negrut
Bernard A. and Frances M. Weideman Professor of Mechanical Engineering, University of Wisconsin
simulation in roboticscomputational dynamicsHPCterradynamicsgranular dynamics