IBM Patents AI System That Translates Legacy Business Code Automatically
Millions of lines of old business software are stuck in programming languages nobody writes anymore, and translating them by hand costs a fortune. IBM is patenting a way to let an AI language model do that work automatically, even for the parts that were always considered too complicated to automate.
How IBM's system handles the trickiest parts of code translation
Every time a big bank processes a wire transfer or an airline books a seat, there is a decent chance the code doing the work was written in a language that dates back to the 1960s or 70s, like COBOL. Companies desperately want to modernize that code, but translating it to something current is slow, expensive, and full of traps.
One of the nastiest traps is something programmers call expandable code: shorthand instructions that balloon out into many lines of real code when the program runs. Standard automated tools choke on this because the shorthand has to be understood before it can be translated. IBM's patent describes a method that first replaces those tricky shorthand pieces with labeled placeholders, then hands the result to an AI language model that fills in the blanks in the new language.
The result is a two-step pipeline: a traditional rule-based translator handles the straightforward parts, while the AI handles the ambiguous, context-dependent sections. You end up with modernized code without needing a team of specialists to read every line by hand.
… generating a symbolic variable for a variable in the expandable code into a code template providing a symbolic expression of the expandable code; …
Translation: It replaces complex code snippets with temporary symbolic placeholders to simplify the translation process.
How symbolic templates let the LLM skip bad macro guesses
The patent targets a specific class of problem in automated code translation: expandable code, which includes constructs like macros (think of a macro as a named recipe that gets substituted for a full set of instructions at run time). Standard translation tools struggle with macros because the tools see the shorthand name, not the actual instructions it represents.
IBM's method works in three phases:
- Identify expandable code: The system scans the source program and flags every macro or similar construct that a rule-based translator cannot handle directly.
- Build a symbolic template: Instead of trying to translate the macro outright, the system swaps its internal variables for labeled placeholders (symbolic variables), creating a kind of fill-in-the-blank version of the code.
- Hybrid translation: A conventional source-to-target translator converts the placeholder definitions into target-language statements. Then a large language model (an AI trained on vast amounts of code) reads the symbolic template and writes the actual target-language instructions that implement the macro's behavior.
The key insight is that by stripping the macro down to a symbolic skeleton first, the LLM receives a clean, unambiguous prompt rather than a tangle of legacy syntax. This reduces the chance that the AI misreads context and generates incorrect code, which is the most common failure mode when LLMs attempt code translation directly.
A large language model, that generates code in the target programming language from symbolic statements, translates the symbolic expression in the code template to target programming language statements implementing the expandable code in the target program.
Translation: An AI translates those temporary placeholders into fully functional modern code in the new programming language.
What this means for companies still running old mainframe code
For large enterprises, legacy code migration is one of the most expensive IT projects imaginable. A single mainframe application can contain millions of lines of COBOL, PL/I, or RPG code, and macros are scattered throughout. Every macro a human specialist has to inspect manually adds hours of billable time. A system that automates even a fraction of that work could cut migration projects from years to months.
IBM is one of the companies with the deepest financial interest in this problem: it sells both the mainframes that run old code and the consulting services that migrate it. That dual position makes this patent read as practical infrastructure, not a research curiosity. For anyone tracking AI-assisted software tools, this filing sits alongside this week's Big Tech patents in the code-generation and automated programming space, where IBM, Microsoft, and Google are all staking out different corners of the same market.
That makes this IBM's 26th filing we've tracked in Language AI since May, a group that includes one on scoring AI bias toward protected groups and one on AI errors in technical documents.
The design choice here is deliberate and conservative: IBM is not asking the AI to translate the whole program. It is asking the AI to handle only the parts the rule-based system cannot. That division of labor is sensible, but it also means the output quality depends on how cleanly the symbolic template step separates hard cases from easy ones. If the boundary is fuzzy, messy macros could slip through as misleadingly tidy templates, and the LLM would still produce wrong code, just more confidently.
There is also a correctness verification gap that the patent does not appear to close. Generating translated code and verifying that it behaves identically to the original are two different problems. A migration tool that produces plausible-looking but subtly wrong output could be worse than no tool at all in a high-stakes financial system.
Still, the symbolic-template trick is a real engineering contribution. Giving the LLM a pre-cleaned, variable-abstracted representation rather than raw legacy syntax is a meaningful prompt-quality improvement, and the hybrid architecture keeps the AI from being asked to do things rule-based systems already do reliably. The trade reads as worth it for the common case, with the caveat that the edge cases are exactly where legacy migration tends to go wrong.
There are more where this came from
We read every patent application Big Tech publishes and send you the ones worth knowing. Plain English, free, every week.
The drawings
9 drawing sheets from US 2026/0252330 A1 · click any drawing to enlarge
Want this weekly breakdown for a company we don't cover? Patentlyze Pro →