TRANSAGENT: An LLM-Based Multi-Agent System for Code Translation

Zhiqiang Yuan, Weitong Chen, Hanlin Wang, Kai Yu, Xin Peng, Yiling Lou·September 30, 2024

Summary

TRANSAGENT is an LLM-based multi-agent system for code translation, addressing quality issues in LLM-generated programs. It comprises four agents: Initial Code Translator, Syntax Error Fixer, Code Aligner, and Semantic Error Fixer. TRANSAGENT first localizes error code blocks in the target program using execution alignment between source and target programs, reducing fixing difficulties. Evaluated on a new benchmark, TRANSAGENT outperforms UniTrans in translation effectiveness and efficiency, demonstrating its generalization and the contribution of each agent. The system's code mapping strategy, Code Aligner, surpasses TransMap in accuracy. TRANSAGENT is cost-effective and generalizable across different LLMs.

Key findings

8

Tables

4

Advanced features