Cited by 135Software Engineering ResearchNatural Language Processing TechniquesSoftware Testing and Debugging Techniques

The DOI matches its Crossref record; 74 of the 74 references it cites were found in a registry or an index; 4 of the 12 sources its claims cite were checked for support.

Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code

Open access
Pan, Rangeet, Ibrahimzada, Ali Reza, Krishna, Rahul, Sankar, Divya, Wassi, Lambert Pouguem, Merler, Michele, Sobolev, Boris, Pavuluri, Raju, Sinha, Saurabh, Jabbarvand, Reyhaneh·2024·Proceedings of the IEEE/ACM 46th International Conference on Software Engineering

Abstract

Code translation aims to convert source code from one programming language (PL) to another. Given the promising abilities of large language models (LLMs) in code synthesis, researchers are exploring their potential to automate code translation. The prerequisite for advancing the state of LLM-based code translation is to understand their promises and limitations over existing techniques. To that end, we present a large-scale empirical study to investigate the ability of general LLMs and code LLMs for code translation across pairs of different languages, including C, C++, Go, Java, and Python. Our study, which involves the translation of 1,700 code samples from three benchmarks and two real-world projects, reveals that LLMs are yet to be reliably used to automate code translation---with correct translations ranging from 2.1% to 47.3% for the studied LLMs. Further manual investigation of unsuccessful translations identifies 15 categories of translation bugs. We also compare LLM-based code translation with traditional non-LLM-based approaches. Our analysis shows that these two classes of techniques have their own strengths and weaknesses. Finally, insights from our study suggest that providing more context to LLMs during translation can help them produce better results. To that end, we propose a prompt-crafting approach based on the symptoms of erroneous translations; this improves the performance of LLM-based code translation by 5.5% on average. Our study is the first of its kind, in terms of scale and breadth, that provides insights into the current limitations of LLMs in code translation and opportunities for improving them. Our dataset---consisting of 1,700 code samples in five PLs with 10K+ tests, 43K+ translated code, 1,748 manually labeled bugs, and 1,365 bug-fix pairs---can help drive research in this area.

Overview

AI snapshot

Written from the paper’s full text.

TL;DR

This empirical study evaluates general and code LLMs for translating code across C, C++, Go, Java, and Python, finding that correct translations range from 2.1% to 47.3% and that LLMs are not yet reliable for automating code translation. It contributes a 15-category taxonomy of translation bugs, compares LLM and non-LLM translation, and shows iterative prompt crafting can improve success rates.

Key findings

  • Across 43,379 translations, average success was 11.94% (median 5.3%); GPT-4 was best at 47.3%, followed by StarCoder at 14.5%, while real-world project success was 8.1% for GPT-4 and 0% for the other models.
  • Most unsuccessful translations were compilation errors (77.8%), followed by functional errors (13.4%); data-related bugs accounted for 33.5% of bugs, syntactic/semantic differences 30.5%, and dependency/logic bugs 24.2%.
  • Manual analysis produced a taxonomy of 15 bug categories in five groups, built from 1,748 unsuccessful GPT-4 translations and taking about 630 person-hours.
  • Iterative prompt crafting increased success by 5.5% on average across studied LLMs, with GPT-4 improving by 12.33% at iteration 1 and 1.7% at iteration 2; non-LLM C2Rust achieved 95% success for C-to-Rust versus GPT-4’s 61%, while GPT-4 achieved 54.1% for Java-to-C# versus JavaToCSharp producing no compilable translations.

Methods

  • Empirical study using 1,700 executable code samples from CodeNet, Avatar, EvalPlus, Apache Commons CLI, and Python Click, covering C, C++, Go, Java, and Python, with 6,197 translation problems across 31 language pairs.
  • Seven LLMs were evaluated: GPT-4, Llama 2, TheBloke-Vicuna, TheBloke-Airoboros, StarCoder, CodeGeeX, and CodeGen; a translation was considered successful if it compiled, passed runtime checks, and passed existing tests.
  • Bug taxonomy was built manually by eight labelers in two phases, and prompt crafting was evaluated iteratively on CodeGen, StarCoder, GPT-4, and Llama 2.

Limitations

  • Stated: external validity is limited by the selected PLs, LLMs, and datasets; internal validity is threatened because each translation was performed once, no formal inter-rater reliability metric was used for manual labeling, and automation scripts could contain bugs; construct validity is threatened because weak test suites may let buggy translations pass, especially CodeNet with one test case per sample.
  • Stated: the taxonomy focused on GPT-4 translations, and prompt crafting excluded CodeGeeX, TheBloke-Airoboros, and TheBloke-Vicuna.
  • Evident from the text: real-world evaluation is limited to two projects and only Java/Python, and the paper notes that it is hard to generalize from limited observations on real-world project complexity.

Model-written summary. Check it against the paper before relying on it.

Integrity signals

Registry

Crossref · 10.1145/3597503.3639226

Cites

74 of 74 references verified0 citation errors · 0 not checkable

Statistics

Nothing to recompute.

Verification

Claims the paper makes

73 Own result · 46 Own interpretation · 12 Own method · 11 No basis given · 3 Sources not found · 1 Partly supported · 1 Couldn’t confirm · 1 No full text of the sources · 1 Not checked yet · accuracy not yet measured

