CodeTransBenchmark: evaluating LLM-based code translation and repair across programming languages
Authors:
Open Access
- 3 November 2026
- journal article
- research article
- Published by Springer Nature in Empirical Software Engineering
- Vol. 32 (2) , 55
Abstract
Large Language Models (LLMs) pre-trained on expansive text and code corpora have revealed promising code generation abilities and have attracted increasing attention in code translation. In this work, we investigate the effectiveness of LLMs in code translation and translation error repair. First, we present CodeTransBenchmark, a framework for evaluating LLM-based translation and repair and devise a post-processing strategy to extract code from inconsistent LLM outputs. Then, we discuss an empirical study evaluates eight models on three datasets and 12 language pairs, in which we categorize incorrect translations by errors to identify weaknesses of existing LLMs. Our work shows that while LLMs specifically trained for multi-lingual coding, like Codestral, correctly translate the majority of code, most general-purpose models struggle with the syntactic rules of the target language. The analysis of erroneous translations reveals the substantial impact of the interrelationship between involved programming languages and training data on the effectiveness. We show that a general post-processing approach must tolerate inconsistencies and leverage the predictability of LLM answers. Further, we show that iterative translation repair via automated feedback significantly improves translation accuracy. While our combined findings highlight the potential of LLMs to automate code translation, an effective deployment of LLM-based code translation in practice would require models with larger context windows.Keywords
This publication has 62 references indexed in Scilit:
- Unleashing the potential of prompt engineering for large language modelsPatterns, 2025
- On the Evaluation of Neural Code Translation: Taxonomy and Benchmark2023
- Large Language Models for Software Engineering: Survey and Open Problems2023
- Syntax and Domain Aware Model for Unsupervised Program Translation2023
- Array programming with NumPyNature, 2020
- SciPy 1.0: fundamental algorithms for scientific computing in PythonNature Methods, 2020
- CRUST: A C/C++ to Rust Transpiler Using a “Nano-parser Methodology” to Avoid C/C++ Safety Issues in Legacy Code2019
- Divide-and-Conquer Approach for Multi-phase Statistical Migration for Source Code (T)2015
- Statistical Machine Translation2009
- LLVM: A compilation framework for lifelong program analysis & transformation2004