Artificial Intelligence1 min read

Legacy Modernization with LLMs and the decisions nobody asked about

By · Published by Everything Blog

In short

Recent experiments translating legacy RPG code into Java demonstrated that models reliably preserve program behavior while drastically altering their implementation structures. Across multiple independent runs, identical inputs generated functionally equivalent software that diverged extensively in volume and formatting. In one prominent example, translating the same legacy program produced 14,500 lines of Java in one test run compared to 26,300 lines in another. These unpredictable structural designs introduce significant technical debt for developers expected to maintain the resulting codebase over a 15-to-20-year lifecycle.

Key points

  • Repeated translations of identical legacy software by the same model yield vastly differi…: Repeated translations of identical legacy software by the same model yield vastly differing code architectures.
  • Preserved program functionality does not guarantee uniform results regarding code concise…: Preserved program functionality does not guarantee uniform results regarding code conciseness, maintainability, or runtime execution speed.
  • Discrepancies in automated code generation create substantial uncertainty for maintenance…: Discrepancies in automated code generation create substantial uncertainty for maintenance teams managing applications over the next two decades.

Sources checked by our analysis pipeline: 1

We asked the same LLM to translate the same RPG applications three times, and we got three different results. In most cases, the generated applications behave the same way, while not looking the same. The same program can be translated once into 14,500 lines of Java, another time into 26,300. Sometimes they also behave differently, but this is a problem we are putting aside here. How the code looks is what we are interested in.

LLMs can translate code. But how do they do it? A translation involves a lot of design decisions, big and small. The fundamental points are two:

- The LLM makes many design decisions, and we may disagree with them

- When asked again, the LLMs can make different design decisions

Why does this matter? After all, provided the code behaves identically to the original, who cares?

The people that would need to maintain the codebase for the next 15 to 20 years may care.

When we migrate, we have software that does something useful, like an ERP that lets us check what is in the…

Artificial Intelligence