ModiGen: A Large Language Model-Based Framework for Modelica Component Generation in Multi-Domain Systems

Modelica is an industry-standard language for modeling and simulating complex cyber-physical systems, playing a critical role in digital twin development. Driven by the escalating demand for complex system modeling, there is a growing interest in leveraging the advanced code generation capabilities of Large Language Models (LLMs). To explore this potential, we establish a comprehensive benchmark to systematically evaluate LLMs in generating Modelica component models. Our evaluation reveals that current LLMs struggle to construct simulation-ready components due to strict acausal semantics, with failures primarily stemming from: (1) syntactic violations, (2) semantic hallucinations, and (3) physical inconsistencies. To overcome these challenges, we propose ModiGen, a framework designed to promote syntactic correctness along with structural and physical consistency in Modelica generation. ModiGen features supervised fine-tuning to facilitate the internalization of domain knowledge. Crucially, it employs Modelica-specific structural retrieval-augmented generation to inject precise topological constraints and physical laws. Furthermore, it incorporates a fully automated, feedback-driven refinement mechanism that transforms simulation diagnostics into fine-grained instructions, guiding LLMs to resolve specific syntactic and semantic errors. Experimental results demonstrate that ModiGen achieves up to 18.65% improvement in the functional validation pass rate over baselines, significantly enhancing the reliability of component generation.

Link
https://www.semanticscholar.org/paper/5013b8a11a166d28ea2d93d0f63178294009d108
Found by
Semantic Scholar
Authors
Jia-Hui Xiang, Tong Ye, Pei-Yu Liu, Yi-Nan Zhang, Wenhai Wang
Categories
benchmark, evaluation
Published
2026-10-03
Last seen by the radar
2026-10-03
Citations
0
Influential citations
0
Radar score
51.28 / 100 (how it is scored)
Why it scored so
Matched: benchmark, evaluat; Primary record: Semantic Scholar
Related links
https://doi.org/10.1145/3822455.3830313
Is this record right? If you made this work and something here is wrong or missing, tell us what to fix.

More records found by Semantic Scholar