IP Library Granted Patent US 12,710,934
Granted Patent B2
US 12,710,934 · App. 18/432,236 · Granted Aug 18, 2026

Method and system for legacy code transformation

Inventors: Srinivas Jaggumantri (Bangalore, IN); Madhavi Latha Padakanti (Bangalore, IN); Nareshkumar Manoharan (Bangalore, IN)
Assignee: Infosys Limited
G06F8/35G06F8/51G06F40/20
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,710,934
App. No.
18/432,236
Granted
Aug 18, 2026
Kind
B2
Abstract

This disclosure relates to method and system for facilitating legacy code transformation. The method includes receiving legacy code data and natural language document from one or more data sources. Each of the one or more data sources is one of an external data source or an internal data source. Further, the method includes generating a first natural language output based on the legacy code data through a first LLM, and a second natural language output based on the natural language document through a second LLM. Further, the method includes fine-tuning one of the first LLM or the second LLM based on the first natural language output and the second natural language output, through a third LLM. Further, the method includes generating a natural language specification document corresponding to the legacy code data based on the first natural language output and the second natural language output through the third LLM.

Claims (41)

1 . A method for facilitating legacy code transformation, the method comprising:

receiving, by a computing device, legacy code data and at least one natural language document from one or more data sources;

generating, by the computing device, a first natural language output based on the legacy code data through a first Large Language Model (LLM), and a second natural language output based on the at least one natural language document through a second LLM, wherein the first natural language output comprises domain context or code explanation corresponding to the legacy code data, and wherein the second natural language output comprises extracted knowledge from the at least one natural language document;

fine-tuning, by the computing device, at least one of the first LLM or the second LLM based on the first natural language output and the second natural language output, through a third LLM, wherein the third LLM is configured to identify one or more gaps between the first natural language output and the second natural language output; and

generating, by the computing device, a natural language specification document corresponding to the legacy code data based on the first natural language output and the second natural language output through the third LLM.

2 . The method of claim 1 , wherein each of the first LLM, the second LLM, and the third LLM is an encoder-decoder transformer architecture-based generative Artificial Intelligence (AI) model.

3 . The method of claim 1 , further comprising training, by the computing device, the first LLM using a training dataset through a self-supervised learning technique, wherein the training dataset comprises a source code dataset and natural language specification corresponding to the source code dataset.

4 . The method of claim 3 , wherein training the first LLM comprises, at least one of:

configuring, by the computing device, the first LLM to generate the code explanation corresponding to the legacy code data in the first natural language output, wherein the training dataset comprises legacy code language information and corresponding explanation; or

configuring, by the computing device, the first LLM to generate the domain context in the first natural language output, wherein the training dataset comprises textual data.

5 . The method of claim 1 , further comprising pre-processing, by the computing device, the legacy code data and the at least one natural language document.

6 . The method of claim 1 , wherein generating the first natural language output based on the legacy code data further comprises, at least one of:

generating, by the computing device, expanded code functions corresponding to the legacy code data in natural language, wherein the first natural language output comprises the expanded code functions; or

generating, by the computing device, summaries of code comments in the legacy code data in natural language, wherein the first natural language output comprises the summaries.

7 . The method of claim 1 , wherein fine-tuning at least one of the first LLM and the second LLM further comprises:

providing, by the computing device and via the third LLM, a feedback to at least one of the first LLM or the second LLM based on the identified one or more gaps; and

modifying, by the computing device, one or more parameters of the at least one of the first LLM or the second LLM based on the feedback.

8 . The method of claim 1 , wherein the fine-tuning is based on human-assisted feedback corresponding to the first natural language output and the second natural language output.

9 . The method of claim 1 , further comprising generating, by the computing device, a Domain-Specific Language (DSL) specification document based on the first natural language output and the second natural language output through the third LLM.

10 . The method of claim 1 , further comprising generating modern code data corresponding to the legacy code data based on the natural language specification document through a code-generating generative AI model, wherein the modern code data is a transformation of the legacy code data in a modernized code language.

11 . The method of claim 1 , wherein each of the one or more data sources is one of an external data source or an internal data source.

12 . A system for facilitating legacy code transformation, the system comprising:

a processing circuitry; and

a memory communicatively coupled to the processing circuitry, wherein the memory stores processor instructions, which when executed by the processing circuitry, cause the processing circuitry to:

receive legacy code data and at least one natural language document from one or more data sources;

generate a first natural language output based on the legacy code data through a first Large Language Model (LLM), and a second natural language output based on the at least one natural language document through a second LLM, wherein the first natural language output comprises domain context or code explanation corresponding to the legacy code data, and wherein the second natural language output comprises extracted knowledge from the at least one natural language document;

fine-tune at least one of the first LLM or the second LLM based on the first natural language output and the second natural language output, through a third LLM, wherein the third LLM is configured to identify one or more gaps between the first natural language output and the second natural language output; and

generate a natural language specification document corresponding to the legacy code data based on the first natural language output and the second natural language output through the third LLM.

13 . The system of claim 12 , wherein, each of the first LLM, the second LLM, and the third LLM is an encoder-decoder transformer architecture-based generative Artificial Intelligence (AI) model.

14 . The system of claim 12 , wherein the processor instructions, on execution, further cause the processing circuitry to train the first LLM using a training dataset through a self-supervised learning technique, and wherein the training dataset comprises a source code dataset and natural language specification corresponding to the source code dataset.

15 . The system of claim 14 , wherein to train the first LLM, the processor instructions, on execution, further cause the processing circuitry to, at least one of:

configure the first LLM to generate the code explanation corresponding to the legacy code data in the first natural language output, wherein the training dataset comprises legacy code language information and corresponding explanation; or

configure the first LLM to generate the domain context in the first natural language output, wherein the training dataset comprises textual data.

16 . The system of claim 12 , wherein the processor instructions, on execution, further cause the processing circuitry to pre-process the legacy code data and the at least one natural language document.

17 . The system of claim 12 , wherein to generate the first natural language output based on the legacy code data the processor instructions, on execution, further cause the processing circuitry to, at least one of:

generate expanded code functions corresponding to the legacy code data in natural language, wherein the first natural language output comprises the expanded code functions; or

generate summaries of code comments in the legacy code data in natural language, wherein the first natural language output comprises the summaries.

18 . The system of claim 12 , wherein to fine-tune at least one of the first LLM and the second LLM the processor instructions, on execution, further cause the processing circuitry to:

provide, via the third LLM, a feedback to at least one of the first LLM or the second LLM based on the identified one or more gaps; and

modify one or more parameters of the at least one of the first LLM or the second LLM based on the feedback.

19 . The system of claim 12 , wherein the processor instructions, on execution, further cause the processing circuitry to generate modern code data corresponding to the legacy code data based on the natural language specification document through a code-generating generative AI model, wherein the modern code data is a transformation of the legacy code data in a modernized code language.