用大模型生成代码实现可靠结构分析,准确率超99%
A Large Language Model-Empowered Agent for Reliable and Robust Structural Analysis
- 将结构分析转为代码生成任务,结合思维链与少量示例提示
- 在8个梁结构问题上准确率达99.0%以上,跨工况表现稳定
- 适合工程领域研究者与自动化结构分析工具开发者
大型语言模型(LLM)在开放域任务中表现卓越,但在土木工程等专业领域应用仍有限。本文评估并改进了LLM在梁结构分析中的可靠性与鲁棒性。可靠性通过重复运行相同问题的输出准确性衡量,鲁棒性则通过不同荷载和边界条件下的表现评估。构建了一个包含8个梁分析问题的基准数据集,用于测试Llama-3.3 70B Instruct模型。结果表明,尽管模型具备结构力学的定性理解,但缺乏工程应用所需的定量可靠性与鲁棒性。为此,本文提出将结构分析重构为代码生成任务,并开发了一个基于大模型的智能体:(a) 利用思维链与少样本提示生成准确的OpeeSeesPy代码;(b) 自动执行代码获得分析结果。实验显示,该智能体在基准数据集上准确率超过99.0%,在多种条件下均表现可靠且鲁棒。消融实验表明,完整示例和函数使用示例是性能提升的关键。
原文摘要 · Abstract (English)
Large language models (LLMs) have exhibited remarkable capabilities across diverse open-domain tasks, yet their application in specialized domains such as civil engineering remains largely unexplored. This paper starts bridging this gap by evaluating and enhancing the reliability and robustness of LLMs in structural analysis of beams. Reliability is assessed through the accuracy of correct outputs under repetitive runs of the same problems, whereas robustness is evaluated via the performance across varying load and boundary conditions. A benchmark dataset, comprising eight beam analysis problems, is created to test the Llama-3.3 70B Instruct model. Results show that, despite a qualitative understanding of structural mechanics, the LLM lacks the quantitative reliability and robustness for engineering applications. To address these limitations, a shift is proposed that reframes the structural analysis as code generation tasks. Accordingly, an LLM-empowered agent is developed that (a) integrates chain-of-thought and few-shot prompting to generate accurate OpeeSeesPy code, and (b) automatically executes the code to produce structural analysis results. Experimental results demonstrate that the agent achieves accuracy exceeding 99.0% on the benchmark dataset, exhibiting reliable and robust performance across diverse conditions. Ablation studies highlight the complete example and function usage examples as the primary contributors to the agent's enhanced performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。