用大模型把自然语言指令自动转成数控代码,还能自我修正。
GLLM: Self-Corrective G-Code Generation using Large Language Models with User Feedback
- 用微调的StarCoder-3B模型结合检索增强生成,提升代码准确性。
- 通过语法检查与霍夫德距离评估功能正确性,保证生成质量。
- 适合没编程经验的用户快速上手数控加工,降低技术门槛。
本文提出GLLM,一种利用大语言模型从自然语言指令自动生成数控机床(CNC)用G-code的创新工具。该系统采用经过领域数据微调的StarCoder-3B模型,并引入检索增强生成(RAG)机制,结合先进提示策略与新型自纠正生成方法,确保生成代码在语法和语义上的正确性。系统包含多重验证机制:语法检查、专用G-code验证及基于豪斯多夫距离的功能正确性评估。通过整合这些技术,GLLM旨在推动数控编程民主化,使无编程经验的用户也能高效可靠地生成高质量G-code。
原文摘要 · Abstract (English)
This paper introduces GLLM, an innovative tool that leverages Large Language Models (LLMs) to automatically generate G-code from natural language instructions for Computer Numerical Control (CNC) machining. GLLM addresses the challenges of manual G-code writing by bridging the gap between human-readable task descriptions and machine-executable code. The system incorporates a fine-tuned StarCoder-3B model, enhanced with domain-specific training data and a Retrieval-Augmented Generation (RAG) mechanism. GLLM employs advanced prompting strategies and a novel self-corrective code generation approach to ensure both syntactic and semantic correctness of the generated G-code. The architecture includes robust validation mechanisms, including syntax checks, G-code-specific verifications, and functional correctness evaluations using Hausdorff distance. By combining these techniques, GLLM aims to democratize CNC programming, making it more accessible to users without extensive programming experience while maintaining high accuracy and reliability in G-code generation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。