paperbot · PL 论文追踪

全部论文 待读 收藏

P2 RustRepoTrans: Repository-level Context Code Translation Benchmark Targeting Rust

RustRepoTrans:面向 Rust 的仓库级上下文代码翻译基准
ASE 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE)2025匹配度 4/10 · 论文是面向 LLM 的仓库级代码翻译基准,属于 PL+AI 的评测工作,但核心任务是代码翻译,与用户关注的静态分析、形式化验证、浮点/贝叶斯程序分析无直接关系;仅因涉及仓库级上下文、LLM 评测与缺乏 benchmark 的场景设计而有一定参考价值。引用 1 inbox
Guangsheng Ou, Mingwei Liu, Yuxuan Chen, Yanlin Wang, Xin Peng, Zibin Zheng
crossref: 2026-09-12

AI 速览

一句话:提出首个面向 Rust 的仓库级上下文增量代码翻译基准 RustRepoTrans,含 375 个任务与细粒度评测框架。

现有代码翻译评测多集中于无依赖的函数级任务,或直接进行完整仓库翻译而超出模型能力,也未覆盖将新增/修改模块增量翻译到 Rust 等低资源目标语言的场景。本文提出 RustRepoTrans,首个面向增量翻译的仓库级上下文代码翻译基准,包含 375 个从 C、Java、Python 翻译到 Rust 的任务,并设计更细粒度的评测指标与增强评测框架。作者评测了 7 个代表性 LLM 并进行错误分析:DeepSeek-R1 表现最佳,Pass@1 为 51.5%,在基本功能、噪声鲁棒性和语法差异识别上均较好;但相比无仓库上下文基准,其 Pass@1 从 73.7% 降至 51.5%,下降 22.2 个百分点,表明仓库级上下文仍是显著挑战。

问题
现有代码翻译基准缺乏仓库级依赖上下文,或全仓库翻译难度过高,且未考虑新增/修改模块的增量翻译与向 Rust 等低资源语言翻译的场景。
方法
构建 RustRepoTrans 基准,含 375 个从 C/Java/Python 到 Rust 的增量翻译任务,并提出更细粒度评价指标与增强评测框架,对 7 个代表性 LLM 进行评测与错误分析。
评估
在 375 个任务上以 Pass@1 等指标评测 7 个 LLM;DeepSeek-R1 最佳达 51.5% Pass@1,但相较无仓库上下文基准下降 22.2 个百分点。
原文摘要(Abstract)

Recent advancements in large language models (LLMs) have demonstrated impressive capabilities in code translation, typically evaluated using benchmarks like CodeTransOcean and RepoTransBench. However, dependency-free benchmarks fail to capture real-world complexities by focusing primarily on simple function-level translations and overlooking repository-level context (e.g., dependencies). Full-repository translation benchmarks significantly exceed the current capabilities of existing models, resulting in performance bottlenecks that fail to provide actionable insights for guiding model development. Furthermore, existing benchmarks do not account for the scenario of incrementally translating new or modified modules from the source to the target language, which demands careful handling of repository-level contexts such as dependencies, cross-module references, and architectural divergence. Moreover, LLMs’ effectiveness in translating to newer, low-resource languages like Rust remains largely underexplored.To address these gaps, we introduce RustRepoTrans, the first repository-level context code translation benchmark targeting incremental translation, comprising 375 tasks translating into Rust from C, Java, and Python. Using this benchmark, we evaluate seven representative LLMs, analyzing their errors to assess limitations in complex translation scenarios. Among them, DeepSeek-R1 performs best with 51.5% Pass@1, excelling in both basic functionality and additional translation abilities, such as noise robustness and syntactical difference identification. However, even DeepSeek-R1 experiences a 22.2% performance drop (Pass@1 from 73.7% to 51.5%) when handling repository-level context compared to previous benchmarks without such context. Meanwhile, we propose a set of more fine-grained evaluation metrics and an enhanced evaluation framework, enabling a more comprehensive analysis of LLMs’ performance in repository-level context code translation tasks to provide fine-grained insights that can effectively inform the development of code translation techniques.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot9473,
  title = {RustRepoTrans: Repository-level Context Code Translation Benchmark Targeting Rust},
  author = {Guangsheng Ou and Mingwei Liu and Yuxuan Chen and Yanlin Wang and Xin Peng and Zibin Zheng},
  booktitle = {ASE},
  year = {2025},
  doi = {10.1109/ase63991.2025.00057}
}