ChronoLLM: Customizing Language Models for Physics-Based Simulation Code Generation
This work addresses the challenge of lowering the entry barrier for experts using simulation tools like PyChrono, though it is incremental as it applies existing customization methods to a new domain.
The authors tackled the problem of customizing large language models (LLMs) to generate physics-based simulation code for PyChrono, resulting in a quantifiable improvement in script quality, though the scripts are rarely perfect and often serve as starting points for users.
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.