# US 2025/0156635 A1 · Token optimization through minimized payload for large language models

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

- Number: US 2025/0156635 A1
- Document ID: US20250156635A1
- Status: Published application
- Kind: A1
- Application number: 18/388,686
- Filed: 2023-11-10
- Published: 2025-05-15
- Earliest claimed: 2023-11-10
- Assignees: Sap SE
- Applicants: Sap SE
- Inventors: David Kunz
- Web page: https://patentgrep.com/patent/US20250156635A1

## CPC

- G06F 40/205: Parsing
- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06F 40/30: Semantic analysis
- G06F 40/56: Natural language generation
- G06N 3/02: Neural networks
- G06N 3/044: Recurrent networks, e.g. Hopfield networks
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

In an example embodiment, a solution is provided by utilizing an intermediate file format for either an input prompt to or output from a large language model (LLM) (or both). This intermediate file format is one that has the property of being minimizable, meaning that tokens contained in a file of that intermediate file format can be stripped out or otherwise removed without changing the semantic meaning of the file. The input prompt can be created in or converted to this intermediate file format and then minimized prior to being sent to the LLM for text generation. Furthermore, a system message included with the input prompt may instruct the LLM to generate text in the intermediate file format, in minimized form. A specialized parser may then be included to parse the minimized output produced by the LLM.

## Claims

### Claim 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 natural language text describing a request to generate text;
accessing contextual information regarding the natural language text;
generating a prompt using the natural language text, the contextual information, and a system message, the system message including instructions to produce generated text in an intermediate file format in minimized form, the intermediate file format being a format that enables portions of a file stored in the intermediate file format to be removed without altering semantic meaning of the file;
passing the prompt to a large language model (LLM);
receiving, from the LLM, generated text in the intermediate file format in minimized form; and
parsing the generated text using a parser configured to parse files in the intermediate file format, producing parsed generated text.

### Claim 2 (depends on 1)

The system of claim 1, wherein the generated text is compilable computer code.

### Claim 3 (depends on 1)

The system of claim 1, wherein the prompt includes at least some text in the intermediate file format in minimized form.

### Claim 4 (depends on 3)

The system of claim 3, wherein the LLM has a hard limit on a number of input tokens it will process for a single prompt and the prompt includes fewer tokens than the hard limit due to presence of the at least some text in the intermediate file format in minimized form.

### Claim 5 (depends on 1)

The system of claim 1, wherein the minimized form includes having no spaces.

### Claim 6 (depends on 1)

The system of claim 1, wherein the minimized form includes having no carriage returns.

### Claim 7 (depends on 1)

The system of claim 1, wherein the intermediate file format is Javascript Object Notation (JSON).

### Claim 8

A method comprising:
receiving natural language text describing a request to generate text;
accessing contextual information regarding the natural language text;
generating a prompt using the natural language text, the contextual information, and a system message, the system message including instructions to produce generated text in an intermediate file format in minimized form, the intermediate file format being a format that enables portions of a file stored in the intermediate file format to be removed without altering semantic meaning of the file;
passing the prompt to a large language model (LLM);
receiving, from the LLM, generated text in the intermediate file format in minimized form; and
parsing the generated text using a parser configured to parse files in the intermediate file format, producing parsed generated text.

### Claim 9 (depends on 8)

The method of claim 8, wherein the generated text is compilable computer code.

### Claim 10 (depends on 8)

The method of claim 8, wherein the prompt includes at least some text in the intermediate file format in minimized form.

### Claim 11 (depends on 10)

The method of claim 10, wherein the LLM has a hard limit on a number of input tokens it will process for a single prompt and the prompt includes fewer tokens than the hard limit due to presence of the at least some text in the intermediate file format in minimized form.

### Claim 12 (depends on 8)

The method of claim 8, wherein the minimized form includes having no spaces.

### Claim 13 (depends on 8)

The method of claim 8, wherein the minimized form includes having no carriage returns.

### Claim 14 (depends on 8)

The method of claim 8, wherein the intermediate file format is Javascript Object Notation (JSON).

### Claim 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 natural language text describing a request to generate text;
accessing contextual information regarding the natural language text;
generating a prompt using the natural language text, the contextual information, and a system message, the system message including instructions to produce generated text in an intermediate file format in minimized form, the intermediate file format being a format that enables portions of a file stored in the intermediate file format to be removed without altering semantic meaning of the file;
passing the prompt to a large language model (LLM);
receiving, from the LLM, generated text in the intermediate file format in minimized form; and
parsing the generated text using a parser configured to parse files in the intermediate file format, producing parsed generated text.

### Claim 16 (depends on 15)

The non-transitory machine-readable medium of claim 15, wherein the generated text is compilable computer code.

### Claim 17 (depends on 15)

The non-transitory machine-readable medium of claim 15, wherein the prompt includes at least some text in the intermediate file format in minimized form.

### Claim 18 (depends on 17)

The non-transitory machine-readable medium of claim 17, wherein the LLM has a hard limit on a number of input tokens it will process for a single prompt and the prompt includes fewer tokens than the hard limit due to presence of the at least some text in the intermediate file format in minimized form.

### Claim 19 (depends on 15)

The non-transitory machine-readable medium of claim 15, wherein the minimized form includes having no spaces.

### Claim 20 (depends on 15)

The non-transitory machine-readable medium of claim 15, wherein the minimized form includes having no carriage returns.
