Structural modeling is a fundamental component of computational engineering science, in which even minor physical inconsistencies or specification violations may invalidate downstream simulations. The potential of large language models (LLMs) for automatic generation of modeling code has been demonstrated. However, non-executable or physically inconsistent outputs remain prevalent under stringent engineering constraints. A framework for physics-consistent automatic building modeling is therefore proposed, integrating domain knowledge construction, constraint-oriented model alignment, and verification-driven evaluation. CivilInstruct is introduced as a domain-specific dataset that formalizes structural engineering knowledge and constraint reasoning to enable simulation-ready model generation. A two-stage fine-tuning strategy is further employed to enforce constraint satisfaction and application programming interface compliance, substantially reducing hallucinated and non-conforming outputs. MBEval is presented as a verification-driven benchmark that evaluates executability and structural dynamics consistency through closed-loop validation. Experimental results show consistent improvements over baselines across rigorous verification metrics. Our code is available at https://github.com/Jovanqing/AutoBM.
翻译:结构建模是计算工程科学的基础组成部分,其中即使微小的物理不一致性或规范违规也可能导致下游仿真失效。大语言模型在建模代码自动生成方面的潜力已得到验证,但在严苛的工程约束条件下,不可执行或物理不一致的输出仍普遍存在。为此,本文提出了一种面向物理一致性的自动建筑建模框架,整合了领域知识构建、约束导向的模型对齐以及验证驱动的评估。我们引入CivilInstruct这一领域专用数据集,该数据集将结构工程知识与约束推理形式化,从而支持可仿真就绪的模型生成。进一步采用两阶段微调策略以强制执行约束满足与应用编程接口合规性,显著减少了产生幻觉与不符合规范的输出。提出MBEval这一验证驱动的基准测试,通过闭环验证评估模型的可执行性与结构动力学一致性。实验结果表明,在严格的验证指标上,该方法相较于基线模型取得了一致性提升。我们的代码开源在https://github.com/Jovanqing/AutoBM。