TransAgent: Enhancing LLM-Based Code Translation via Fine-Grained Execution Alignment
Zhiqiang Yuan, Weitong Chen, Hanlin Wang, Xin Peng, Zhenpeng Chen, Yiling Lou

TL;DR
TransAgent introduces a multi-agent system that improves LLM-based code translation accuracy by localizing and correcting errors through fine-grained execution alignment, significantly outperforming existing methods.
Contribution
It presents a novel multi-agent framework, TransAgent, that enhances code translation quality by error localization and correction, addressing limitations of prior LLM-based approaches.
Findings
TransAgent outperforms UniTrans by up to 33.3% in translation accuracy.
Achieves an average of 56.7% improvement in program repair over Agentless.
Demonstrates effectiveness and generalizability across different LLMs.
Abstract
Code translation transforms code between programming languages while preserving functionality, which is critical in software development and maintenance. While traditional learning-based code translation methods have limited effectiveness due to the lack of sufficient parallel training data, Large Language Models (LLMs) have recently advanced this field with their strong code generation and comprehension capabilities. However, code translated by LLMs still suffers from diverse quality issues, such as syntax and semantic errors. In this work, we propose TransAGENT, a novel multi-agent system that eliminates the errors during LLM-based code translation. The main insight of TransAGENT is to localize error-prone code blocks via fine-grained execution alignment between source and target code. We evaluate TransAGENT on a newly constructed benchmark of recent programming tasks to mitigate data…
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.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
