RustRepoTrans: Repository-level Context Code Translation Benchmark Targeting Rust
Guangsheng Ou, Mingwei Liu, Yuxuan Chen, Yanlin Wang, Xin Peng, Zibin Zheng
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.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
5 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code cites Unsupervised Translation of Programming Languages
- Unlocking LLM Repair Capabilities Through Cross-Language Translation and Multi-Agent Refinement cites Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code
- Unlocking LLM Repair Capabilities Through Cross-Language Translation and Multi-Agent Refinement cites Unsupervised Translation of Programming Languages
- Exploring and Unleashing the Power of Large Language Models in Automated Code Translation cites Unsupervised Translation of Programming Languages
- MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and Repair cites Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code
- MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and Repair cites Exploring and Unleashing the Power of Large Language Models in Automated Code Translation
- MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and Repair cites Unsupervised Translation of Programming Languages
- TransLibEval: Demystify Large Language Models' Capability in Third-Party Library-Targeted Code Translation cites Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code
- TransLibEval: Demystify Large Language Models' Capability in Third-Party Library-Targeted Code Translation cites Exploring and Unleashing the Power of Large Language Models in Automated Code Translation
- TransLibEval: Demystify Large Language Models' Capability in Third-Party Library-Targeted Code Translation cites Unsupervised Translation of Programming Languages
Cited by top-tier papers5
- MatchFixAgent: Language-Agnostic Autonomous Repository-Level Code Translation Validation and RepairAli Reza Ibrahimzada, Brandon Paulsen, Reyhaneh Jabbarvand, Joey Dodds et al.ICML 2026 · 9 citations
- TransLibEval: Demystify Large Language Models' Capability in Third-Party Library-Targeted Code TranslationPengyu Xue, Kunwu Zheng, Zhen Yang, Yifei Pei et al.FSE 2026 · 1 citation
- Evaluating and Improving Automated Repository-Level Rust Issue Resolution with LLM-based AgentsJiahong Xiang, Wenxiao He, Xihua Wang, Hongliang Tian et al.ICSE 2026
- Unlocking LLM Repair Capabilities Through Cross-Language Translation and Multi-Agent RefinementWenqiang Luo, Jacky Wai Keung, Boyang Yang, Jacques Klein et al.ICSE 2026
- RepoReasoner: Evaluating Repository-Level Code Reasoning Ability of Long-Context Language ModelsYanlin Wang, Suiquan Wang, Yanli Wang, Bowen Zhang et al.FSE 2026
Builds on11
- Unsupervised Translation of Programming LanguagesBaptiste Rozière, Marie-Anne Lachaux, Lowik Chanussot, Guillaume LampleNeurIPS 2020 · 606 citations
- Using an LLM to Help With Code UnderstandingDaye Nam, Andrew Macvean, Vincent J. Hellendoorn, Bogdan Vasilescu et al.ICSE 2024 · 264 citations
- Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating CodeRangeet Pan, Ali Reza Ibrahimzada, Rahul Krishna, Divya Sankar et al.ICSE 2024 · 96 citations
- Exploring and Unleashing the Power of Large Language Models in Automated Code TranslationZhen Yang, Fang Liu, Zhongxing Yu, Jacky Wai Keung et al.FSE 2024 · 72 citations
- Demystifying LLM-Based Software Engineering AgentsChunqiu Steven Xia, Yinlin Deng, Soren Dunn, Lingming ZhangFSE 2025 · 36 citations
Related papers
- Can Language Models Replace Programmers for Coding? REPOCOD Says 'Not Yet'Shanchao Liang, Nan Jiang, Yiran Hu, Lin TanACL 2025 · 9 citations
- Scalable, Validated Code Translation of Entire Projects using Large Language ModelsHanliang Zhang, Cristina David, Meng Wang, Brandon Paulsen et al.PLDI 2025 · 15 citations
- DI-BENCH: Benchmarking Large Language Models on Dependency Inference with Testable Repositories at ScaleLinghao Zhang, Junhao Wang, Shilin He, Chaoyun Zhang et al.ACL Findings 2025 · 2 citations
- DependEval: Benchmarking LLMs for Repository Dependency UnderstandingJunjia Du, Yadi Liu, Hongcheng Guo, Jiawei Wang et al.ACL Findings 2025 · 2 citations
- Polyglot: An Extensible Framework to Benchmark Code Translation with LLMsMarco Vieira, Priyam Ashish Shah, Bhavain Shah, Rrezarta KrasniqiASE 2025
