arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.07341cs.SEcs.LG
收藏

ReCodeAgent:一种多智能体工作流用于语言无关的大规模仓库翻译与验证

ReCodeAgent: A Multi-agent Workflow for Language-Agnostic Translation and Validation of Large-Scale Repositories

University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Amazon(亚马逊)

Ali Reza Ibrahimzada, Brandon Paulsen, Daniel Kroening, Reyhaneh Jabbarvand

AI总结:

ReCodeAgent通过多智能体方法实现大规模仓库代码翻译与验证的语言无关性,提升翻译正确率并降低成本,验证其效率和设计影响。

摘要:

大多数仓库级代码翻译和验证技术在单一源-目标编程语言对上进行评估,由于适应新语言对的工程工作量大。编程智能体可实现语言无关的仓库级代码翻译与验证:它们能合成多种语言的代码并自主使用各语言特定的工具。然而,现有技术尚未提供完全自动的智能体方法。本文提出ReCodeAgent,一种自主的多智能体方法。用户只需提供源语言的项目并指定目标语言,ReCodeAgent即可自动翻译和验证整个仓库。ReCodeAgent是首个在多种语言上实现高翻译成功率的技术。我们比较了ReCodeAgent与四种替代的神经符号和智能体方法,在118个真实项目上进行翻译测试,每个项目平均有1,975行代码和43个翻译单元。项目涵盖6种语言(C、Go、Java、JavaScript、Python和Rust)和4种语言对(C-Rust、Go-Rust、Java-Python、Python-JavaScript)。结果表明,ReCodeAgent在翻译正确性上持续优于先前技术,地面真实测试中测试通过率提高60.8%,平均成本为15.3美元。我们还对ReCodeAgent轨迹进行了过程中心分析以确认其过程效率。最后,我们研究了设计选择(多智能体 vs. 单智能体架构)如何影响ReCodeAgent性能:平均测试通过率下降40.4%,轨迹变长28%且持续低效。

英文摘要:

Most repository-level code translation and validation techniques have been evaluated on a single source-target programming language (PL) pair, owing to the complex engineering effort required to adapt new PL pairs. Programming agents can enable PL-agnosticism in repository-level code translation and validation: they can synthesize code across many PLs and autonomously use existing tools specific to each PL's analysis. However, state-of-the-art has yet to offer a fully autonomous agentic approach for repository-level code translation and validation of large-scale programs. This paper proposes ReCodeAgent, an autonomous multi-agent approach for language-agnostic repository-level code translation and validation. Users only need to provide the project in the source PL and specify the target PL for ReCodeAgent to automatically translate and validate the entire repository. ReCodeAgent is the first technique to achieve high translation success rates across many PLs. We compare the effectiveness of ReCodeAgent with four alternative neuro-symbolic and agentic approaches to translate 118 real-world projects, with 1,975 LoC and 43 translation units for each project, on average. The projects cover 6 PLs and 4 PL pairs. Our results demonstrate that ReCodeAgent consistently outperforms prior techniques on translation correctness, improving test pass rate by 60.8% on ground-truth tests, with an average cost of $15.3. We also perform process-centric analysis of ReCodeAgent trajectories to confirm its procedural efficiency. Finally, we investigate how the design choices (a multi-agent vs. single-agent architecture) influence ReCodeAgent performance: on average, the test pass rate drops by 40.4%, and trajectories become 28% longer and persistently inefficient.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