CoChat

Exploring and Unleashing the Power of Large Language Models in Automated Code Translation

Open access
Yang, Zhen, Liu, Fang, Yu, Zhongxing, Keung, Jacky Wai, Li, Jia, Liu, Shuo, Hong, Yifan, Ma, Xiaoxue, Jin, Zhi, Li, Ge · 2024 · Proceedings of the ACM on Software Engineering

The DOI matches its Crossref record; 66 of the 67 references it cites were found in a registry or an index, and 1 are not checked yet.

Abstract

Code translation tools, namely transpilers, are developed for automatic source-to-source translation. Latest learning-based transpilers have shown impressive enhancement against rule-based counterparts in both translation accuracy and readability, owing to their task-specific pre-training on extensive monolingual corpora. Nevertheless, their current performance still remains unsatisfactory for practical deployment, and the associated training resources are also prohibitively expensive. Large Language Models (LLMs), pre-trained on huge amounts of human-written code/text, have shown remarkable performance in many code intelligence tasks due to their powerful generality, even without task-specific re-training/fine-tuning. Thus, LLMs can potentially circumvent the above limitations, but they have not been exhaustively explored yet. This paper investigates diverse LLMs and learning-based transpilers for automated code translation tasks, finding that: although certain LLMs have outperformed current transpilers, they still have some accuracy issues, where most of the failures are induced by a lack of comprehension of source programs (38.51%), missing clear instructions on I/O types in translation (14.94%), and ignoring discrepancies between source and target programs (41.38%). Enlightened by the above findings, we further propose UniTrans , a Unified code Translation framework, applicable to various LLMs, for unleashing their power in this field. Specifically, UniTrans first crafts a series of test cases for target programs with the assistance of source programs. Next, it harnesses the above auto-generated test cases to augment the code translation and then evaluate their correctness via execution. Afterward, UniTrans further (iteratively) repairs incorrectly translated programs prompted by test case execution results. Extensive experiments are conducted on six settings of translation datasets between Python, Java, and C++. Three recent LLMs of diverse sizes, including GPT-3.5 and LLaMA-13B/7B, are tested with UniTrans , and all achieve substantial improvements in terms of computational accuracy and exact match accuracy among almost all translation settings, showing the universal effectiveness of UniTrans in practice.

Overview

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.1145/3660778

Cites

66 of 67 references verified0 citation errors · 0 not checkable

Statistics

Figures

Fig. 1 Frequencies of Failed Cases in Each Translation Dataset
Fig. 1 Frequencies of Failed Cases in Each Translation DatasetCC-BY · From the PDF
Fig. 2 UniTrans
Fig. 2 UniTransCC-BY · From the PDF
Fig. 3 An Example of Input Generation Prompt
Fig. 3 An Example of Input Generation PromptCC-BY · From the PDF
Fig. 4 An Example of Translation Augmentation Prompt
Fig. 4 An Example of Translation Augmentation PromptCC-BY · From the PDF
Fig. 5 An Example of Repair Prompt
Fig. 5 An Example of Repair PromptCC-BY · From the PDF
Fig. 6 An Execution Result Example
Fig. 6 An Execution Result ExampleCC-BY · From the PDF
Fig. 7 Basic Prompt
Fig. 7 Basic PromptCC-BY · From the PDF

Verification

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.

A few free checks a day · papers already verified open instantly · results are public

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.

The self-check needs the paper’s full text.

Citations

