让大模型生成的数字孪生更可靠,关键在代码中间表示的设计。
On Integrating Resilience and Human Oversight into LLM-Assisted Modeling Workflows for Digital Twins
- 用分层结构分离建模与参数拟合,提升可解释性
- 采用预验证组件库和密度保持的中间表示,降低幻觉误差
- 揭示不同中间表示对错误率的影响,指导工程实践
大语言模型辅助建模有望仅凭粗略描述和传感器数据快速构建复杂系统的可执行数字孪生。然而,模型对大模型幻觉的鲁棒性、人工监督以及实时适应能力仍是难题,且常相互冲突。本文基于FactoryFlow——一个开源的大模型辅助制造系统数字孪生仿真框架,提出三项核心设计原则:首先,将结构建模与参数拟合解耦;结构描述(组件及其连接)由大模型从自然语言转换为中间表示(IR),经人工可视化验证后自动转为最终模型;参数推断则持续运行于传感器数据流上,支持专家调控。其次,限制中间表示仅包含参数化预验证组件的连接,而非整体仿真代码,以增强可读性和容错性。第三,也是最关键的,采用密度保持的中间表示。当输入紧凑时,若中间表示膨胀过快,幻觉错误会呈比例累积。本文论证了Python作为密度保持中间表示的优势:循环表达规律性简洁,类封装层次与组合,结果仍高度可读并充分利用大模型代码生成能力。核心贡献在于详细刻画了不同细节和复杂度下模型描述中的大模型错误,揭示中间表示选择对错误率的决定性影响,为构建稳健透明的大模型辅助仿真自动化流程提供可操作指导。
原文摘要 · Abstract (English)
LLM-assisted modeling holds the potential to rapidly build executable Digital Twins of complex systems from only coarse descriptions and sensor data. However, resilience to LLM hallucination, human oversight, and real-time model adaptability remain challenging and often mutually conflicting requirements. We present three critical design principles for integrating resilience and oversight into such workflows, derived from insights gained through our work on FactoryFlow - an open-source LLM-assisted framework for building simulation-based Digital Twins of manufacturing systems. First, orthogonalize structural modeling and parameter fitting. Structural descriptions (components, interconnections) are LLM-translated from coarse natural language to an intermediate representation (IR) with human visualization and validation, which is algorithmically converted to the final model. Parameter inference, in contrast, operates continuously on sensor data streams with expert-tunable controls. Second, restrict the model IR to interconnections of parameterized, pre-validated library components rather than monolithic simulation code, enabling interpretability and error-resilience. Third, and most important, is to use a density-preserving IR. When IR descriptions expand dramatically from compact inputs hallucination errors accumulate proportionally. We present the case for Python as a density-preserving IR : loops express regularity compactly, classes capture hierarchy and composition, and the result remains highly readable while exploiting LLMs strong code generation capabilities. A key contribution is detailed characterization of LLM-induced errors across model descriptions of varying detail and complexity, revealing how IR choice critically impacts error rates. These insights provide actionable guidance for building resilient and transparent LLM-assisted simulation automation workflows.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。