arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.22159cs.SE
收藏

利用在线反馈训练 LLM 生成 IEC 61131-3 结构化文本

Training LLMs for Generating IEC 61131-3 Structured Text with Online Feedback

Aaron Haag, Bertram Fuchs, Altay Kacan, Oliver Lohse

AI总结:

本文提出一种利用编译器和专用 LLM 在线反馈进行偏好学习微调 LLM 的方法,以解决 IEC 61131-3 结构化文本代码生成中的数据匮乏和语法复杂问题,显著提升了编译成功率和语义精度,优于现有模型。

摘要:

IEC 61131-3 结构化文本(ST)是自动化系统中可编程逻辑控制器(PLCs)广泛使用的编程语言。然而,由于公共训练数据集中的数据有限以及 ST 语言语法的复杂性,使用 LLM 生成 ST 代码面临独特的挑战。本文提出了一种微调 LLM 以生成 ST 代码的方法,该方法通过一个在线过程利用基于偏好的学习方法,该过程涉及编译器反馈和基于 LLM 的 ST 专家的评估。在此框架中,模型被迭代优化并生成新的训练样本,随后由编译器评估语法正确性,并由一个擅长评估语义准确性但未针对代码生成进行优化的专用 LLM 进行评估。该方法使训练后的 LLM 取得了显著改进,带来了更高的编译成功率和更好的语义精度。因此,该框架被证明非常适合工业自动化应用,并优于现有最先进的模型。

英文摘要:

IEC 61131-3 Structured Text (ST) is a widely used programming language for programmable logic controllers (PLCs) in automation systems. However, generating ST code with LLMs poses unique challenges due to limited data in public training datasets and the complexity of ST language syntax. This paper proposes an approach to fine-tune LLMs for the generation of ST code that leverages a preference-based learning method through an online process involving compiler feedback and evaluation from an LLM-based ST expert. In this framework, the model is iteratively refined and generates new training samples, which are subsequently evaluated by a compiler for syntactical correctness and by a specialized LLM that excels at assessing semantic accuracy, though it is not optimized for code generation itself. This approach results in marked improvements for the trained LLM, leading to higher compilation success rates and better semantic precision. As a result, the framework proves highly suitable for industrial automation applications and outperforms state-of-the-art models.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