Control software for production systems is typically developed by domain experts, despite its high complexity. The increasingly available Large Language Models (LLMs) can assist developers with code generation and debugging. However, their suitability for generating control software for production systems is still unexplored. Therefore, this study explores the generation of Structured Text (ST) according to IEC-61131-3 by different LLMs. We selected 21 coding examples that are representative of PLC programming and developed an approach for comparing the outputs of different LLMs using metrics for testing generated code (CodeBERTScore, pass@k, generation time). The strategies for prompt optimization that were developed as part of this work can be directly used for improved ST generation. Our results show that, at the time of the study, ChatGPT-4 had the highest reliability in generating syntactically correct ST code that expresses the desired functionality.
%0 Conference Paper
%1 10711113
%A Tran, Kilian
%A Zhang, Jingxi
%A Pfeiffer, Jérôme
%A Wortmann, Andreas
%A Wiesmayr, Bianca
%B 2024 IEEE 29th International Conference on Emerging Technologies and Factory Automation (ETFA)
%D 2024
%K IEC-61131-3 LLM PLC isw optimization prompting
%P 1-8
%R 10.1109/ETFA61755.2024.10711113
%T Generating PLC Code with Universal Large Language Models
%X Control software for production systems is typically developed by domain experts, despite its high complexity. The increasingly available Large Language Models (LLMs) can assist developers with code generation and debugging. However, their suitability for generating control software for production systems is still unexplored. Therefore, this study explores the generation of Structured Text (ST) according to IEC-61131-3 by different LLMs. We selected 21 coding examples that are representative of PLC programming and developed an approach for comparing the outputs of different LLMs using metrics for testing generated code (CodeBERTScore, pass@k, generation time). The strategies for prompt optimization that were developed as part of this work can be directly used for improved ST generation. Our results show that, at the time of the study, ChatGPT-4 had the highest reliability in generating syntactically correct ST code that expresses the desired functionality.
@inproceedings{10711113,
abstract = {Control software for production systems is typically developed by domain experts, despite its high complexity. The increasingly available Large Language Models (LLMs) can assist developers with code generation and debugging. However, their suitability for generating control software for production systems is still unexplored. Therefore, this study explores the generation of Structured Text (ST) according to IEC-61131-3 by different LLMs. We selected 21 coding examples that are representative of PLC programming and developed an approach for comparing the outputs of different LLMs using metrics for testing generated code (CodeBERTScore, pass@k, generation time). The strategies for prompt optimization that were developed as part of this work can be directly used for improved ST generation. Our results show that, at the time of the study, ChatGPT-4 had the highest reliability in generating syntactically correct ST code that expresses the desired functionality.},
added-at = {2024-11-07T13:34:38.000+0100},
author = {Tran, Kilian and Zhang, Jingxi and Pfeiffer, Jérôme and Wortmann, Andreas and Wiesmayr, Bianca},
biburl = {https://puma.ub.uni-stuttgart.de/bibtex/223c15be41ce2cde50026d447a88d10c1/isw-bibliothek},
booktitle = {2024 IEEE 29th International Conference on Emerging Technologies and Factory Automation (ETFA)},
doi = {10.1109/ETFA61755.2024.10711113},
interhash = {d38130fe0f3d60d45b83021b15b58178},
intrahash = {23c15be41ce2cde50026d447a88d10c1},
issn = {1946-0759},
keywords = {IEC-61131-3 LLM PLC isw optimization prompting},
month = {Sep.},
pages = {1-8},
timestamp = {2024-11-07T13:34:38.000+0100},
title = {Generating PLC Code with Universal Large Language Models},
year = 2024
}