LLM4PLC: Harnessing Large Language Models for Verifiable Programming of PLCs in Industrial Control Systems
Not on the map. Why?
Abstract (arXiv)
Although Large Language Models (LLMs) have established pre-dominance 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 Industrial Control Systems (ICS) operated by Programmable Logic Controllers (PLCs). We propose 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 LoRAs. We validate this system using a FischerTechnik Manufacturing TestBed (MFTB), illustrating how LLMs can evolve from generating structurally flawed code to producing verifiably correct programs for industrial applications. We run a complete test suite on 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 2.25/10 to 7.75/10. To promote open research, we share the complete experimental setup, the LLM Fine-Tuning Weights, and the video demonstrations of the different programs on our dedicated webpage.
Key facts. Cited by 20 papers in the map (data through 7 Oct 2026). Builds on 26 of its 62 references that are in the map. First posted on arXiv 8 Jan 2024.
Builds on
26 of 62 references.
References · 26
- 2017Attention Is All You Needcited by 59,932
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2022Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learningcited by 886
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2023A Comprehensive Overview of Large Language Modelscited by 639
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
14 more
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 342
- 2023A Comprehensive Capability Analysis of GPT-3 and GPT-3.5 Series Modelscited by 244
- 2023VeriGen: A Large Language Model for Verilog Code Generationcited by 197
- 2023DoctorGLM: Fine-tuning your Chinese Doctor is not a Herculean Taskcited by 130
- 2021Examining Zero-Shot Vulnerability Repair with Large Language Modelscited by 105
- 2022Interactive and Visual Prompt Engineering for Ad-hoc Task Adaptation with Large Language Modelscited by 70
- 2023AutoML in the Age of Large Language Models: Current Challenges, Future Opportunities and Riskscited by 34
- 2023Domain Adaptive Code Completion via Language Models and Decoupled Domain Databasescited by 19
- 2022Parameter-Efficient Tuning Makes a Good Classification Headcited by 15
- 2023FRANC: A Lightweight Framework for High-Quality Code Generationcited by 14
- 2023The potential of LLMs for coding with low-resource and domain-specific programming languagescited by 11
- 2021SYNFIX: Automatically Fixing Syntax Errors using Compiler Diagnosticscited by 8
- 2023CFG2VEC: Hierarchical Graph Neural Network for Cross-Architectural Software Reverse Engineeringcited by 6
- 2013On Formal Reasoning on the Semantics of PLC using Coqcited by 1
Built on by
Citing papers per year: 2024: 7; 2025: 6; 2026: 7.
20 papers.
Sort:
By area:
- 2024Large Language Model-Based Agents for Software Engineering: A Surveycited by 173
- 2024A Survey on LLM-based Code Generation for Low-Resource and Domain-Specific Programming Languagescited by 65
- 2024Agents4PLC: Automating Closed-loop PLC Code Generation and Verification in Industrial Control Systems using LLM-based Agentscited by 25
- 2024Large Language Model-Enabled Multi-Agent Manufacturing Systemscited by 14
- 2025Leveraging LLM Agents and Digital Twins for Fault Handling in Process Plantscited by 9
- 2025Autonomous Control Leveraging LLMs: An Agentic Framework for Next-Generation Industrial Automationcited by 8
- 2024MCCoder: Streamlining Motion Control with LLM-Assisted Code Generation and Rigorous Verificationcited by 4
- 20253D Software Synthesis Driven by Constraint-Expressive Intermediate Representationcited by 3
- 2024AutoPLC: Generating Vendor-Aware Structured Text for Programmable Logic Controllerscited by 2
- 2025Capability-Driven Skill Generation with LLMs: A RAG-Based Approach for Reusing Existing Libraries and Interfacescited by 2
- 2025Domain Specific Benchmarks for Evaluating Multimodal Large Language Modelscited by 2
- 2024INVARLLM: LLM-assisted Physical Invariant Extraction for Cyber-Physical Systems Anomaly Detectioncited by 1
8 more
- 2026DCoPilot: Generative AI-Empowered Policy Adaptation for Dynamic Data Center Operationscited by 1
- 2025Utilizing LLMs for Industrial Process Automation: A Case Study on Modifying RAPID Programscited by 0
- 2026Downsides of Smartness Across Edge-Cloud Continuum in Modern Industrycited by 0
- 2026ROSUM-MCTS: Monte Carlo Tree Search-Inspired HDL Code Summarization with Structural Rewardscited by 0
- 2026RAG-Based Auto-Configuration for Industrial Fieldbus Devicescited by 0
- 2026Large Language Models in the Loop: A Stability- and Network-Aware Survey in Networked Control, Cyber-Physical, and Multi-Agent Systemscited by 0
- 2026Requirement-Bound Verified Commissioning: A Frozen Four-Billion-Parameter Local Model as a Candidate Generator under an External Acceptance Layer with Verification and Release Authoritycited by 0
- 2026From Dead Code and Static Requirements to Working Engines: Software Revival with Coding Agentscited by 0
- 2026From Dead Code and Static Requirements to Working Engines: Software Revival with Coding Agents28 Sep 2026
- 2026Requirement-Bound Verified Commissioning: A Frozen Four-Billion-Parameter Local Model as a Candidate Generator under an External Acceptance Layer with Verification and Release Authority24 Sep 2026
- 2026Large Language Models in the Loop: A Stability- and Network-Aware Survey in Networked Control, Cyber-Physical, and Multi-Agent Systems15 Sep 2026
- 2026RAG-Based Auto-Configuration for Industrial Fieldbus Devices9 Aug 2026
- 2026ROSUM-MCTS: Monte Carlo Tree Search-Inspired HDL Code Summarization with Structural Rewards6 Jun 2026
- 2026Downsides of Smartness Across Edge-Cloud Continuum in Modern Industry31 Mar 2026
- 2026DCoPilot: Generative AI-Empowered Policy Adaptation for Dynamic Data Center Operations2 Feb 2026
- 2025Utilizing LLMs for Industrial Process Automation: A Case Study on Modifying RAPID Programs14 Nov 2025
- 20253D Software Synthesis Driven by Constraint-Expressive Intermediate Representation24 Jul 2025
- 2025Autonomous Control Leveraging LLMs: An Agentic Framework for Next-Generation Industrial Automation3 Jul 2025
- 2025Domain Specific Benchmarks for Evaluating Multimodal Large Language Models15 Jun 2025
- 2025Capability-Driven Skill Generation with LLMs: A RAG-Based Approach for Reusing Existing Libraries and Interfaces6 May 2025
8 more
- 2025Leveraging LLM Agents and Digital Twins for Fault Handling in Process Plants4 May 2025
- 2024AutoPLC: Generating Vendor-Aware Structured Text for Programmable Logic Controllers3 Dec 2024
- 2024INVARLLM: LLM-assisted Physical Invariant Extraction for Cyber-Physical Systems Anomaly Detection17 Nov 2024
- 2024MCCoder: Streamlining Motion Control with LLM-Assisted Code Generation and Rigorous Verification19 Oct 2024
- 2024Agents4PLC: Automating Closed-loop PLC Code Generation and Verification in Industrial Control Systems using LLM-based Agents18 Oct 2024
- 2024A Survey on LLM-based Code Generation for Low-Resource and Domain-Specific Programming Languages4 Oct 2024
- 2024Large Language Model-Based Agents for Software Engineering: A Survey4 Sep 2024
- 2024Large Language Model-Enabled Multi-Agent Manufacturing Systems4 Jun 2024
- 2024Large Language Model-Based Agents for Software Engineering: A Surveycited by 173
- 2024Agents4PLC: Automating Closed-loop PLC Code Generation and Verification in Industrial Control Systems using LLM-based Agentscited by 25
- 2024Large Language Model-Enabled Multi-Agent Manufacturing Systemscited by 14
- 2025Leveraging LLM Agents and Digital Twins for Fault Handling in Process Plantscited by 9
- 2026Large Language Models in the Loop: A Stability- and Network-Aware Survey in Networked Control, Cyber-Physical, and Multi-Agent Systemscited by 0
- 2026From Dead Code and Static Requirements to Working Engines: Software Revival with Coding Agentscited by 0
- 2026From Dead Code and Static Requirements to Working Engines: Software Revival with Coding Agents28 Sep 2026
- 2026Large Language Models in the Loop: A Stability- and Network-Aware Survey in Networked Control, Cyber-Physical, and Multi-Agent Systems15 Sep 2026
- 2025Leveraging LLM Agents and Digital Twins for Fault Handling in Process Plants4 May 2025
- 2024Agents4PLC: Automating Closed-loop PLC Code Generation and Verification in Industrial Control Systems using LLM-based Agents18 Oct 2024
- 2024Large Language Model-Based Agents for Software Engineering: A Survey4 Sep 2024
- 2024Large Language Model-Enabled Multi-Agent Manufacturing Systems4 Jun 2024
- 2024A Survey on LLM-based Code Generation for Low-Resource and Domain-Specific Programming Languagescited by 65
- 2024MCCoder: Streamlining Motion Control with LLM-Assisted Code Generation and Rigorous Verificationcited by 4
- 20253D Software Synthesis Driven by Constraint-Expressive Intermediate Representationcited by 3
- 2024AutoPLC: Generating Vendor-Aware Structured Text for Programmable Logic Controllerscited by 2
- 2025Capability-Driven Skill Generation with LLMs: A RAG-Based Approach for Reusing Existing Libraries and Interfacescited by 2
- 2024INVARLLM: LLM-assisted Physical Invariant Extraction for Cyber-Physical Systems Anomaly Detectioncited by 1
- 2026DCoPilot: Generative AI-Empowered Policy Adaptation for Dynamic Data Center Operationscited by 1
- 2025Utilizing LLMs for Industrial Process Automation: A Case Study on Modifying RAPID Programscited by 0
- 2026Downsides of Smartness Across Edge-Cloud Continuum in Modern Industrycited by 0
- 2026ROSUM-MCTS: Monte Carlo Tree Search-Inspired HDL Code Summarization with Structural Rewardscited by 0
- 2026RAG-Based Auto-Configuration for Industrial Fieldbus Devicescited by 0
- 2026Requirement-Bound Verified Commissioning: A Frozen Four-Billion-Parameter Local Model as a Candidate Generator under an External Acceptance Layer with Verification and Release Authoritycited by 0
- 2026Requirement-Bound Verified Commissioning: A Frozen Four-Billion-Parameter Local Model as a Candidate Generator under an External Acceptance Layer with Verification and Release Authority24 Sep 2026
- 2026RAG-Based Auto-Configuration for Industrial Fieldbus Devices9 Aug 2026
- 2026ROSUM-MCTS: Monte Carlo Tree Search-Inspired HDL Code Summarization with Structural Rewards6 Jun 2026
- 2026Downsides of Smartness Across Edge-Cloud Continuum in Modern Industry31 Mar 2026
- 2026DCoPilot: Generative AI-Empowered Policy Adaptation for Dynamic Data Center Operations2 Feb 2026
- 2025Utilizing LLMs for Industrial Process Automation: A Case Study on Modifying RAPID Programs14 Nov 2025
- 20253D Software Synthesis Driven by Constraint-Expressive Intermediate Representation24 Jul 2025
- 2025Capability-Driven Skill Generation with LLMs: A RAG-Based Approach for Reusing Existing Libraries and Interfaces6 May 2025
- 2024AutoPLC: Generating Vendor-Aware Structured Text for Programmable Logic Controllers3 Dec 2024
- 2024INVARLLM: LLM-assisted Physical Invariant Extraction for Cyber-Physical Systems Anomaly Detection17 Nov 2024
- 2024MCCoder: Streamlining Motion Control with LLM-Assisted Code Generation and Rigorous Verification19 Oct 2024
- 2024A Survey on LLM-based Code Generation for Low-Resource and Domain-Specific Programming Languages4 Oct 2024