ROSTrans: Empirically Benchmarking LLMs for ROS1-to-ROS2 Migration
作者: Yichen Zhao, Minghao Shao, Zhuoyan Yu, Yijun Shen, Boyuan Chen, Yik-Cheung Tam, Muhammad Shafique
分类: cs.SE, cs.AI
发布日期: 2026-10-30
💡 一句话要点
提出ROSTrans以评估大语言模型在ROS1到ROS2迁移中的表现
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大语言模型 ROS迁移 代码生成 基准评估 机器人软件 执行引导修复 性能评估
📋 核心要点
- 现有方法在ROS代码生成中面临复杂的节点协调和中间件配置等挑战,导致迁移后的代码正确性难以保证。
- 论文提出ROSTrans基准,通过108个任务评估大语言模型在ROS1到ROS2迁移中的表现,确保评估的公正性和可重复性。
- 实验结果显示,经过执行引导修复后,Claude Opus 4.6和GPT-5.5的任务成功率分别提升至49.1%和47.2%。
📝 摘要(中文)
尽管大语言模型在特定领域的代码生成中表现出色,但其在机器人软件开发,尤其是机器人操作系统(ROS)中的应用仍然未被充分探索。ROS代码生成面临复杂的节点协调、中间件配置和生命周期语义等独特挑战。本文提出ROSTrans,一个用于评估大语言模型在ROS1到ROS2代码迁移中的基准,涵盖108个任务,评估接口、行为和系统级的正确性。实验结果显示,六个前沿大语言模型的通过率低于10.9%,并且56.5%的样本在构建成功后在运行时失败。执行引导修复进一步提升了任务成功率。
🔬 方法详解
问题定义:本文旨在解决大语言模型在ROS1到ROS2迁移中的性能评估问题。现有方法未能有效处理ROS特有的复杂性,导致迁移后的代码在运行时可能出现错误。
核心思路:ROSTrans基准通过设计一系列具有挑战性的任务,评估大语言模型在ROS代码生成中的表现,确保每个任务都有可执行的参考实现,以此来提高评估的准确性和可靠性。
技术框架:ROSTrans包括108个任务,分为接口级、行为级和系统级的正确性评估。每个任务都有一个经过验证的ROS2实现和运行时测试套件,确保评估的可重复性。
关键创新:ROSTrans的创新在于其针对ROS特有的复杂性设计的基准任务,能够有效评估大语言模型在实际应用中的表现,而不仅仅依赖于编译时的正确性检查。
关键设计:每个任务的评估通过将候选模型生成的目标文件注入到固定的参考包中进行,确保候选模型不能影响测试结果。实验中还引入了执行引导修复技术,以提高成功率。
🖼️ 关键图片
📊 实验亮点
实验结果显示,六个前沿大语言模型在ROSTrans基准上的通过率低于10.9%,而56.5%的样本在构建成功后在运行时失败。通过执行引导修复,Claude Opus 4.6和GPT-5.5的任务成功率分别提升至49.1%和47.2%,显示出显著的改进。
🎯 应用场景
该研究的潜在应用领域包括机器人软件开发、自动化系统迁移和智能机器人设计等。ROSTrans基准为开发者提供了一个有效的工具,以评估和优化大语言模型在ROS环境中的应用,推动机器人技术的进步和普及。
📄 摘要(原文)
Although large language models have shown strong capabilities in domain-specific code generation, their performance in robotics software development, especially for the Robot Operating System (ROS), remains largely unexplored. ROS code generation presents distinctive challenges, including complex inter-node coordination, middleware configuration, and lifecycle semantics that go far beyond standard coding benchmarks, and many important correctness properties become observable only once migrated nodes are launched and communicate. We present ROSTrans, a benchmark for evaluating LLMs on ROS1-to-ROS2 code migration, a representative and practically important setting for ROS code generation. ROSTrans comprises 108 scaffolded completion tasks drawn from a diverse set of 70+ open-source ROS1 repositories and organized into a hierarchical taxonomy assessing interface-level, behavioral-level and system-level correctness. For every task we establish an executable reference: a verified ROS2 implementation, a runtime test suite that launches the nodes and exercises their topics, services, actions and parameters, and a container ensuring reproducibility. Candidates are scored by injecting only their target files into an otherwise fixed copy of the reference package, so a candidate can neither supply nor weaken the tests it is judged by. Evaluating six frontier LLMs over five stochastic generations per task, we find pass@1 below 10.9%, and that 56.5% of all samples build successfully and then fail at runtime,and 32.0% fail runtime assertions on the migrated interfaces, a class of error no compile-only oracle can detect. Execution-guided repair further improves task success, reaching 49.1% and 47.2% for Claude Opus 4.6 and GPT-5.5 after three rounds, respectively.