Show all 73 claims

  • It may state two separate claims as one. 45
  • Probably not a substantial claim. 37
  • The quote only partly states this claim. 3
76 of 76
  • The paper relies on this without support.

    There is a dearth of research on understanding and cataloging the limitations of LLMs for code translation.

    “Although prior research has shown the potential of using LLMs for code translation, there is a dearth of research on understanding and cataloging their limitations for this task.”
  • The paper relies on this without support.

    Code translation is a complex task that requires LLMs to understand code syntax and semantics simultaneously.

    “This is an important undertaking because code translation is a complex task that requires LLMs to understand code syntax (to generate syntactically correct code) and semantics (to preserve functionality during translation) simultaneously.”
  • The paper relies on this without support.

    The selected datasets and real-world projects are comprehensive enough to understand the nature of LLM translation bugs.

    “To ensure the comprehensiveness of our findings and claims in understanding the nature of LLM translation bugs, we were interested in datasets used in prior studies as well as real-world projects.”
  • The paper relies on this without support.

    The tests provided with the code samples are adequate to validate code translation.

    “These datasets are accompanied by test cases to validate code translation.”
  • The paper relies on this without support.

    The selected real-world projects are reasonably complex and well-maintained software exclusively written in Java or Python.

    “Our goal was to translate reasonably complex and well-maintained software exclusively written in Java or Python.”
  • The paper relies on this without support.

    The manual labeling process and the resulting bug taxonomy are reliable and comprehensive.

    “The manual construction of the taxonomy involved eight human labelers, who are researchers or software engineers in the industry, and involved unsuccessful translations from all 31 translation pairs in Table 2.”
  • The paper relies on this without support.

    Regardless of randomness or number of repetitions, the nature of an unsuccessful translation remains unchanged.

    “Regardless of randomness or number of repetitions, the nature of an unsuccessful translation remains unchanged.”
  • The paper relies on this without support.

    LLMs are inherently nondeterministic.

    “Performing a translation task multiple times may change the success rates in translation as LLMs are inherently nondeterministic.”
  • The paper relies on this without support.

    Non-LLM-based techniques are generally deterministic.

    “Second, non-LLMbased techniques are generally deterministic, allowing for more predictable reasoning, whereas LLMs are inherently probabilistic, with a greater degree of creativity.”
9 of 9

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

Each contradiction between two passages listed here was confirmed by an independent check.

2 of 2

Citations

Cites

Show all 33 references

Research works printed but not linked: 5

  1. Xinyun Chen, Chang Liu, and Dawn Song. 2018. Tree-to-tree neural networks for program translation. Advances in neural information processing systems 31 (2018).
  2. Raymond Li, Loubna Ben Allal, Yangtian Zi, Niklas Muennighoff, Denis Kocetkov, Chenghao Mou, Marc Marone, Christopher Akiki, Jia Li, Jenny Chim, et al. 2023. StarCoder: may the source be with you! arXiv preprint arXiv:2305.06161 (2023). · arXiv
  3. Ruchir Puri, David S Kung, Geert Janssen, Wei Zhang, Giacomo Domeniconi, Vladimir Zolotov, Julian Dolby, Jie Chen, Mihir Choudhury, Lindsey Decker, et al. 2021. CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Tasks. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2).
  4. Yuanbo Wen, Qi Guo, Qiang Fu, Xiaqing Li, Jianxing Xu, Yanlin Tang, Yongwei Zhao, Xing Hu, Zidong Du, Ling Li, et al. 2022. BabelTower: Learning to Auto-parallelized Program Translation. In International Conference on Machine Learning. PMLR, 23685--23700.
  5. WG Zhang, Arne J Berre, Dumitru Roman, and Hans Aage Huru. 2009. Migrating legacy applications to the service Cloud. In Proceedings of the 14th Conference Companion on Object Oriented Programming Systems Languages and Applications. 59--68.

Cited by

Sorted by citations

Items 101–135 of 135

Metadata

Authors
Pan, R., Ibrahimzada, A. R., Krishna, R., Sankar, D., Wassi, L. P., Merler, M., Sobolev, B., Pavuluri, R., Sinha, S., & Jabbarvand, R.
Affiliations
  • IBM (United States) (US)
  • University of Illinois Urbana-Champaign (US)
Venue
Proceedings of the IEEE/ACM 46th International Conference on Software Engineering
Publisher
ACM
Published
2024-04-12
Pages
1-13
OpenAlex
W4394769102
Cited by
133
References
33
Citations by year
2026: 43 · 2025: 72 · 2024: 18
FWCI
51.11
Type
conference paper
Language
en
Open access
Locations
IEEE/ACM International Conference on Software Engineering (ICSE) (publishedVersion, cc-by-nc)
Funders
National Science Foundation
Topics
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
  • Physical Sciences › Computer Science › Software › Software Testing and Debugging Techniques
Keywords
program translation, large language models, bug classification, prompt engineering, program synthesis, programming language translation, LLM limitations

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

A language model drew the claims from the paper on 2026-10-16, under version 3 of the claim definition (model deepseek-v4.1-flash, prompt extract-v3).

A second model labelled each claim on 2026-10-16 (model jev-1.13-20260917, definition revision gold-guideline-v0.2).

Cited sources are checked with a language model’s help (gpt-6-sol).

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review