Abstract
Robotics researchers increasingly leverage large language models (LLM) in robotics systems, using them as interfaces to receive task commands, generate task plans, form team coalitions, and allocate tasks among multi-robot and human agents. However, despite their benefits, the growing adoption of LLM in robotics has raised several safety concerns, particularly regarding executing malicious or unsafe natural language prompts. In addition, ensuring that task plans, team formation, and task allocation outputs from LLMs are adequately examined, refined, or rejected is crucial for maintaining system integrity. In this paper, we introduce SafePlan, a multi-component framework that combines formal logic and chain-of-thought reasoners for enhancing the safety of LLM-based robotics systems. Using the components of SafePlan, including Prompt Sanity COT Reasoner and Invariant, Precondition, and Postcondition COT reasoners, we examined the safety of natural language task prompts, task plans, and task allocation outputs generated by LLM-based robotic systems as means of investigating and enhancing system safety profile. Our results show that SafePlan outperforms baseline models by leading to 90.5% reduction in harmful task prompt acceptance while still maintaining reasonable acceptance of safe tasks.
Introduction
As robotics systems move toward accepting natural language commands—such as "Place this basketball on grandma’s seat"—a significant safety gap has emerged. While standard LLMs are often fine-tuned via Reinforcement Learning from Human Feedback (RLHF) to avoid generating offensive text, they frequently lack a deep understanding of physical safety and contextual risk in a robotic environment.
For instance, an LLM may recognize "bleach" as a cleaning agent but fail to realize that "Give the bottle under the sink to the toddler" is a catastrophic command. Current robotic planning systems often prioritize capability over safety, failing to verify if a generated plan violates physical invariants. SafePlan addresses this by creating a logic-based filter that scrutinizes tasks before a robot ever initiates physical movement.
The SafePlan Framework
The SafePlan architecture is a multi-stage framework that combines LLM reasoning with formal logic structures to ensure safety at every level of the planning process.
1. Prompt Sanity Checking COT Reasoner
Before planning begins, the prompt is passed through three hierarchical layers of "deontic" logic to classify actions as Forbidden or Permissible:
- Societal Alignment (Layer S): Checks against general laws and fundamental safety (e.g., "Do not cause physical harm").
- Organizational Alignment (Layer O): Checks against workplace or group-specific rules.
- Individual Alignment (Layer I): The finest grain, checking if an action harms a specific person based on their unique capabilities (e.g., "Do not give hot coffee to a baby").
2. Invariant COT Reasoner
For prompts deemed safe, the system generates formal specifications based on Linear Temporal Logic (LTL). It identifies Invariants (conditions that must remain true throughout), Preconditions (requirements before an action starts), and Postconditions (the expected state after an action).
3. Code Generation and Verification
These logical constraints serve as few-shot examples to guide a second LLM in writing robot control code. Finally, a third LLM acts as a verifier, checking the generated code against the original logical constraints to ensure no safety violations were introduced during the coding phase.
Experimental Evaluation
The researchers evaluated SafePlan using two primary methods:
- SafePlan Benchmark: An expert-curated dataset of 621 task prompts across assistive, navigation, and manipulation domains. Each task is labeled as "safe" or "unsafe" to test the system's discrimination ability.
- AI2-THOR Simulation: A physics-based simulator used to test 18 specific tasks across categories like Scene Reasoning and Skill Reasoning to observe if generated plans result in environmental "crashes."
Results and Discussion
SafePlan demonstrated a significant improvement over baseline models in both safety and reliability:
- Harm Reduction: The framework led to a 90.5% reduction in the acceptance of harmful task prompts.
- Classification Accuracy: Using Gemini 1.5 Pro, SafePlan achieved 88.4% accuracy in classifying tasks, whereas baseline models struggled to distinguish between safe and unsafe requests.
- Simulation Success: In AI2-THOR tests, the baseline GPT-4o model had a success rate of only 22% due to high crash rates. With SafePlan, success rates jumped to 95%, as the system intercepted erroneous code before execution.
- Ethical-to-Unethical (E/U) Ratio: SafePlan improved the E/U acceptance ratio from ~1.6 (baseline) to 10.0, demonstrating a much sharper "moral compass" in task selection.
Conclusion
SafePlan highlights that LLMs are significantly more effective at ensuring safety when forced to reason through formal logic (Invariants and Preconditions) rather than relying on natural language alone. While the current framework relies on static scene descriptions and introduces some latency due to multi-stage reasoning, it provides a robust foundation for future work in dynamic, real-world robotic environments.
Summary updated