AI Can Now Translate Old Code Into New Languages — Sort Of
This could let companies modernize aging software without hiring rare, costly experts.
Big companies run on old software. Banks, airlines and hospitals still depend on code written decades ago in languages like COBOL, and the few people who understand it are retiring. Rewriting that code by hand is slow, expensive and risky. A new research paper asks a simple question: can today's AI do the translating for us?
The team built a testing tool called CodeTransBenchmark and put eight AI models through their paces, covering 12 pairs of programming languages. The results were mixed but encouraging. A model called Codestral, specially trained on many coding languages, translated the majority of examples correctly. General-purpose chatbots, the kind you might use to draft an email, frequently stumbled on the picky grammar rules of the language they were writing into. The researchers also found that the outcome depends heavily on which two languages are involved, and how much practice data the AI saw for each.
One finding stands out for anyone who has ever used an AI assistant: when the researchers fed the AI feedback about its mistakes and let it try again, accuracy improved significantly. In other words, the AI is better at fixing code than writing it perfectly the first time. That mirrors how most people actually use these tools — draft, check, correct, repeat.
So what is the catch? The authors say AI code translation is not ready for serious, everyday use yet. The models need to hold much more code in their memory at once (a 'larger context window,' meaning they can read longer documents before forgetting the beginning) to handle real business software, which runs to millions of lines. Until then, expect AI to assist human programmers rather than replace them. The payoff, if it arrives, is cheaper updates to the aging systems that quietly run your bank, your bookings and your bills.
- AI models were tested on translating code between 12 pairs of programming languages, like Spanish to Italian but for software.
- A specialist model named Codestral succeeded on most translations, while everyday AI chatbots often broke the target language's grammar rules.
- Letting the AI see its own mistakes and retry boosted accuracy — but the researchers say today's models still can't handle the huge size of real corporate software.
Why It Matters
Could cut the cost of modernizing aging bank and government software, though AI still needs human programmers watching.