AlphaTrans: A Neuro-Symbolic Compositional Approach for Repository-Level Code Translation and Validation
Ali Reza Ibrahimzada, Kaiyao Ke, Mrigank Pawagi, Muhammad Salman Abid, Rangeet Pan, Saurabh Sinha, Reyhaneh Jabbarvand
Abstract
Code translation transforms programs from one programming language (PL) to another. One prominent use case is application modernization to enhance maintainability and reliability. Several rule-based transpilers have been designed to automate code translation between different pairs of PLs. However, the rules can become obsolete as the PLs evolve and cannot generalize to other PLs. Recent studies have explored the automation of code translation using Large Language Models (LLMs). One key observation is that such techniques may work well for crafted benchmarks but fail to generalize to the scale and complexity of real-world projects with inter- and intra-class dependencies, custom types, PL-specific features, etc. We propose AlphaTrans, a neuro-symbolic approach to automate repository-level code translation. AlphaTrans translates both source and test code, and employs multiple levels of validation to ensure the translation preserves the functionality of the source program. To break down the problem for LLMs, AlphaTrans leverages program analysis to decompose the program into fragments and translates them in the reverse call order . We leveraged AlphaTrans to translate ten real-world open-source projects consisting of ⟨836, 8575, 2719⟩ (application and test) classes, (application and test) methods, and unit tests. AlphaTrans breaks down these projects into 17874 fragments and translates the entire repository. 96.40% of the translated fragments are syntactically correct, and AlphaTrans validates the translations’ runtime behavior and functional correctness for 27.03% and 25.14% of the application method fragments. On average, integrated translation and validation takes 34 hours (min=3, max=121) to translate a project, showing its scalability in practice. For the syntactically or semantically incorrect translations, AlphaTrans generates a report including existing translation, stack trace, test errors, or assertion failures. We provided these artifacts to two developers to fix the translation bugs in four projects. They fixed the issues in 20.1 hours on average (5.5 hours for the smallest and 34 hours for the largest project) and achieved all passing tests. Without AlphaTrans, translating and validating such big projects could take weeks, if not months.
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.
12 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
- Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code cites Leveraging Automated Unit Tests for Unsupervised Code Translation
- Program Skeletons for Automated Program Translation cites Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code
- Program Skeletons for Automated Program Translation cites Unsupervised Translation of Programming Languages
- Program Skeletons for Automated Program Translation cites Leveraging Automated Unit Tests for Unsupervised Code Translation
- Exploring and Unleashing the Power of Large Language Models in Automated Code Translation cites Unsupervised Translation of Programming Languages
- Exploring and Unleashing the Power of Large Language Models in Automated Code Translation cites Leveraging Automated Unit Tests for Unsupervised Code Translation
- TRACE: Evaluating Execution Efficiency of LLM-Based Code Translation cites Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code
- TRACE: Evaluating Execution Efficiency of LLM-Based Code Translation cites Exploring and Unleashing the Power of Large Language Models in Automated Code Translation
- TRACE: Evaluating Execution Efficiency of LLM-Based Code Translation cites Leveraging Automated Unit Tests for Unsupervised Code Translation
- 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 Program Skeletons for Automated Program Translation
- 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
- TransAgent: Enhancing LLM-Based Code Translation via Fine-Grained Execution Alignment cites Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code
- TransAgent: Enhancing LLM-Based Code Translation via Fine-Grained Execution Alignment cites Exploring and Unleashing the Power of Large Language Models in Automated Code Translation
- TransAgent: Enhancing LLM-Based Code Translation via Fine-Grained Execution Alignment cites Unsupervised Translation of Programming Languages
- TransAgent: Enhancing LLM-Based Code Translation via Fine-Grained Execution Alignment cites Leveraging Automated Unit Tests for Unsupervised Code Translation
- Leveraging Automated Unit Tests for Unsupervised Code Translation cites Unsupervised Translation of Programming Languages
Cited by top-tier papers12
- 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
- TRACE: Evaluating Execution Efficiency of LLM-Based Code TranslationZhihao Gong, Zeyu Sun, Dong Huang, Qingyuan Liang et al.ACL 2026 · 5 citations
- TransAgent: Enhancing LLM-Based Code Translation via Fine-Grained Execution AlignmentZhiqiang Yuan, Weitong Chen, Hanlin Wang, Xin Peng et al.FSE 2026 · 4 citations
- Program Skeletons for Automated Program TranslationBo Wang, Tianyu Li, Ruishi Li, Umang Mathur et al.PLDI 2025 · 3 citations
- EnCompass: Enhancing Agent Programming with Search Over Program Execution PathsZhening Li, Armando Solar-Lezama, Yisong Yue, Stephan ZhengNeurIPS 2025 · 2 citations
Builds on10
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni et al.NeurIPS 2020 · 19,162 citations
- Unsupervised Translation of Programming LanguagesBaptiste Rozière, Marie-Anne Lachaux, Lowik Chanussot, Guillaume LampleNeurIPS 2020 · 606 citations
- Leveraging Automated Unit Tests for Unsupervised Code TranslationBaptiste Rozière, Jie Zhang, François Charton, Mark Harman et al.ICLR 2022 · 161 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
Related papers
- INTERTRANS: Leveraging Transitive Intermediate Translations to Enhance LLM-Based Code TranslationMarcos Macedo, Yuan Tian, Pengyu Nie, Filipe Roseiro Côgo et al.ICSE 2025 · 7 citations
- Multilingual Code Co-evolution using Large Language ModelsJiyang Zhang, Pengyu Nie, Junyi Jessy Li, Milos GligoricFSE 2023 · 34 citations
- Polyglot: An Extensible Framework to Benchmark Code Translation with LLMsMarco Vieira, Priyam Ashish Shah, Bhavain Shah, Rrezarta KrasniqiASE 2025
- AVATAR: A Parallel Corpus for Java-Python Program TranslationWasi Uddin Ahmad, Md Golam Rahman Tushar, Saikat Chakraborty, Kai-Wei ChangACL Findings 2023 · 46 citations
- CodeTransOcean: A Comprehensive Multilingual Benchmark for Code TranslationWeixiang Yan, Yuchen Tian, Yunzhe Li, Qian Chen et al.EMNLP Findings 2023 · 32 citations
