LLM4PLC: Harnessing Large Language Models for Verifiable Programming of PLCs in Industrial Control Systems
Although \textbf{Large Language Models (LLMs)} have established predominance in automated code generation, they are not devoid of shortcomings. The pertinent issues primarily relate to the absence of execution guarantees for generated code, a lack of explainability, and suboptimal support for essential but niche programming languages. State-of-the-art LLMs such as GPT-4 and LLaMa2 fail to produce valid programs for \textbf{Industrial Control Systems (ICS)} operated by \textbf{Programmable Logic Controllers (PLCs)}. We propose \textbf{LLM4PLC}, a user-guided iterative pipeline leveraging user feedback and external verification tools – including grammar checkers, compilers and SMV verifiers – to guide the LLM’s generation. We further enhance the generation potential of LLM by employing Prompt Engineering and model fine-tuning through the creation and usage of \textbf{LoRAs}. We validate this system using a \textbf{FischerTechnik Manufacturing TestBed (MFTB)}, illustrating how LLMs can evolve from generating structurally-flawed code to producing \textbf{verifiably correct programs} for industrial applications. We run a complete test suite on \textbf{GPT-3.5, GPT-4, Code Llama-7B, a fine-tuned Code Llama-7b model, Code Llama-34B, and a fine-tuned Code Llama-34B model}. The proposed pipeline improved the generation success rate from 47% to 72%, and the Survey-of-Experts code quality from 3.0/10 to 7.2/10.
Thu 18 AprDisplayed time zone: Lisbon change
11:00 - 12:30 | LLM, NN and other AI technologies 3New Ideas and Emerging Results / Research Track / Software Engineering Education and Training / Software Engineering in Practice at Pequeno Auditório Chair(s): Tushar Sharma Dalhousie University | ||
11:00 15mTalk | Xpert: Empowering Incident Management with Query Recommendations via Large Language Models Research Track Yuxuan Jiang University of Michigan Ann-Arbor, Chaoyun Zhang Microsoft, Shilin He Microsoft Research, Zhihao Yang Peking University, Minghua Ma Microsoft Research, Si Qin Microsoft Research, Yu Kang Microsoft Research, Yingnong Dang Microsoft Azure, Saravan Rajmohan Microsoft 365, Qingwei Lin Microsoft, Dongmei Zhang Microsoft Research | ||
11:15 15mTalk | Tensor-Aware Energy Accounting Research Track DOI Pre-print | ||
11:30 15mTalk | LLM4PLC: Harnessing Large Language Models for Verifiable Programming of PLCs in Industrial Control Systems Software Engineering in Practice Mohamad Fakih University of California, Irvine, Rahul Dharmaji University of California, Irvine, Yasamin Moghaddas University of California, Irvine, Gustavo Quiros Siemens Technology, Tosin Ogundare Siemens Technology, Mohammad Al Faruque UCI | ||
11:45 15mTalk | Resolving Code Review Comments with Machine Learning Software Engineering in Practice Alexander Frömmgen Google, Jacob Austin Google, Peter Choy Google, Nimesh Ghelani Google, Lera Kharatyan Google, Gabriela Surita Google, Elena Khrapko Google, Pascal Lamblin Google, Pierre-Antoine Manzagol Google, Marcus Revaj Google, Maxim Tabachnyk Google, Danny Tarlow Google, Kevin Villela Google, Dan Zheng Google DeepMind, Satish Chandra Google, Inc, Petros Maniatis Google DeepMind | ||
12:00 15mTalk | LLMs Still Can't Avoid Instanceof: An investigation Into GPT-3.5, GPT-4 and Bard's Capacity to Handle Object-Oriented Programming Assignments Software Engineering Education and Training | ||
12:15 7mTalk | Leveraging Large Language Models to Improve REST API Testing New Ideas and Emerging Results Myeongsoo Kim Georgia Institute of Technology, Tyler Stennett Georgia Institute of Technology, Dhruv Shah Georgia Institute of Technology, Saurabh Sinha IBM Research, Alessandro Orso Georgia Institute of Technology Pre-print | ||
12:22 7mTalk | LogExpert: Log-based Recommended Resolutions Generation using Large Language Model New Ideas and Emerging Results JiaboWang Beijing University of Posts and Telecommunications, guojun chu Beijing University of Posts and Telecommunications, Jingyu Wang , Haifeng Sun Beijing University of Posts and Telecommunications, Qi Qi , Yuanyi Wang Beijing University of Posts and Telecommunications, Ji Qi China Mobile (Suzhou) Software Technology Co., Ltd., Jianxin Liao Beijing University of Posts and Telecommunications |