面向供应商的工业代理:增强型LLM用于安全本地PLC代码生成
Vendor-Aware Industrial Agents: RAG-Enhanced LLMs for Secure On-Premise PLC Code Generation
AI总结:
本文提出了一种基于RAG增强的LLM方法,用于在低数据域中安全生成本地PLC代码,通过提示工程和定向检索提升代码生成质量。
摘要:
可编程逻辑控制器由专有代码方言运行;这使得训练编码助手变得具有挑战性。当前的LLM是在大规模代码数据集上训练的,并且能够直接生成符合IEC 61131-3标准的代码,但它们不知道特定的功能块或相关项目代码。此外,像三菱电机及其客户这样的公司不信任云服务提供商。因此,拥有一个自己的编码代理是解决这一问题的 desired 解决方案。在本研究中,我们提出了一种低数据域的编码助手解决方案,用于工业应用。我们展示了如何在不微调大模型的情况下实现高质量的代码生成,并通过微调小型本地模型用于边缘设备使用。我们的工具让多个AI模型相互竞争,利用推理、自动纠正错误并通过直接在聊天界面中编译代码来检查代码的有效性。我们通过广泛的评估来支持我们的方法,该评估包含代码编译统计和用户评分。我们发现,通过使用广泛的提示工程和定向检索,支持检索增强生成(RAG)的编码助手可以在低数据域中工作。
英文摘要:
Programmable Logic Controllers are operated by proprietary code dialects; this makes it challenging to train coding assistants. Current LLMs are trained on large code datasets and are capable of writing IEC 61131-3 compatible code out of the box, but they neither know specific function blocks, nor related project code. Moreover, companies like Mitsubishi Electric and their customers do not trust cloud providers. Hence, an own coding agent is the desired solution to cope with this. In this study, we present our work on a low-data domain coding assistant solution for industrial use. We show how we achieved high quality code generation without fine-tuning large models and by fine-tuning small local models for edge device usage. Our tool lets several AI models compete with each other, uses reasoning, corrects bugs automatically and checks code validity by compiling it directly in the chat interface. We support our approach with an extensive evaluation that comes with code compilation statistics and user ratings. We found that a Retrieval-Augmented Generation (RAG) supported coding assistant can work in low-data domains by using extensive prompt engineering and directed retrieval.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。