# US 2026/0064671 A1 · Sql fixit - automated generation of fine-tuning data using llms

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2026/0064671 A1
- Document ID: US20260064671A1
- Status: Published application
- Kind: A1
- Application number: 18/820,708
- Filed: 2024-08-30
- Published: 2026-03-05
- Earliest claimed: 2024-08-30
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Clemence Lanfranchi; Damien Hilloulin; Rhicheek Patra; Sungpack Hong; Hassan Chafi; Yakupitiyage Don Dharmasir; Cong Duy Vu Hoang; Gioacchino Tangari; Thanh Vu; Thanh Long Duong
- Web page: https://patentgrep.com/patent/US20260064671A1

## CPC

- G06F 16/243: {Natural language query formulation}
- G06F 16/212: {with details for data modelling support}
- G06F 16/2365: {Ensuring data consistency and integrity}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Here is an innovative way to generate a finetuning corpus that maximizes the accuracy of a target large language model (LLM) that generates a database statement. From a natural language request, the target LLM infers an incorrect database statement that, based on a first database schema, could not satisfy a technical requirement. Based on the natural language request, a correct database statement is generated that, based on a second database schema, could satisfy the technical requirement. For the second database schema, a restatement of the natural language request is generated. In inputs during finetuning, the target LLM accepts: the correct database statement, the incorrect database statement, and the restatement of the natural language request.

## Claims

### Claim 1

A method comprising:
generating, by a large language model, from a natural language request, an incorrect database statement that, based on a first database schema, could not satisfy a technical requirement;
generating, based on the natural language request, a correct database statement that, based on a second database schema, could satisfy the technical requirement;
inferring, for the second database schema, a restatement of the natural language request; and
supervised finetuning the large language model by:
a) accepting, in an input to the large language model, the restatement of the natural language request,
b) inferentially generating, by the large language model in response to said accepting, a new database statement, and
c) backpropagating a nonzero error through the large language model in response to the new database statement being different from said correct database statement;
wherein the method is performed by one or more computers.

### Claim 2 (depends on 1)

The method of claim 1 further comprising generating natural language that specifies the technical requirement.

### Claim 3 (depends on 2)

The method of claim 2 wherein:
the method further comprises inserting, into a linguistic prompt, natural language that specifies the technical requirement;
said generating the correct database statement comprises a second large language model accepting the linguistic prompt as input.

### Claim 4 (depends on 3)

The method of claim 3 wherein said generating the restatement of the natural language request is performed after said accepting the linguistic prompt as input.

### Claim 5 (depends on 2)

The method of claim 2 wherein:
the method further comprises inserting, into a linguistic prompt, an identifier of a dialect of standard query language (SQL);
a step comprises a second large language model accepting the linguistic prompt as input;
said step is at least one selected from a group consisting of said generating the natural language that specifies the technical requirement and said generating the correct database statement.

### Claim 6 (depends on 12)

The method of claim 12 further comprising inferentially validating the correct database statement.

### Claim 7 (depends on 6)

The method of claim 6 wherein:
said generating the restatement of the natural language request is performed by a second large language model;
said inferentially validating is performed by a third large language model that contains more neural connection weights than the second large language model.

### Claim 8 (depends on 12)

The method of claim 12 further comprising:
generating a second incorrect database statement that, based on the second database schema, could not satisfy the technical requirement;
inferentially invalidating the second incorrect database statement.

### Claim 9 (depends on 1)

The method of claim 1 wherein said generating the restatement of the natural language request comprises inferring from the natural language request.

### Claim 10 (depends on 1)

The method of claim 1 wherein the restatement of the natural language request is longer than the natural language request.

### Claim 11 (depends on 1)

The method of claim 1 wherein the technical requirement is not referenced in the restatement of the natural language request.

### Claim 12 (depends on 1)

The method of claim 1 performed without accessing a database configured with: the first database schema or the second database schema.

### Claim 13

One or more non-transitory computer-readable media storing instructions that, when executed by one or more processors, cause:
generating, by a large language model, from a natural language request, an incorrect database statement that, based on a first database schema, could not satisfy a technical requirement;
generating, based on the natural language request, a correct database statement that, based on a second database schema, could satisfy the technical requirement;
inferring, for the second database schema, a restatement of the natural language request; and
supervised finetuning the large language model by:
a) accepting, in an input to the large language model, the restatement of the natural language request,
b) inferentially generating, by the large language model in response to said accepting, a new database statement, and
c) backpropagating a nonzero error through the large language model in response to the new database statement being different from said correct database statement.

### Claim 14 (depends on 13)

The one or more non-transitory computer-readable media of claim 13 wherein the instructions further cause generating natural language that specifies the technical requirement.

### Claim 15 (depends on 14)

The one or more non-transitory computer-readable media of claim 14 wherein:
the instructions further cause inserting, into a linguistic prompt, natural language that specifies the technical requirement;
said generating the correct database statement comprises a second large language model accepting the linguistic prompt as input.

### Claim 16 (depends on 15)

The one or more non-transitory computer-readable media of claim 15 wherein said generating the restatement of the natural language request is performed after said accepting the linguistic prompt as input.

### Claim 17 (depends on 14)

The one or more non-transitory computer-readable media of claim 14 wherein:
the instructions further cause inserting, into a linguistic prompt, an identifier of a dialect of standard query language (SQL);
a step comprises a second large language model accepting the linguistic prompt as input;
said step is at least one selected from a group consisting of said generating the natural language that specifies the technical requirement and said generating the correct database statement.

### Claim 18 (depends on 13)

The one or more non-transitory computer-readable media of claim 13 wherein the instructions further cause inferentially validating the correct database statement.

### Claim 19 (depends on 18)

The one or more non-transitory computer-readable media of claim 18 wherein:
said generating the restatement of the natural language request is performed by a second large language model;
said inferentially validating is performed by a third large language model that contains more neural connection weights than the second large language model.

### Claim 20 (depends on 21)

The one or more non-transitory computer-readable media of claim 21 wherein the instructions further cause:
generating a second incorrect database statement that, based on the second database schema, could not satisfy the technical requirement;
inferentially invalidating the second incorrect database statement.

### Claim 21 (depends on 13)

The one or more non-transitory computer-readable media of claim 13 wherein the instructions do not cause accessing a database configured with: the first database schema or the second database schema.

### Claim 22 (depends on 1)

The method of claim 1 wherein said generating, by the large language model, the incorrect database statement comprises the large language model inferring structured query language (SQL).
