CodeTransBenchmark: evaluating LLM-based code translation and repair across programming languages
Vera Kowalczuk, Oliver Weißl, Severin Kacianka, Andrea Stocco
Key points
From the paper's conclusion- 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.
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.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- TransAgent: Enhancing LLM-Based Code Translation via Fine-Grained Execution AlignmentProceedings of the ACM on software engineering. · 2026
- Hallucinations of Large Language Models in Cross-Language Code Translation: Phenomena and MitigationarXiv · 2026
- A Survey of Code-to-Code Translation: From Statistical Rule-Based Systems to LLM AgentsAlgorithms · 2026
- Code–Test Co-translation: Towards Practical and Effective Program Migration in the WildProceedings of the ACM on Programming Languages · 2026
- HELO-APR: Enhancing Low-Resource Program Repair through Cross-Lingual Knowledge TransferProceedings of the ACM on software engineering. · 2026
- A Study on the Impact of Natural Language Differences in Prompts on Automatic Code Generation Using LLMsarXiv · 2026