Rectifier: Code Translation with Corrector via LLMs
Xin Yin, Chao Ni, Tien N. Nguyen, Shaohua Wang, Xiaohu Yang

TL;DR
This paper introduces Rectifier, a universal error corrector for code translation using LLMs, significantly improving translation accuracy across multiple programming languages by repairing common errors.
Contribution
The paper presents a novel universal corrector model that learns from LLM-generated errors to repair code translations, enhancing robustness and accuracy across languages.
Findings
Effective repair of translation errors in C++, Java, and Python
Improved translation accuracy demonstrated through experiments
Robustness confirmed via cross-language experiments
Abstract
Software migration is garnering increasing attention with the evolution of software and society. Early studies mainly relied on handcrafted translation rules to translate between two languages, the translation process is error-prone and time-consuming. In recent years, researchers have begun to explore the use of pre-trained large language models (LLMs) in code translation. However, code translation is a complex task that LLMs would generate mistakes during code translation, they all produce certain types of errors when performing code translation tasks, which include (1) compilation error, (2) runtime error, (3) functional error, and (4) non-terminating execution. We found that the root causes of these errors are very similar (e.g. failure to import packages, errors in loop boundaries, operator errors, and more). In this paper, we propose a general corrector, namely Rectifier, which is…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNatural Language Processing Techniques · Mathematics, Computing, and Information Processing
MethodsSoftmax · Attention Is All You Need
