arXiv:2503.17004cs.PLcs.CL2025-03被引 9

用大模型从文字描述自动生成化学反应器动态模型代码

Text2Model: Generating dynamic chemical reactor models using large language models (LLMs)

  • 用合成数据微调Llama 3.1生成Modelica代码,实现文本到模型的转换
  • 微调后模型在语法和语义准确率上显著优于基线模型和GPT4o
  • 适合需要快速构建反应器模型的化工工程师,尤其关注生成效率

随着大语言模型在自然语言对话中展现出卓越能力,一个关键问题浮现:它们能否协助化工工程师完成领域特定任务?本文提出Text2Model,通过输入文本描述,自动生成Modelica格式的动态化学反应器模型。我们使用针对不同反应器场景的合成Modelica代码对Llama 3.1 8B Instruct进行微调。通过人工评估生成模型的语法和语义准确性,结果表明,微调后的模型在两方面均取得显著提升。然而,相较于GPT4o,其在未见场景下的泛化能力仍不理想。

原文摘要 · Abstract (English)

As large language models have shown remarkable capabilities in conversing via natural language, the question arises as to how LLMs could potentially assist chemical engineers in research and industry with domain-specific tasks. We generate dynamic chemical reactor models in Modelica code format from textual descriptions as user input. We fine-tune Llama 3.1 8B Instruct on synthetically generated Modelica code for different reactor scenarios. We compare the performance of our fine-tuned model to the baseline Llama 3.1 8B Instruct model and GPT4o. We manually assess the models' predictions regarding the syntactic and semantic accuracy of the generated dynamic models. We find that considerable improvements are achieved by the fine-tuned model with respect to both the semantic and the syntactic accuracy of the Modelica models. However, the fine-tuned model lacks a satisfactory ability to generalize to unseen scenarios compared to GPT4o.

大模型化学工程代码生成Modelica

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。