LegacyTranslate: LLM-based Multi-Agent Method for Legacy Code Translation
- URL: http://arxiv.org/abs/2603.14054v1
- Date: Sat, 14 Mar 2026 17:51:07 GMT
- Title: LegacyTranslate: LLM-based Multi-Agent Method for Legacy Code Translation
- Abstract summary: LegacyTranslate is a multi-agent framework for API-aware code translation.<n>Initial Translation Agent produces an initial Java translation using retrieved in-context examples.<n> API Grounding Agent aligns the code with existing APIs by retrieving relevant entries from an API knowledge base.<n> Refinement Agent iteratively refines the output using compiler feedback and API suggestions to improve correctness.
- Score: 6.639896614747016
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Modernizing large legacy systems remains a major challenge in enterprise environments, particularly when migration must preserve domain-specific logic while conforming to internal architectural frameworks and shared APIs. Direct application of Large Language Models (LLMs) for code translation often produces syntactically valid outputs that fail to compile or integrate within existing production frameworks, limiting their practical adoption in real-world modernization efforts. In this paper, we propose LegacyTranslate, a multi-agent framework for API-aware code translation, developed and evaluated in the context of an ongoing modernization effort at a financial institution migrating approximately 2.5 million lines of PL/SQL to Java. The core idea is to use specialized LLM-based agents, each addressing a different aspect of the translation challenge. Specifically, LegacyTranslate consists of three agents: Initial Translation Agent produces an initial Java translation using retrieved in-context examples; API Grounding Agent aligns the code with existing APIs by retrieving relevant entries from an API knowledge base; and Refinement Agent iteratively refines the output using compiler feedback and API suggestions to improve correctness. Our experiments show that each agent contributes to better translation quality. The Initial Translation Agent alone achieves 45.6% compilable outputs and 30.9% test-pass rate. With API Grounding Agent and Refinement Agent, compilation improves by an additional 8% and test-pass accuracy increases by 3%.
Related papers
- SEDCoT: Enhancing LLM-Based COBOL Code Translation via Symbolic Execution and Delta Debugging [49.898541267264115]
Maintenance is increasingly challenging due to outdated technologies, sparse documentation, and developer retirement.<n>Traditional rule-based transcompilers yield outputs that are difficult to read and maintain.<n>We propose SEDCoT, a novel-to-C translation framework.
arXiv Detail & Related papers (2026-07-05T03:07:10Z) - Advancing Automated In-Isolation Validation in Repository-Level Code Translation [9.753507630426832]
Repository-level code translation aims to migrate entire repositories across programming languages while preserving functionality automatically.<n>This paper proposes TRAM, which combines context-aware type resolution with mock-based in-isolation validation.<n>TRAM demonstrates state-of-the-art performance in Java-to-Python translation, underscoring the effectiveness of its integration of RAG-based type resolution with reliable in-isolation validation.
arXiv Detail & Related papers (2025-11-26T19:53:46Z) - Beyond Language Barriers: Multi-Agent Coordination for Multi-Language Code Generation [8.896718697354187]
XL-CoGen produces high-quality code across multiple programming languages.<n>It integrates intermediate representation, code generation, translation, and automated repair.
arXiv Detail & Related papers (2025-09-24T09:18:08Z) - RepoTransAgent: Multi-Agent LLM Framework for Repository-Aware Code Translation [6.2036957709296665]
RepoTransAgent is a novel multi-agent framework for repository-aware code translation.<n>We evaluate RepoTransAgent on hundreds of Java-C# translation pairs from six popular open-source projects.
arXiv Detail & Related papers (2025-08-25T06:56:22Z) - Function-to-Style Guidance of LLMs for Code Translation [59.487054943812836]
We propose F2STrans, a function-to-style guiding paradigm designed to improve the performance of large language models in code translation.<n>Our approach comprises two key stages: (1) Functional learning, which optimize translation correctness using high-quality source-target code pairs.<n>We introduce a novel code translation benchmark that includes up-to-date source code, extensive test cases, and manually annotated ground-truth translations.
arXiv Detail & Related papers (2025-07-15T08:25:02Z) - ExeCoder: Empowering Large Language Models with Executability Representation for Code Translation [57.604506522287814]
Existing large language models (LLMs) only learn the contextual semantics of code during pre-training.<n>We propose ExeCoder to utilize executability representations such as functional semantics, syntax structures, and variable dependencies.<n>We show that ExeCoder achieves state-of-the-art performance in code translation, surpassing existing open-source code LLMs by over 10.88% to 38.78% and over 27.44% to 42.97% on two metrics.
arXiv Detail & Related papers (2025-01-30T16:18:52Z) - I Can't Share Code, but I need Translation -- An Empirical Study on Code Translation through Federated LLM [3.9373541926236766]
This study demonstrates that participants can collaboratively develop a FedLLM for efficient code translation.<n>Our findings indicate that FedLLM offers a collaborative approach to code translation and could serve as a promising direction for future research in this field.
arXiv Detail & Related papers (2025-01-10T05:43:36Z) - RustRepoTrans: Repository-level Code Translation Benchmark Targeting Rust [50.65321080814249]
RustRepoTrans is the first repository-level context code translation benchmark targeting incremental translation.<n>We evaluate seven representative LLMs, analyzing their errors to assess limitations in complex translation scenarios.
arXiv Detail & Related papers (2024-11-21T10:00:52Z) - Semantic Alignment-Enhanced Code Translation via an LLM-Based Multi-Agent System [24.52067108242477]
Code translation is crucial for software migration, system ablation, and cross-platform development.<n>Traditional rule-based methods rely on manually-written rules, which can be time-consuming and often result in less readable code.<n>More recently, the advance of Large Language Models (LLMs) further boosts learning-based code translation.<n>We propose a novel multi-agent system TRANSAGENT, which enhances LLM-based code translation by fixing the syntax errors and semantic errors.
arXiv Detail & Related papers (2024-09-30T02:53:03Z) - DS-Agent: Automated Data Science by Empowering Large Language Models with Case-Based Reasoning [56.887047551101574]
We present DS-Agent, a novel framework that harnesses large language models (LLMs) agent and case-based reasoning (CBR)
In the development stage, DS-Agent follows the CBR framework to structure an automatic iteration pipeline, which can flexibly capitalize on the expert knowledge from Kaggle.
In the deployment stage, DS-Agent implements a low-resource deployment stage with a simplified CBR paradigm, significantly reducing the demand on foundational capabilities of LLMs.
arXiv Detail & Related papers (2024-02-27T12:26:07Z) - ML-Bench: Evaluating Large Language Models and Agents for Machine Learning Tasks on Repository-Level Code [76.84199699772903]
ML-Bench is a benchmark rooted in real-world programming applications that leverage existing code repositories to perform tasks.
To evaluate both Large Language Models (LLMs) and AI agents, two setups are employed: ML-LLM-Bench for assessing LLMs' text-to-code conversion within a predefined deployment environment, and ML-Agent-Bench for testing autonomous agents in an end-to-end task execution within a Linux sandbox environment.
arXiv Detail & Related papers (2023-11-16T12:03:21Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.