Reproduce “Rectifier: Code Translation with Corrector via LLMs” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Xin Yin, Chao Ni, Tien N. Nguyen, Shaohua Wang, Xiaohu Yang

A compact error correction model, Rectifier, was developed by a team including researchers from Zhejiang University, University of Texas at Dallas, and Central University of Finance and Economics, to enhance the accuracy of code translations generated by large language models. Fine-tuned on CodeT5+, the method successfully repairs a significant portion of common translation errors (up to 43.2% for ChatGPT errors) and demonstrates generalizability across different LLMs.

Key insights

  • LLMs exhibit consistent and classifiable error patterns across various models during code translation, such as syntactic differences, data handling issues, and dependency errors.
  • Compilation errors are the most prevalent type, followed by functional errors, indicating LLMs struggle with both target language syntax and semantic preservation.
  • A compact, pattern-learning model can effectively generalize to identify and repair common errors generated by 'unknown' LLMs, demonstrating universal applicability and resource efficiency.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.