IP Library Granted Patent US 12,681,704
Granted Patent B2
US 12,681,704 · App. 18/623,784 · Granted Jul 14, 2026

Iterative generation of intermediate representations with large language models

Inventor: David Kunz (Wilhelmsfeld, DE)
Assignee: SAP SE
G06F8/42
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,681,704
App. No.
18/623,784
Granted
Jul 14, 2026
Kind
B2
Abstract

In an example embodiment, a framework is provided to allow an LLM to regenerate an intermediate representation based on natural language feedback that is provided on the compilable computer code that was generated using the programmatic component from an earlier intermediate representation. The user is able to provide this feedback without having any knowledge of the intermediate representation and the framework is designed to allow the LLM to incorporate this feedback into future generation requests without the LLM being aware of the compilable computer code that was created from its prior iterations.

Claims (52)

1 . A system comprising:

at least one hardware processor; and

a computer-readable medium storing instructions that, when executed by the at least one hardware processor, cause the at least one hardware processor to perform operations comprising:

receiving first natural language text describing compilable computer code to be generated;

generating an initial prompt by adding an initial system message to the first natural language text, the system message including an instruction to generate computer code in an intermediate representation;

passing the initial prompt to a large language model (LLM);

receiving, from the LLM, a generated first version of an intermediate representation, wherein the intermediate representation is a structured data format that is descriptive of computer code, but is not itself compilable;

storing the generated initial intermediate representation in a cache;

passing the generated initial intermediate representation to a programmatic component, which applies one or more deterministic processes to validate the generated intermediate representation and convert the generated intermediate representation into an initial final representation, the initial final representation being compilable computer code;

receiving second natural language text requesting a refinement to the initial final representation;

generating a subsequent prompt by adding a subsequent iteration system message to the second natural language text and the generated initial intermediate representation from the cache;

passing the subsequent prompt to the LLM; and

receiving, from the LLM, a generated refined initial intermediate representation.

2 . The system of claim 1 , wherein the initial prompt comprises a mapping between fields of a first format for intermediate representations and fields of a second format for final representations, and wherein the generating the subsequent prompt comprises generating the subsequent prompt by adding the subsequent iteration system message to the second natural language text, the generated initial intermediate representation from the cache, and the mapping.

3 . The system of claim 1 , wherein the compilable computer code is in a format being at least partially proprietary.

4 . The system of claim 3 , wherein the compilable computer code is a Core Data Services (CDS) model.

5 . The system of claim 1 , wherein the intermediate representation is not compilable.

6 . The system of claim 5 , wherein the intermediate representation is a JavaScript Object Notation (JSON) file.

7 . The system of claim 1 , wherein the programmatic component automatically corrects one or more errors in the intermediate representation.

8 . A method comprising:

receiving first natural language text describing compilable computer code to be generated;

generating an initial prompt by adding an initial system message to the first natural language text, the system message including an instruction to generate computer code in an intermediate representation;

passing the initial prompt to a large language model (LLM);

receiving, from the LLM, a generated first version of an intermediate representation, wherein the intermediate representation is a structured data format that is descriptive of computer code, but is not itself compilable;

storing the generated initial intermediate representation in a cache;

passing the generated initial intermediate representation to a programmatic component, which applies one or more deterministic processes to validate the generated intermediate representation and convert the generated intermediate representation into an initial final representation, the initial final representation being compilable computer code;

receiving second natural language text requesting a refinement to the initial final representation;

generating a subsequent prompt by adding a subsequent iteration system message to the second natural language text and the generated initial intermediate representation from the cache;

passing the subsequent prompt to the LLM; and

receiving, from the LLM, a generated refined initial intermediate representation.

9 . The method of claim 8 , wherein the initial prompt comprises a mapping between fields of a first format for intermediate representations and fields of a second format for final representations, and wherein the generating the subsequent prompt comprises generating the subsequent prompt by adding the subsequent iteration system message to the second natural language text, the generated initial intermediate representation from the cache, and the mapping.

10 . The method of claim 8 , wherein the compilable computer code is in a format being at least partially proprietary.

11 . The method of claim 10 , wherein the compilable computer code is a Core Data Services (CDS) model.

12 . The method of claim 8 , wherein the intermediate representation is not compilable.

13 . The method of claim 12 , wherein the intermediate representation is a JavaScript Object Notation (JSON) file.

14 . The method of claim 8 , wherein the programmatic component automatically corrects one or more errors in the intermediate representation.

15 . A non-transitory machine-readable medium storing instructions which, when executed by one or more processors, cause the one or more processors to perform operations comprising:

receiving first natural language text describing compilable computer code to be generated;

generating an initial prompt by adding an initial system message to the first natural language text, the system message including an instruction to generate computer code in an intermediate representation;

passing the initial prompt to a large language model (LLM);

receiving, from the LLM, a generated first version of an intermediate representation, wherein the intermediate representation is a structured data format that is descriptive of computer code, but is not itself compilable;

storing the generated initial intermediate representation in a cache;

passing the generated initial intermediate representation to a programmatic component, which applies one or more deterministic processes to validate the generated intermediate representation and convert the generated intermediate representation into an initial final representation, the initial final representation being compilable computer code;

receiving second natural language text requesting a refinement to the initial final representation;

generating a subsequent prompt by adding a subsequent iteration system message to the second natural language text and the generated initial intermediate representation from the cache;

passing the subsequent prompt to the LLM; and

receiving, from the LLM, a generated refined initial intermediate representation.

16 . The non-transitory machine-readable medium of claim 15 , wherein the initial prompt comprises a mapping between fields of a first format for intermediate representations and fields of a second format for final representations, and wherein the generating the subsequent prompt comprises generating the subsequent prompt by adding the subsequent iteration system message to the second natural language text, the generated initial intermediate representation from the cache, and the mapping.

17 . The non-transitory machine-readable medium of claim 15 , wherein the compilable computer code is in a format being at least partially proprietary.

18 . The non-transitory machine-readable medium of claim 17 , wherein the compilable computer code is a Core Data Services (CDS) model.

19 . The non-transitory machine-readable medium of claim 15 , wherein the intermediate representation is not compilable.

20 . The non-transitory machine-readable medium of claim 19 , wherein the intermediate representation is a JavaScript Object Notation (JSON) file.