

Paper: 2602.24235 Authors: Jialiang Fan, Weizhe Xu, Mengyu Liu, Oleg Sokolsky, Insup Lee, Fangxin Kong Categories: cs.RO, cs.AI
Abstract
Safety-critical task planning for robotic systems faces a fundamental trilemma: classical planners lack scalability, reinforcement learning methods fail to generalize, and base large language models cannot guarantee safety constraints. SafeGen-LLM addresses this challenge through a two-stage post-training framework that enables LLMs to generate safe, constraint-compliant plans while generalizing to novel safety properties across multiple domains. The approach constructs a multi-domain PDDL3 benchmark with explicit safety constraints, then applies supervised fine-tuning on constraint-compliant planning data followed by Group Relative Policy Optimization guided by formal verification-derived reward machines and curriculum learning. Experimental results demonstrate that SafeGen-LLM achieves superior safety generalization and outperforms frontier proprietary models across diverse planning tasks and input formats.
Key Contributions
- Construction of a comprehensive multi-domain PDDL3 benchmark with explicit safety constraints for evaluating safety-aware task planning
- A two-stage post-training framework combining SFT for planning syntax/semantics learning and GRPO for safety alignment
- Integration of fine-grained reward machines derived from formal verification to guide reinforcement learning toward safety-compliant solutions
- Curriculum learning strategy to progressively handle increasingly complex planning tasks
- Demonstration of strong safety generalization to novel constraints across multiple domains and input modalities
Methodology and Technical Framework
The SafeGen-LLM framework operates through a carefully designed two-stage training pipeline. In the first stage, supervised fine-tuning is applied to a base LLM using a curated dataset of constraint-compliant planning examples. This stage teaches the model the syntax and semantics of PDDL3, including how to represent states, actions, preconditions, effects, and crucially, safety constraints.
The second stage employs Group Relative Policy Optimization (GRPO), a reinforcement learning technique that optimizes the model’s policy relative to groups of generated plans. What distinguishes this approach is the use of reward machines—formal structures derived from the safety constraints through automated verification tools. These reward machines provide fine-grained feedback signals that guide the model toward plans that satisfy safety properties while achieving task objectives.
The curriculum learning component progressively increases task complexity, allowing the model to build competence on simpler problems before tackling more challenging scenarios. This staged approach prevents the model from being overwhelmed by complex constraint interactions early in training and improves overall convergence.
Experimental Results and Performance Analysis
SafeGen-LLM was evaluated across multiple planning domains including logistics, manufacturing, autonomous driving, and healthcare robotics. The benchmark includes both seen and unseen safety constraints to test generalization capabilities. Results show that SafeGen-LLM achieves significantly higher safety satisfaction rates compared to base LLMs and even frontier proprietary models like GPT-4 and Claude.
Particularly notable is the model’s ability to generalize to novel safety properties not encountered during training. When presented with new constraint types, SafeGen-LLM maintains high compliance rates, suggesting that the training framework instills a deeper understanding of safety reasoning rather than mere memorization of specific constraints.
The framework also demonstrates robustness across different input formats. Whether receiving formal PDDL specifications or natural language descriptions of planning problems, SafeGen-LLM generates plans that respect safety boundaries while achieving task goals. This flexibility is crucial for real-world deployment where users may not be familiar with formal specification languages.
Performance metrics indicate that the GRPO stage with reward machines is essential for achieving high safety compliance. Ablation studies show that removing either the formal verification-derived rewards or the curriculum learning component results in degraded performance, validating the importance of each architectural choice.
Implications for Safe Robotic Systems
This work has significant implications for deploying LLMs in safety-critical robotic applications. Traditional approaches to safe planning either sacrifice scalability (classical planners) or struggle with generalization (RL methods). SafeGen-LLM demonstrates that LLMs can be effectively aligned with safety requirements through appropriate training frameworks, opening new possibilities for flexible yet safe autonomous systems.
The formal verification integration is particularly important. By grounding the training process in mathematically rigorous safety specifications, the approach provides stronger guarantees than purely data-driven methods. This bridges the gap between the flexibility of learned models and the reliability requirements of safety-critical systems.
The generalization capabilities suggest that SafeGen-LLM could adapt to new operational contexts with minimal retraining. As robotic systems encounter novel environments and constraints, the model’s ability to reason about unfamiliar safety properties becomes invaluable. This could accelerate deployment timelines and reduce the engineering effort required to adapt systems to new scenarios.
Takeaways
-
SafeGen-LLM successfully combines the flexibility of LLMs with formal safety guarantees through a two-stage training framework integrating SFT and GRPO with verification-derived reward machines.
-
The approach achieves strong generalization to novel safety constraints across multiple domains, addressing a critical limitation of both classical planners and pure RL methods.
-
Integration of formal verification into the training loop provides mathematically grounded safety alignment, bridging learned flexibility with reliability requirements.
-
Curriculum learning proves essential for handling complex planning tasks with multiple interacting constraints, enabling progressive skill development.
-
The framework’s robustness across input formats (PDDL and natural language) enhances practical applicability for users with varying technical backgrounds.
-
Experimental results demonstrate superiority over frontier proprietary models, suggesting that specialized training frameworks can outperform general-purpose LLMs in safety-critical domains.
论文: 2602.24235 作者: Jialiang Fan, Weizhe Xu, Mengyu Liu, Oleg Sokolsky, Insup Lee, Fangxin Kong 分类: cs.RO, cs.AI
摘要
机器人系统的安全关键任务规划面临一个根本性的三难困境:经典规划器缺乏可扩展性,强化学习方法泛化能力不足,而基础大语言模型无法保证安全约束。SafeGen-LLM通过两阶段后训练框架解决了这一挑战,使大语言模型能够生成安全且符合约束的规划方案,同时对跨多个领域的新安全属性具有泛化能力。该方法构建了包含显式安全约束的多领域PDDL3基准测试集,然后在符合约束的规划数据上进行监督微调,随后采用由形式化验证衍生的奖励机和课程学习引导的群体相对策略优化。实验结果表明,SafeGen-LLM实现了卓越的安全泛化能力,在多样化的规划任务和输入格式上优于前沿专有模型。
主要贡献
- 构建了包含显式安全约束的综合性多领域PDDL3基准测试集,用于评估安全感知任务规划
- 提出了结合SFT学习规划语法语义和GRPO实现安全对齐的两阶段后训练框架
- 集成了从形式化验证衍生的细粒度奖励机,引导强化学习朝向安全合规解决方案
- 采用课程学习策略逐步处理日益复杂的规划任务
- 展示了对跨多个领域和输入模态的新约束的强大安全泛化能力
方法论与技术框架
SafeGen-LLM框架通过精心设计的两阶段训练流程运作。在第一阶段,使用精选的符合约束的规划示例数据集对基础大语言模型进行监督微调。这一阶段教会模型PDDL3的语法和语义,包括如何表示状态、动作、前置条件、效果,以及至关重要的安全约束。
第二阶段采用群体相对策略优化(GRPO),这是一种相对于生成规划组优化模型策略的强化学习技术。该方法的独特之处在于使用奖励机——通过自动化验证工具从安全约束衍生的形式化结构。这些奖励机提供细粒度的反馈信号,引导模型在实现任务目标的同时生成满足安全属性的规划。
课程学习组件逐步增加任务复杂度,使模型能够在处理更具挑战性的场景之前先在简单问题上建立能力。这种分阶段方法防止模型在训练早期被复杂的约束交互所压倒,并改善整体收敛性。
实验结果与性能分析
SafeGen-LLM在多个规划领域进行了评估,包括物流、制造、自动驾驶和医疗机器人。基准测试包括已见和未见的安全约束,以测试泛化能力。结果显示,与基础大语言模型甚至GPT-4和Claude等前沿专有模型相比,SafeGen-LLM实现了显著更高的安全满足率。
特别值得注意的是模型对训练期间未遇到的新安全属性的泛化能力。当面对新的约束类型时,SafeGen-LLM保持了高合规率,表明训练框架灌输了对安全推理的深层理解,而非仅仅记忆特定约束。
该框架还展示了跨不同输入格式的鲁棒性。无论接收正式的PDDL规范还是规划问题的自然语言描述,SafeGen-LLM都能生成尊重安全边界同时实现任务目标的规划。这种灵活性对于实际部署至关重要,因为用户可能不熟悉形式化规范语言。
性能指标表明,带有奖励机的GRPO阶段对于实现高安全合规性至关重要。消融研究显示,移除形式化验证衍生的奖励或课程学习组件都会导致性能下降,验证了每个架构选择的重要性。
对安全机器人系统的意义
这项工作对在安全关键机器人应用中部署大语言模型具有重要意义。传统的安全规划方法要么牺牲可扩展性(经典规划器),要么在泛化方面存在困难(强化学习方法)。SafeGen-LLM证明了通过适当的训练框架,大语言模型可以有效地与安全要求对齐,为灵活且安全的自主系统开辟了新的可能性。
形式化验证的集成尤为重要。通过将训练过程建立在数学上严格的安全规范基础上,该方法提供了比纯数据驱动方法更强的保证。这弥合了学习模型的灵活性与安全关键系统的可靠性要求之间的差距。
泛化能力表明SafeGen-LLM可以以最少的重新训练适应新的操作环境。当机器人系统遇到新环境和约束时,模型对不熟悉安全属性的推理能力变得非常宝贵。这可以加快部署时间表,并减少使系统适应新场景所需的工程工作量。
要点总结
-
SafeGen-LLM通过集成SFT和带有验证衍生奖励机的GRPO的两阶段训练框架,成功结合了大语言模型的灵活性与形式化安全保证。
-
该方法实现了对跨多个领域的新安全约束的强泛化能力,解决了经典规划器和纯强化学习方法的关键局限性。
-
将形式化验证集成到训练循环中提供了数学上有根据的安全对齐,弥合了学习灵活性与可靠性要求之间的桥梁。
-
课程学习被证明对处理具有多个交互约束的复杂规划任务至关重要,实现了渐进式技能发展。
-
该框架在输入格式(PDDL和自然语言)上的鲁棒性增强了对不同技术背景用户的实际适用性。
-
实验结果表明优于前沿专有模型,表明专门的训练框架可以在安全关键领域超越通用大语言模型。