PLCWorld: Benchmarking LLM-Generated PLC Programs in Closed-Loop Plant Simulation
Organizations: Dongguk University · MOAI technologies
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, simulation environment, benchmark tasks, and baseline implementations are publicly available at https://yunji0516.github.io/PLCWorld/.
Figures & tables
| Level | Tasks a | Dependency Scope | Motion Control | Material Handling |
|---|---|---|---|---|
| Easy | 15 | Within one basic function | “ Move a slide to a position, confirm arrival and standstill ” | “ Grasp a workpiece at a prepared position, confirm it is held ” |
| Medium | 20 | Between functions of one job: one function’s state conditions another’s execution | “ Retract the slide, reorient the table, approach after standstill ” | “ Transport a workpiece, release it after the jig is ready ” |
| Hard | 15 | Between independent jobs: one job’s state constrains another’s progress | “ Coordinate two lift jobs as the shared shuttle and rotary/approach cell become available ” | “ Coordinate two handling jobs as the shared robot and inspection station become available ” |
| Validation target | Validation method |
|---|---|
| (1) Task specification | Practitioner review |
| (2) Evaluator judgment | Reference/alternative ST & counterexamples |
| (3) Spec–evaluator alignment | Binding & semantic checks |
| (4) ST runtime | Reruns & cross-runtime checks |
| Model / Method | Motion Control | Material Handling | Execution [-1pt] Gap | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Easy | Medium | Hard | Easy | Medium | Hard | ||||||||
| SR | SVR | SR | SVR | SR | SVR | SR | SVR | SR | SVR | SR | SVR | ||
| (1) Direct ST generation | |||||||||||||
| GPT-5.5 | 71.11 | 1.67 | 75.58 | 7.05 | 18.06 | 65.19 | 97.83 | 0.00 | 93.06 | 1.77 | 27.87 | 32.24 | 37.88 |
| GPT-4o | 14.44 | 22.37 | 8.91 | 42.06 | 0.00 | 28.57 | 28.99 | 13.49 | 1.04 | 21.11 | 0.00 | 57.71 | 92.75 |
| Claude Sonnet 5 | 75.00 | 2.27 | 75.91 | 25.50 | 0.00 | 73.33 | 88.41 | 0.72 | 77.43 | 1.04 | 4.37 | 51.72 | 50.90 |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Suite / Difficulty | #Tasks | #Cond. | I/O avg. | I/O range | Device avg. | Device range |
|---|---|---|---|---|---|---|
| Material / Easy | 15 | 46 | 8.0 | 5–12 | 1.20 | 1–2 |
| Material / Medium | 20 | 96 | 17.4 | 11–28 | 2.85 | 1–7 |
| Material / Hard | 15 | 122 | 57.5 | 37–75 | 5.13 | 2–9 |
| Motion / Easy | 15 | 60 | 8.9 | 7–12 | 1.07 | 1–2 |
| Motion / Medium | 20 | 101 | 20.1 | 12–29 | 2.10 | 1–4 |
| Motion / Hard | 15 | 48 | 128.4 | 64–146 | 3.87 | 3–5 |
| Material Handling | Motion Control | ||||||
|---|---|---|---|---|---|---|---|
| Requirement family | Easy | Medium | Hard | Easy | Medium | Hard | Total |
| Positioning and stabilization | 8 | 19 | 14 | 14 | 20 | 15 | 90 |
| Synchronization and compensation | 0 | 1 | 1 | 4 | 4 | 9 | 19 |
| Access and clearance | 0 | 12 | 14 | 2 | 17 | 15 | 60 |
| Gripping and support | 5 | 13 | 14 | 1 | 4 | 1 | 38 |
| Quantity and inventory | 4 | 6 | 8 | 0 | 0 | 0 | 18 |
| Component | Information provided | Role in evaluation |
|---|---|---|
| Task objective | Required functional outcome and, where applicable, the requested target, item, quantity, destination, or operating mode. | Defines the plant-level result the submitted program must achieve. |
| Timing and completion | PLC scan period, completion deadline, evaluation endpoint or termination condition, and any required completion signal or post-completion retention. | Defines scan timing, completion validity, required result retention, and when evaluation ends. |
| Public I/O interface | Signal names, addresses, types, and input/output semantics. | Defines the interface through which the ST program observes and controls the task environment. |
| Initial plant state | Initial device states, positions, workpiece or fixture relations, and relevant request or process state. | Defines the starting state for each execution. |
| Operating conditions | Permitted ranges or alternatives for device responses, initial conditions, and external inputs. | Defines the range within which evaluation conditions may vary. |
| Device-response semantics | Task-relevant effects of activating and deactivating outputs, including timing and transition conditions. | Defines how program outputs can change device, process, workpiece, or fixture state. |
| Fixed across conditions | Task objective; public I/O interface and semantics; device-response rules; completion requirements and deadline rules; safety constraints. |
|---|---|
| May vary by condition | Initial plant state, permitted device-response or timing values, and task-defined external inputs or request parameters. |
| Task | Suite / Difficulty | Public objective |
|---|---|---|
| MOT-E14 | Motion / Easy | Suppress the sway of an empty hoist hook and bring the trolley to rest at its current work position. |
| MOT-M16 | Motion / Medium | Position the table and carriage for tool access, maintain their alignment throughout the requested tool cycle, confirm completion of that cycle, and retract the carriage. |
| MOT-H03 | Motion / Hard | Coordinate two independent setup requests through lift stations, a shared shuttle, moving docking, and rotary synchronization, satisfying relative-motion constraints and returning each fixture. |
| MAT-E06 | Material / Easy | Discharge one product from the already aligned pocket and retract the pusher, while preserving the products in all other pockets. |
| MAT-M14 | Material / Medium | Prepare a single product, clear the feeder, and time its transfer into a continuously moving receiving pocket, while preserving the reserve product. |
| MAT-H05 | Material / Hard | Coordinate assembly, inspection, rework, and outfeed on a shared indexing table, preserving body–insert pairing and current inspection results, clearing all tools before indexing, and reinspecting reworked products before release. |