BabelCoder: Agentic Code Translation with Specification Alignment
cs.SE, cs.AI
Submitted: 2025-12-07
Updated: 2026-09-24
Code: https://github.com/anonprox/babelcoder
License: http://creativecommons.org/licenses/by/4.0/
The gist: As software systems evolve, developers increasingly work across multiple programming languages and often face the need to migrate code from one language to another.
Terminology
Abstract
As software systems evolve, developers increasingly work across multiple programming languages and often face the need to migrate code from one language to another. While automatic code translation offers a promising solution, it has long remained a challenging task. Recent advancements in Large Language Models (LLMs) have shown potential for this task, yet existing approaches remain limited in accuracy and fail to effectively leverage contextual and structural cues within the code. Prior work has explored translation and repair mechanisms, but lacks a structured, agentic framework where multiple specialized agents collaboratively improve translation quality. In this work, we introduce BabelCoder, an agentic framework that performs code translation by decomposing the task into specialized agents for translation, testing, and refinement, each responsible for a specific aspect such as generating code, validating correctness, or repairing errors. We evaluate BabelCoder on four benchmark datasets and compare it against four state-of-the-art baselines. BabelCoder outperforms existing methods by 0.5%-13.5% in 94% of cases, achieving an average accuracy of 94.16%.
Sources
- AVATAR: A Parallel Corpus for Java-Python Program Translation
- Enhancing Code Translation in Language Models with Few-Shot Learning via Retrieval-Augmented Generation
- ExeCoder: Empowering Large Language Models with Executability Representation for Code Translation
- AlphaTrans: A Neuro-Symbolic Compositional Approach for Repository-Level Code Translation and Validation
- Self-Organized Agents: A LLM Multi-Agent Framework toward Ultra Large-Scale Code Generation and Optimization
- Unsupervised Translation of Programming Languages
- An Exploratory Study on Fine-Tuning Large Language Models for Secure Code Generation
- Secure-Instruct: An Automated Pipeline for Synthesizing Instruction-Tuning Datasets Using LLMs for Secure Code Generation
- RobuNFR: Evaluating the Robustness of Large Language Models on Non-Functional Requirements Aware Code Generation
- Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Code
- InterTrans: Leveraging Transitive Intermediate Translations to Enhance LLM-based Code Translation
- Evolving Triple Knowledge-Augmented LLMs for Code Translation in Repository Context
- CATCODER: Repository-Level Code Generation with Relevant Code and Type Context
- CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Tasks
- A Multi-Language Perspective on the Robustness of LLM Code Generation
- Leveraging Automated Unit Tests for Unsupervised Code Translation
- Specification-Driven Code Translation Powered by Large Language Models: How Far Are We?
- Code Translation with Compiler Representations
- Teaching Code LLMs to Use Autocompletion Tools in Repository-Level Code Generation
- RepoTransBench: A Real-World Multilingual Benchmark for Repository-Level Code Translation
Related papers
- Falsification-Based Verification of LLM-Generated Optimization Models: Sound Test Batteries and Their Detection Limits
- GitSkills: A Dataset of Agent Skills on GitHub
- SABER: Benchmarking Operational Safety of LLM Coding Agents in Stateful Project Workspaces
- PackMonitor: Enabling Zero Package Hallucinations Through Decoding-Time Monitoring
- IntentCoding: Amplifying User Intent in Code Generation
- Incentives and Outcomes in Bug Bounties