arXiv:2410.15154cs.AI2024-10被引 7

用大模型生成运动控制代码,自动验证提升安全与效率

MCCoder: Streamlining Motion Control with LLM-Assisted Code Generation and Rigorous Verification

  • 分任务+检索增强+自校正,提升代码生成质量
  • 在复杂任务上性能提升131.77%,整体提升33.09%
  • 适合自动化、工业控制领域开发者使用

大型语言模型(LLMs)在代码生成方面展现出巨大潜力。然而,在工厂自动化领域,尤其是运动控制方面,仍普遍依赖人工编程及低效不安全的调试方式,这源于机械与电气系统的复杂交互以及严格的安全要求。现有AI辅助运动控制编程多聚焦于PLC,对高级语言和功能库关注不足。为此,我们提出MCCoder,一个面向运动控制代码生成的LLM系统,集成软性运动控制器。MCCoder通过多任务分解、混合检索增强生成(RAG)与迭代自校正的结构化流程,结合成熟运动库提升生成质量。同时,系统集成3D仿真进行直观运动验证,并记录完整运动轨迹日志用于数据验证,显著提高准确性与安全性。由于缺乏针对运动控制代码生成的基准数据集与评估指标,我们构建了MCEVAL数据集,涵盖不同复杂度的运动任务。实验表明,相比基线模型,MCCoder在整体性能上提升33.09%,复杂任务上提升131.77%。

原文摘要 · Abstract (English)

Large Language Models (LLMs) have demonstrated significant potential in code generation. However, in the factory automation sector, particularly motion control, manual programming, alongside inefficient and unsafe debugging practices, remains prevalent. This stems from the complex interplay of mechanical and electrical systems and stringent safety requirements. Moreover, most current AI-assisted motion control programming efforts focus on PLCs, with little attention given to high-level languages and function libraries. To address these challenges, we introduce MCCoder, an LLM-powered system tailored for generating motion control code, integrated with a soft-motion controller. MCCoder improves code generation through a structured workflow that combines multitask decomposition, hybrid retrieval-augmented generation (RAG), and iterative self-correction, utilizing a well-established motion library. Additionally, it integrates a 3D simulator for intuitive motion validation and logs of full motion trajectories for data verification, significantly enhancing accuracy and safety. In the absence of benchmark datasets and metrics tailored for evaluating motion control code generation, we propose MCEVAL, a dataset spanning motion tasks of varying complexity. Experiments show that MCCoder outperforms baseline models using Advanced RAG, achieving an overall performance gain of 33.09% and a 131.77% improvement on complex tasks in the MCEVAL dataset.

运动控制代码生成LLM工业自动化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。