编译不等于正确:LLM 生成 PLC 程序的逐扫描评估
原标题:Compilation Is Not Correctness: Scan-by-Scan Evaluation of LLM-Generated PLC Programs
AI 摘要
该论文提出 CycleBench 基准,包含 301 个结构化文本(ST)PLC 编程任务和 684 个场景,通过逐扫描执行对比来评估 LLM 生成程序的行为正确性。在八个 LLM 和四种基线配置下,编译通过率为 83.99%,但执行通过率仅 72.07%,相差 11.92 个百分点;仅检查最终扫描或每五次扫描会漏检大量瞬时输出错误。作者进一步提出 CycleGen 方法,通过多候选生成、编译器反馈修复和运行时自测选择,将执行通过率提升 8.68 个百分点。
正文节选
Compilation Is Not Correctness: Scan-by-Scan Evaluation of LLM-Generated PLC Programs Abstract. Programmable logic controllers (PLCs) automate industrial processes through repeated scans, each reading inputs, executing control logic, and updating outputs. Engineers typically write this logic in Structured Text (ST), a high-level textual language defined in IEC 61131-3. Large language models (LLMs) can now generate ST from natural-language requirements, yet compilation success and checks on selec