Cites

  • LLaMA: Open and Efficient Foundation Language Models

    Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.-A., Lacroix, T., Rozière, B., Goyal, N., Hambro, E., Azhar, F., et al. (2023) · arXiv · doi:10.48550/arxiv.2302.13971 · Cited by 4,602 · cited 3×

    “However, according to our compared learning-based transpilers [40–42] and open-source LLMs [35, 44], although those LLMs were also pre-trained on natural languages, as for training resources on code, all the above models were pre-trained based on GitHub public dataset available on Google BigQuery…”
    BackgroundInfluential
  • Individual Comparisons by Ranking Methods

    Wilcoxon, F. (1992) · Springer Series in Statistics · doi:10.1007/978-1-4612-4380-9_16 · Cited by 2,915 · cited 1×

    “As such, a vast amount of monolingual samples can be leveraged for training.”
    Background
  • A Survey of Large Language Models

    Zhao, W. X., Zhou, K., Li, J., Tang, T., Dong, Z., Hou, Y., Zhang, B., Min, Y., Zhang, J., Liu, P., et al. (2026) · Frontiers of Computer Science · doi:10.1007/s11704-026-60308-3 · Cited by 2,093

    Self-citation
  • A Survey of Large Language Models

    Zhao, W. X., Zhou, K., Li, J., Tang, T., Wang, X., Hou, Y., Min, Y., Zhang, B., Zhang, J., Dong, Z., et al. (2023) · arXiv · doi:10.48550/arxiv.2303.18223 · Cited by 2,090

    Self-citation
  • Evaluating Large Language Models Trained on Code

    Chen, M., Tworek, J., Jun, H., Yuan, Q., Pinto, H. P. D. O., Kaplan, J., Edwards, H., Burda, Y., Joseph, N., Brockman, G., et al. (2021) · arXiv · doi:10.48550/arxiv.2107.03374 · Cited by 1,436 · cited 1×

    “…Large Language Models (LLMs), pre-trained on billions of text/code tokens, bypass the need for re-training/fine-tuning but demonstrate the powerful generality of various code-related tasks, such as code generation [7, 11, 23, 25, 28, 52], program repair [12, 48], and code summarization [2, 14].”
    Background
  • The Curious Case of Neural Text Degeneration

    Holtzman, A., Buys, J., Du, L., Forbes, M., & Choi, Y. (2019) · arXiv · doi:10.48550/arxiv.1904.09751 · Cited by 1,304 · cited 1×

    “To this end, as shown in the right-hand side of Figure 2, we design an Error Analyzer (EA) to extract error information from the above Execution Results (Step 8), including error lines and error messages.”
    Method
  • EvoSuite: automatic test suite generation for object-oriented software

    Fraser, G., & Arcuri, A. (2011) · Proceedings of the 19th ACM SIGSOFT symposium and the 13th European conference on Foundations of software engineering · doi:10.1145/2025113.2025179 · Cited by 1,110 · cited 1×

    “Traditional tools, such as Randoop [38], EvoSuite [13], and MOSA [39], exploit search-based heuristics to generate test cases, suffering limitations on diversity and quantity.”
    Method
  • Feedback-Directed Random Test Generation

    Pacheco, C., Lahiri, S. K., Ernst, M. D., & Ball, T. (2007) · 29th International Conference on Software Engineering (ICSE'07) · doi:10.1109/icse.2007.37 · Cited by 863 · cited 1×

    “Traditional tools, such as Randoop [38], EvoSuite [13], and MOSA [39], exploit search-based heuristics to generate test cases, suffering limitations on diversity and quantity.”
    Method
  • Structured Chain-of-Thought Prompting for Code Generation

    Li, J., Li, G., Li, Y., & Jin, Z. (2025) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3690635 · Cited by 461 · cited 1×

    “…Large Language Models (LLMs), pre-trained on billions of text/code tokens, bypass the need for re-training/fine-tuning but demonstrate the powerful generality of various code-related tasks, such as code generation [7, 11, 23, 25, 28, 52], program repair [12, 48], and code summarization [2, 14].”
    BackgroundSelf-citation
  • Automated Program Repair in the Era of Large Pre-trained Language Models

    Xia, C. S., Wei, Y., & Zhang, L. (2023) · 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE) · doi:10.1109/icse48619.2023.00129 · Cited by 433

Show all 67 references

Research works printed but not linked: 3

  1. JWKJW Kotrlik and CCHCC Higgins. 2001. Organizational research: Determining appropriate sample size in survey research appropriate sample size in survey research. Information technology, learning, and performance journal 19, 1 (2001), 43.
  2. Jia Li, Yunfei Zhao, Yongmin Li, Ge Li, and Zhi Jin. 2023. Towards Enhancing In-Context Learning for Code Generation. arXiv preprint arXiv:2303.17780 (2023). · DOI · Paper page
  3. Anh Tuan Nguyen, Tung Thanh Nguyen, and Tien N Nguyen. 2015. Divide-and-conquer approach for multi-phase statistical migration for source code (t). In 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 585-596. · DOI · Paper page

Cited by

Items 101–200 of 241

Metadata

Authors
Yang, Z., Liu, F., Yu, Z., Keung, J. W., Li, J., Liu, S., Hong, Y., Ma, X., Jin, Z., & Li, G.
Affiliations
  • Shandong University (CN)
  • Beihang University (CN)
  • City University of Hong Kong (HK)
  • Peking University (CN)
Venue
Proceedings of the ACM on Software Engineering
Published
2024-07-12
Volume
1
Issue
FSE
Pages
1585-1608
ISSN
2994-970X (ISSN-L)
OpenAlex
W4400582609
Cited by
104
References
55
Citations by year
2026: 46 · 2025: 45 · 2024: 13
FWCI
39.10
Type
journal article
Language
en
Open access
Locations
  • Proceedings of the ACM on software engineering. (publishedVersion)
  • arXiv (Cornell University) (submittedVersion, cc-by)
  • arXiv (Cornell University)
Funders
  • National Key R&D Program (2023YFB4503801)
  • National Natural Science Foundation of China (62102233, 62302021, 62192731, 62192730, 62072007, 62192733, 61832009)
  • Shandong Province Overseas Outstanding Youth Fund (2022HWYQ-043)
  • City University of Hong Kong (7005217,9220097,9220103,9229029,9229098,9678149)
  • Key Program of Hubei (JD2023008)
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
transpiler, large language models, test case generation, program repair, source-to-source translation

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.

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

Data sources

Bibliographic data: Semantic Scholar, OpenAlex, Crossref.

Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).

Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.