# US 2025/0094687 A1 · Generating semantically repetition-free llm text

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

- Number: US 2025/0094687 A1
- Document ID: US20250094687A1
- Status: Published application
- Kind: A1
- Application number: 18/758,441
- Filed: 2024-06-28
- Published: 2025-03-20
- Earliest claimed: 2023-09-16
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Zheng Wang; Yazhe Hu; Mengqing Guo; Tao Sheng; Jun Qian; Vinod Murli Mamtani
- Web page: https://patentgrep.com/patent/US20250094687A1

## CPC

- G06F 40/166: Editing, e.g. inserting or deleting
- G06F 40/253: Grammatical analysis; Style critique
- G06F 40/289: Phrasal analysis, e.g. finite state techniques or chunking
- G06F 40/30: Semantic analysis
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques for generating repetition-free text using a large language model (LLM) are provided. In one technique, textual content that was generated by an LLM is accessed, where the textual content comprises a plurality of sub-components including a first sub-component and a second sub-component. A first embedding that represents the first sub-component is generated and a second embedding that represents the second sub-component is generated. Based on a similarity between the first embedding and the second embedding, it is determined whether the second sub-component is repetitious with respect to the first sub-component. In response to determining that the second sub-component is repetitious with respect to the first sub-component, at least a portion of the second sub-component is removed from the textual content.

## Claims

### Claim 1

A method comprising:
accessing textual content that was generated by a large language model (LLM), wherein the textual content comprises a plurality of sub-components including a first sub-component and a second sub-component;
generating a first embedding that represents the first sub-component;
generating a second embedding that represents the second sub-component;
based on a similarity between the first embedding and the second embedding, determining whether the second sub-component is repetitious with respect to the first sub-component;
in response to determining that the second sub-component is repetitious with respect to the first sub-component, removing at least a portion of the second sub-component from the textual content;
wherein the method is performed by one or more computing devices.

### Claim 2 (depends on 1)

The method of claim 1, wherein the textual content is first textual content, wherein removing the portion of the second sub-component from the textual content results in modified textual content, further comprising:
submitting, to a second LLM to generate a second textual content that is different than the first textual content, the modified textual content and a prompt to re-phrase the modified textual content.

### Claim 3 (depends on 1)

The method of claim 1, further comprising, prior to generating the first embedding and the second embedding:
determining whether the first sub-component matches the second sub-component at a target level of textual granularity;
wherein generating the first and second embeddings are performed in response to determining that the first sub-component matches the second sub-component at the target level of textual granularity.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
submitting, to a second LLM, the first sub-component and a first prompt to summarize the first sub-component, wherein the second LLM outputs, based on the first sub-component and the first prompt, a first summary of the first sub-component;
submitting, to the second LLM, the second sub-component and a second prompt to summarize the second sub-component, wherein the second LLM outputs, based on the second sub-component and the second prompt, a second summary of the second sub-component;
wherein generating the first embedding comprises inputting the first summary into a language model that generates the first embedding based on the first summary;
wherein generating the second embedding comprises inputting the second summary into the language model that generates the second embedding based on the second summary.

### Claim 5 (depends on 1)

The method of claim 1, wherein:
the plurality of sub-components includes a third sub-component and a fourth sub-component;
the first sub-component and the second sub-component correspond to a first level of granularity of a plurality of levels of granularity;
the third sub-component and the fourth sub-component correspond to a second level of granularity, of the plurality of levels of granularity, that is different than the first level of granularity;
the plurality of levels of granularity comprises one or more of a word, a phrase, a sentence, or a paragraph;
wherein the method further comprises:
generating a third embedding that represents the third sub-component;
generating a fourth embedding that represents the fourth sub-component;
based on a similarity between the third embedding and the fourth embedding, determining whether the fourth sub-component is repetitious with respect to the third sub-component;
in response to determining that the fourth sub-component is repetitious with respect to the third sub-component, removing at least a portion of the fourth sub-component from the textual content.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
determining a frequency, in the textual content, of a particular word; and
in response to determining that the frequency meets one or more content modification criteria, removing one or more occurrences of the particular word from the textual content.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
computing a cosine similarity value based on the first embedding and the second embedding;
determining whether the cosine similarity value exceeds a particular threshold value;
wherein removing is performed in response to determining that the cosine similarity value exceeds the particular threshold value.

### Claim 8 (depends on 1)

The method of claim 1, wherein:
generating the first embedding comprises inputting the first sub-component to a machine-learned model; and
generating the second embedding at least by applying the machine-learned model the second sub-component.

### Claim 9

