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

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Haag, Aaron, Fuchs, Bertram, Kacan, Altay, Lohse, Oliver
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866909432654331904
author Haag, Aaron
Fuchs, Bertram
Kacan, Altay
Lohse, Oliver
author_facet Haag, Aaron
Fuchs, Bertram
Kacan, Altay
Lohse, Oliver
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2410_22159
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Training LLMs for Generating IEC 61131-3 Structured Text with Online Feedback
Haag, Aaron
Fuchs, Bertram
Kacan, Altay
Lohse, Oliver
Software Engineering
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.
title Training LLMs for Generating IEC 61131-3 Structured Text with Online Feedback
topic Software Engineering
url https://arxiv.org/abs/2410.22159