How Can LLMs and Knowledge Graphs Contribute to Robot Safety? A Few-Shot Learning Approach
Abdulrahman Althobaiti, Angel Ayala, JingYing Gao, Ali Almutairi, Mohammad Deghat, Imran Razzak, Francisco Cruz
TL;DR
The paper tackles safety risks in NLP-driven drone control by introducing a safety layer that verifies LLM-generated code before execution. It combines Few-Shot learning to fine-tune GPT-4o for safe/unsafe code classification with Knowledge Graph Prompting to inject CASA drone regulations, evaluated in the AirSim environment. A 100-sample, four-category dataset is created and used to show that the fine-tuned, KG-enhanced classifier improves unsafe-command detection and binding safety, with constraints such as a maximum altitude of $120$ m and minimum distances of $30$ m. The work demonstrates that integrating domain-specific knowledge graphs with LLM reasoning can enhance safety in robot control without retraining base models, guiding safer NLP-driven robotics in dynamic outdoor settings.
Abstract
Large Language Models (LLMs) are transforming the robotics domain by enabling robots to comprehend and execute natural language instructions. The cornerstone benefits of LLM include processing textual data from technical manuals, instructions, academic papers, and user queries based on the knowledge provided. However, deploying LLM-generated code in robotic systems without safety verification poses significant risks. This paper outlines a safety layer that verifies the code generated by ChatGPT before executing it to control a drone in a simulated environment. The safety layer consists of a fine-tuned GPT-4o model using Few-Shot learning, supported by knowledge graph prompting (KGP). Our approach improves the safety and compliance of robotic actions, ensuring that they adhere to the regulations of drone operations.