A method comprising:
accessing first textual content that was generated by a large language model (LLM), wherein the first textual content comprises a plurality of sub-components including a first sub-component and a second sub-component;
based on a similarity between the first sub-component and the second sub-component, determining whether the second sub-component is repetitious with respect to the first sub-component;
in response to determining that the second sub-component is repetitious with respect to the first sub-component, removing at least a portion of the second sub-component from the first textual content to generate modified textual content;
submitting, to a second LLM, the modified textual content and a prompt to rephrase the modified textual content;
accessing second textual content that is generated by the second LLM based on the modified textual content and the prompt;
wherein the method is performed by one or more computing devices.

### Claim 10 (depends on 9)

The method of claim 9, wherein:
the first sub-component and the second sub-component are two instances of a particular word;
removing the portion of the second sub-component comprises removing one of the two instances of the particular word.

### Claim 11 (depends on 9)

The method of claim 9, wherein:
the first sub-component and the second sub-component are different phrases, different sentences, or different paragraphs within the first textual content;
the method further comprising:
generating a first embedding that represents the first sub-component;
generating a second embedding that represents the second sub-component;
the similarity is a similarity between the first embedding and the second embedding.

### Claim 12

One or more non-transitory storage media storing instructions which, when executed by one or more computing devices, cause:
accessing textual content that was generated by a large language model (LLM), wherein the textual content comprises a plurality of sub-components including a first sub-component and a second sub-component;
generating a first embedding that represents the first sub-component;
generating a second embedding that represents the second sub-component;
based on a similarity between the first embedding and the second embedding, determining whether the second sub-component is repetitious with respect to the first sub-component;
in response to determining that the second sub-component is repetitious with respect to the first sub-component, removing at least a portion of the second sub-component from the textual content.

### Claim 13 (depends on 12)

The one or more storage media of claim 12, wherein the textual content is first textual content, wherein removing the portion of the second sub-component from the textual content results in modified textual content, wherein the instructions, when executed by the one or more computing devices, further cause:
submitting, to a second LLM to generate a second textual content that is different than the first textual content, the modified textual content and a prompt to re-phrase the modified textual content.

### Claim 14 (depends on 12)

The one or more storage media of claim 12, wherein the instructions, when executed by the one or more computing devices, further cause, prior to generating the first embedding and the second embedding:
determining whether the first sub-component matches the second sub-component at a target level of textual granularity;
wherein generating the first and second embeddings are performed in response to determining that the first sub-component matches the second sub-component at the target level of textual granularity.

### Claim 15 (depends on 12)

The one or more storage media of claim 12, wherein the instructions, when executed by the one or more computing devices, further cause:
submitting, to a second LLM, the first sub-component and a first prompt to summarize the first sub-component, wherein the second LLM outputs, based on the first sub-component and the first prompt, a first summary of the first sub-component;
submitting, to the second LLM, the second sub-component and a second prompt to summarize the second sub-component, wherein the second LLM outputs, based on the second sub-component and the second prompt, a second summary of the second sub-component;
wherein generating the first embedding comprises inputting the first summary into a language model that generates the first embedding based on the first summary;
wherein generating the second embedding comprises inputting the second summary into the language model that generates the second embedding based on the second summary.

### Claim 16 (depends on 12)

The one or more storage media of claim 12, wherein:
the plurality of sub-components includes a third sub-component and a fourth sub-component;
the first sub-component and the second sub-component correspond to a first level of granularity of a plurality of levels of granularity;
the third sub-component and the fourth sub-component correspond to a second level of granularity, of the plurality of levels of granularity, that is different than the first level of granularity;
the plurality of levels of granularity comprises one or more of a word, a phrase, a sentence, or a paragraph;
wherein the instructions, when executed by the one or more computing devices, further cause:
generating a third embedding that represents the third sub-component;
generating a fourth embedding that represents the fourth sub-component;
based on a similarity between the third embedding and the fourth embedding, determining whether the fourth sub-component is repetitious with respect to the third sub-component;
in response to determining that the fourth sub-component is repetitious with respect to the third sub-component, removing at least a portion of the fourth sub-component from the textual content.

### Claim 17 (depends on 12)

The one or more storage media of claim 12, wherein the instructions, when executed by the one or more computing devices, further cause:
determining a frequency, in the textual content, of a particular word; and
in response to determining that the frequency meets one or more content modification criteria, removing one or more occurrences of the particular word from the textual content.

### Claim 18 (depends on 12)

The one or more storage media of claim 12, wherein the instructions, when executed by the one or more computing devices, further cause:
computing a cosine similarity value based on the first embedding and the second embedding;
determining whether the cosine similarity value exceeds a particular threshold value;
wherein removing is performed in response to determining that the cosine similarity value exceeds the particular threshold value.

### Claim 19 (depends on 12)

The one or more storage media of claim 12, wherein:
generating the first embedding comprises inputting the first sub-component to a machine-learned model; and
generating the second embedding at least by applying the machine-learned model the second sub-component.

### Claim 20 (depends on 9)

One or more non-transitory storage media storing instructions which, when executed by one or more computing devices, cause performance of the method recited in claim 9.
