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

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.

Authors

Institutions

Publication Details

Published
2025-05-03
DOI
https://doi.org/10.1109/llm4code66737.2025.00013
Citations
4
Primary Topic
Power Systems and Technologies
Type
article
Field-Weighted Citation Impact
2.92
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Aaron Haag, Bertram Fuchs, Altay Kacan, Oliver Lohse
4 citations
Power Systems and Technologies
2.92
article

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

Aaron Haag, Bertram Fuchs, Altay Kacan, Oliver Lohse
article en
4 citations

Abstract

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.

Siemens (Germany) (DE)
Openalex Percentile: Top 9%
Power Systems and Technologies
2.92
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Training LLMs for Generating IEC 61131-3 Structured Text with Online Feedback — Aaron Haag, Bertram Fuchs, et al. · (2025) | TGRS Research Map | TGRS