ReCodeAgent实现跨语言代码仓库自动翻译与验证,无需人工干预。
ReCodeAgent: A Multi-agent Workflow for Language-Agnostic Translation and Validation of Large-Scale Repositories

- 采用多智能体协作架构,自主完成跨语言代码生成与工具调用。
- 在6种语言、4个语言对上平均测试通过率提升60.8%,成本仅15.3美元。
- 多智能体设计显著优于单智能体,效率提升28%以上。
现有代码仓库级翻译与验证技术多局限于单一源-目标编程语言对,因工程复杂度高难以扩展。编程智能体可实现语言无关的代码翻译与验证:能跨多种语言生成代码,并自主调用各语言专属分析工具。然而,当前尚无完全自治的多语言代码仓库翻译验证方法。本文提出ReCodeAgent,一种面向语言无关的仓库级代码翻译与验证的自主多智能体系统。用户仅需提供源语言项目并指定目标语言,系统即可自动完成整个仓库的翻译与验证。ReCodeAgent是首个在多种语言间实现高翻译成功率的技术。我们对比了四种神经符号与智能体方法,在118个真实项目上进行评估,每项目平均含1,975行代码和43个翻译单元,覆盖6种编程语言和4种语言对。结果表明,ReCodeAgent在翻译正确性上持续领先,地面测试通过率提升60.8%,平均成本为15.3美元。我们还对ReCodeAgent的执行轨迹进行过程分析,验证其流程效率。最后,探究设计选择(多智能体 vs 单智能体)的影响:平均测试通过率下降40.4%,轨迹长度增加28%且持续低效。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。