TLDR: ACT (Auto-Train for Code Translation) is an innovative framework that enhances code translation by enabling in-house fine-tuning of open-source Large Language Models (LLMs). It achieves this through an automated pipeline that generates extensive, high-quality synthetic code data with unit tests, adaptively fine-tunes models based on real-time evaluations, and intelligently orchestrates the entire process. This approach offers a secure, reliable, and high-performing alternative to proprietary solutions, significantly improving translation accuracy for various programming language pairs.
In the fast-evolving world of software development, translating code between different programming languages is a vital process. This enables software to work across various systems and helps it last longer. Traditionally, automated translation relied on fixed, handcrafted rules, which often lacked flexibility and couldn’t scale up easily. While advanced language models offer promising alternatives, many are proprietary and API-based, raising concerns about data security and dependency on external services.
Introducing ACT: A New Approach to Code Translation
A new framework called Auto-Train for Code Translation (ACT) aims to bridge this gap. ACT allows businesses to fine-tune open-source Large Language Models (LLMs) in-house, significantly boosting their performance for code translation tasks. This innovative framework helps open-source models achieve the high performance typically seen in closed-source solutions, but with the added benefits of security and reliability.
How ACT Works: The Core Components
ACT operates through an automated pipeline with four main components:
Data Generation: This is the foundation of ACT. It starts with a small set of initial code samples in the source language. From these, it automatically generates a vast amount of high-quality synthetic code data, complete with unit tests to ensure the new code works correctly. This process uses strategies like ‘breadth-based expansion’ to create diverse code by changing its core purpose, and ‘depth-based expansion’ to add complexity or modify logical steps. It also employs ‘mutation testing’ to create slightly buggy versions of the translated code, ensuring the unit tests are robust enough to catch errors.
Finetuning: Once the synthetic data is ready, ACT uses it to optimize open-source LLMs for code translation. The framework automatically selects the best training strategies and hyperparameters (like the number of training cycles or learning rate), meaning users don’t need deep technical knowledge to fine-tune the models. It can choose between full fine-tuning or a more efficient method called Low-Rank Adaptation (LoRA) based on the model’s initial performance.
Evaluation: After each training phase, ACT rigorously evaluates the model’s performance. It executes the translated code against its unit tests in secure, isolated environments (Docker containers) to check for functional correctness. This process calculates ‘pass@k’ values, which measure how often the model generates correct translations. The evaluation results are crucial for guiding the next steps in the process.
Controller: This is the intelligent orchestrator of the entire ACT framework. The Controller dynamically manages the interplay between data generation, fine-tuning, and evaluation. Based on real-time evaluation scores and training trends, it decides whether to continue fine-tuning, generate more targeted synthetic data (especially for areas where the model struggled), or stop the process if further improvements are unlikely. This adaptive approach ensures efficient use of resources and maximizes model performance.
Also Read:
- Automating Unit Test Generation: A Deep Dive into LLM Performance with Code Context and Prompting
- How Language Models Teach Themselves to Solve Complex Coding Puzzles
Real-World Impact and Future Directions
Experiments with ACT have shown significant improvements in code translation accuracy. For instance, when applied to Java-to-Go and C++-to-Rust translation tasks, ACT-finetuned models like Qwen2.5-Coder-7B-Instruct and DeepSeek-Coder-V2-Instruct consistently outperformed their base versions. The framework’s ability to generate high-quality data and adaptively fine-tune models has proven effective in enhancing translation quality and accelerating developer workflows in industry-scale migration projects.
Looking ahead, the developers plan to expand ACT’s capabilities to support more programming languages. They also aim to develop a feedback loop for test failures, allowing for more precise adjustments to both code and test logic, further improving data quality. Additionally, future work will focus on generating more complex and longer code samples to handle repository-level code translation tasks.
ACT represents a significant step forward in making high-performance code translation accessible and secure for businesses and developers, offering a powerful alternative to proprietary solutions. You can read the full research paper here: ACT: Bridging the Gap in Code Translation through Synthetic Data Generation & Adaptive Training.


