Advances in Production Engineering & Management
Volume 20 | Number 2 | June 2025 | pp 224–238
https://doi.org/10.14743/apem2025.2.537
Large language models for G-code generation in CNC machining: A comparison of ChatGPT-3.5 and ChatGPT-4o
Šket, K.; Potočnik, D.; Brezocnik, M.; Ficko, M.; Klančnik, S.
ABSTRACT AND REFERENCES (PDF) |
FULL ARTICLE TEXT (PDF)
A B S T R A C T
This research explores the viability of producing ISO G-code for 3-axis machining with OpenAI's Chat Generative Pre-Trained Transformer models, particularly ChatGPT-3.5 and the newer GPT-4o. G-code (RS-274-D, ISO 6983) converts human directives into commands that machines can understand, controlling toolpaths, spindle velocities, and feed rates to produce particular aspects of an object. Previously, G-code was generated either by hand or through the use of computer-aided manufacturing (CAM) software along with machine-specific post-processors, both of which may require considerable time and expense. This research aimed to assess the practicality and effectiveness of specific large language models (LLMs) in generating G-code. The assessment took place in three distinct phases on a sample component that required 3-axis machining. These phases included: (1) the self-generated production of G-code for the sample component, (2) the examination of the independently generated G-code in the CAM application, and (3) the recognition and justification of mistakes in the G-code. The outcomes indicated varying abilities with promising findings. This method could accelerate and possibly enhance manufacturing workflows by decreasing reliance on expensive CAM software and specialized knowledge.
A R T I C L E I N F O
Keywords • Generative artificial intelligence; Intelligent manufacturing; Large language models (LLM); ChatGPT; CNC machining; G-code programming
Corresponding author • Šket, K.
Article history • Received 9 May 2025, Revised 13 June 2025, Accepted 19 June 2025
Published on-line • 29 July 2025
E X P O R T C I T A T I O N
» RIS format (EndNote, ProCite, RefWorks, and most other reference management software)
» BibTeX (JabRef, BibDesk, and other BibTeX-specific software)
» Plain text