arXiv:2610.02982cs.AIOct 2026

Manuscript Offprint

arXiv:2610.02982

PLCWorld: Benchmarking LLM-Generated PLC Programs in Closed-Loop Plant Simulation

Yunji Kim, Yunseok Lee, Hyunwoo Seo, Jaerim Choi, Woojin Lee

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Programmable logic controllers (PLCs) coordinate industrial equipment by reading sensor inputs and issuing control commands. Evaluating whether large language model (LLM)-generated PLC programs satisfy task requirements and safety constraints requires observing how their commands affect device and workpiece states. We introduce PLCWorld, a common closed-loop execution environment and benchmark that couples Structured Text (ST) execution with simulated plant responses and sensor feedback. Grounded in control relations identified in industrial PLC programs and engineering documentation, PLCWorld contains 100 synthetic tasks and 473 registered task-condition pairs across Motion Control and Material Handling, with difficulty defined by control-dependency scope. A common protocol reports Task Success and Safety Violation separately. Validation combines practitioner review, reference and alternative programs, targeted counterexamples, specification-evaluator alignment checks, and comparisons with independent ST runtimes. Reference and alternative programs satisfy their applicable cases, while all 542 targeted counterexamples activate their designated evaluator rules under at least one registered condition. Execution Gap relates submission-profile acceptance to subsequent task failure or observed Safety Violation. Across the constructed task groups, direct GPT-5.5 achieves 82.70% Task Success on Easy cases but 25.10% on Hard cases. Evaluations of six LLMs and four adapted generation-and-verification workflows further expose differences between completion, safety, and generation cost. Our code is available at https://yunji0516.github.io/PLCWorld/.

1 INTRODUCTION

A Programmable Logic Controller (PLC) is an industrial controller that coordinates a production process by reading sensor signals and controlling devices such as motors, conveyors, and grippers (Vyatkin, 2013). PLC control involves dependencies within a basic control function, between functions of a job, and between jobs that share equipment. These dependencies arise from device response timing, required device and workpiece states, and access to shared resources. They determine when an operation may start, which states must be maintained during execution, and when the operation can be considered complete. Failing to respect these dependencies can prevent task completion or violate safety constraints. Such concerns have long motivated research on the formal verification of PLC programs (Ovatman et al., 2016; Adiego et al., 2015).

To express such control logic, engineers write programs in the IEC 61131-3 languages (International Electrotechnical Commission, 2013), among which Structured Text (ST) is a high-level textual language. Recent work generates ST code from natural-language requirements with large language models (LLMs), using document and code-example retrieval (Koziolek et al., 2026; Yang et al.,

∗^{*}Equal contribution.

†^{\dagger}Corresponding author.

Figure

Upstream acceptance does not guarantee plant-level success.

Figure 1: Execution Gap. Even after the specified upstream checks pass, the lift can rise without the workpiece if grasping is incomplete when the fixed wait ends.

2025), compiler feedback (Fakih et al., 2024), and formal verification (Liu et al., 2026) to support generation and revision. Evaluation has also expanded to project context and execution outcomes (Tu et al., 2026). The evidence provided by these evaluations depends on the properties, inputs, and execution conditions they cover. We focus on evaluating whether an LLM-generated ST program can coordinate the required operations to complete a plant task while satisfying its safety constraints under specified operating conditions.

On physical equipment, issuing a command does not imply that the corresponding operation has completed. Whether a dependent operation can start or continue depends on the actual state of the controlled equipment and process, collectively called the plant. The plant state evolves as devices respond to commands and interact with workpieces. A PLC program must therefore coordinate its commands with the device and workpiece states required by the task.

Figure 1 illustrates this dependency with a gripper that must secure a workpiece before lifting it. The generated ST program commands the gripper to close, waits for a fixed interval, and then commands the lift. If grasping takes longer than this interval, even within the specified operating range, the lift starts before the workpiece is secured, leaving it on the table. The failure arises because the program advances to lifting without satisfying the prerequisite grasp state, despite issuing the commands in the intended order.

In plant operation, the outcome of one operation can determine the conditions under which subsequent operations may proceed. Evaluating these dependencies calls for closed-loop plant execution, in which the program's control outputs change device and workpiece states, and sensor inputs derived from those states are returned to the program for subsequent control. An evaluation environment must sustain this interaction throughout the task so that task completion and safety can be assessed from the resulting plant behavior.

We introduce PLCWorld, an execution environment and benchmark for evaluating LLM-generated ST programs on industrial control tasks. Our contributions are as follows. (1) We develop a closed-loop plant execution environment that couples ST execution with simulated device and workpiece behavior at each PLC scan. (2) We construct Motion Control and Material Handling task suites grounded in control relations identified in industrial PLC programs and engineering materials, with explicit task objectives, control dependencies, operating conditions, and safety constraints. (3) We establish a common evaluation protocol that reports Task Success and Safety Violation separately and compares upstream checks with plant execution outcomes on the same submissions to analyze Execution Gap.

We evaluate six LLMs and four generation-and-verification methods on PLCWorld. Across both settings, Hard tasks show substantially lower Task Success rates than Easy and Medium tasks, while Safety Violation captures failures not reflected by completion alone. The evaluated adaptations show mixed completion and safety changes versus matched direct generation, without consistent plant-level gains. Substantial failures persist after common upstream acceptance. Failure analysis identifies failure to establish valid completion by the deadline as the most frequent recorded signature.

Table 1: Reported validation coverage of LLM-based PLC code generation studies.

StudyProgram validationDependency validationPlant outcomes
Syntax / buildProgram executionControl dependenciesWorkpiece handlingTask completionSafety violations
LLM4PLC○○○△△×
Agents4PLC○○○×××
AutoPLC○○○×××
Spec2Control△×△×××
SemaPLC○○○×××
PLCWorld○○○○○○

○: assessed; △: partially assessed; ×: not reported.