# US 2025/0165721 A1 · Guided dynamic construction of large language model (llm) prompts

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

- Number: US 2025/0165721 A1
- Document ID: US20250165721A1
- Status: Published application
- Kind: A1
- Application number: 18/515,246
- Filed: 2023-11-20
- Published: 2025-05-22
- Earliest claimed: 2023-11-20
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Roy EISENSTADT; Abed El Kader ASI; Bar SEGAL; Eyal ZACH; Royi RONEN
- Web page: https://patentgrep.com/patent/US20250165721A1

## CPC

- G06F 40/40: Processing or translation of natural language (natural language analysis G06F40/20; semantic analysis G06F40/30)
- G06F 40/103: Formatting, i.e. changing of presentation of documents (automatic justification G06F40/189; automatic line break hyphenation G06F40/191)
- G06F 40/30: Semantic analysis
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Example solutions for reducing the likelihood of hallucinations by large language models (LLMs) and improving the relevance of generated text are disclosed. A set of multiple of machine learning (ML) models, each custom-trained to identify a different specific topic within text, dynamically generate multiple topic-specific prompts from a received email in an email thread. A user, responding to the prompts, produces material that is used in conjunction with customer relations management (CRM) data and enterprise suite data (e.g., calendar/schedule information) to dynamically generate an LLM prompt. An LLM, using the prompt, generates output text suitable for a business correspondence, such as a reply email, to the sender of the email. The combination of the responses to the multiple topic-specific prompts and the CRM and enterprise suite data in the LLM prompt both ensures relevance of the reply correspondence and minimizes the risk of hallucinations.

## Claims

### Claim 1

A system comprising:
a processor; and
a computer-readable medium storing instructions that are operative upon execution by the processor to:
receive a first electronic document associated with a first source;
dynamically generate, from the first electronic document, a plurality of topic-specific prompts using a plurality of machine learning (ML) models, each ML model of the plurality of ML models being differently-trained to identify a different specific topic within text;
receive, for each topic-specific prompt of the plurality of topic-specific prompts, a response passage;
dynamically generate a language model prompt using customer relations management (CRM) data associated with the first source, enterprise suite data associated with the first source, and the response passage for the plurality of topic-specific prompts; and
dynamically generate an output text using a language model and the language model prompt.

### Claim 2 (depends on 1)

The system of claim 1, wherein the instructions are further operative to:
transmit the output text across a computer network.

### Claim 3 (depends on 1)

The system of claim 1, wherein the instructions are further operative to:
prior to transmitting the output text, verify, with a responsible artificial intelligence (RAI) service that the output text passes RAI criteria.

### Claim 4 (depends on 1)

The system of claim 1, wherein the instructions are further operative to:
display the plurality of topic-specific prompts in a user interface (UI);
display the output text in the UI;
annotate the output text in the UI to indicate elements in the output text having traceability to an associated input source; and
based on at least receiving a selection of an annotation of the output text in the UI, display at least a portion of the associated input source or an identification of the associated input source.

### Claim 5 (depends on 4)

The system of claim 4, wherein the associated input source comprises an input source selected from the list consisting of:
a response passage to a topic-specific prompt, an email thread comprising the first electronic document, CRM data, and enterprise suite data.

### Claim 6 (depends on 4)

The system of claim 4, wherein annotating the output text comprises highlighting the elements in the output text with differing colors, and wherein each of the differing colors of the highlighting corresponds to a category of the associated input source.

### Claim 7 (depends on 1)

The system of claim 1, wherein the instructions are further operative to:
identify additional associated electronic documents that are associated with the first electronic document, wherein providing the first electronic document to the plurality of ML models comprises providing the first electronic document together with the additional associated electronic documents to the plurality of ML models.

### Claim 8

A computer-implemented method comprising:
receiving a first electronic document associated with a first source across a computer network;
dynamically generating, from the first electronic document, a plurality of topic-specific prompts using a plurality of machine learning (ML) models, each ML model of the plurality of ML models being differently-trained to identify a different specific topic within text;
receiving, for each topic-specific prompt of the plurality of topic-specific prompts, a response passage;
dynamically generating a language model prompt using customer relations management (CRM) data associated with the first source, enterprise suite data associated with the first source, and the response passages for the plurality of topic-specific prompts; and
dynamically generating an output text using a language model and the language model prompt.

### Claim 9 (depends on 8)

The computer-implemented method of claim 8, further comprising:
transmitting the output text across the computer network.

### Claim 10 (depends on 8)

The computer-implemented method of claim 8, further comprising:
prior to transmitting the output text, verifying, with a responsible artificial intelligence (RAI) service that the output text passes RAI criteria.

### Claim 11 (depends on 8)

The computer-implemented method of claim 8, further comprising:
displaying the plurality of topic-specific prompts in a user interface (UI);
displaying the output text in the UI;
annotating the output text, in the UI, to indicate elements in the output text having traceability to an associated input source; and
based on at least receiving a selection of an annotation of the output text in the UI, displaying at least a portion of the associated input source or an identification of the associated input source.

### Claim 12 (depends on 11)

The computer-implemented method of claim 11, wherein the associated input source comprises an input source selected from the list consisting of:
a response passage to a topic-specific prompt, an email thread comprising the first electronic document, CRM data, and enterprise suite data.

### Claim 13 (depends on 11)

The computer-implemented method of claim 11, wherein annotating the output text comprises highlighting the elements in the output text with differing colors, and wherein each of the differing colors of the highlighting corresponds to a category of the associated input source.

### Claim 14 (depends on 8)

The computer-implemented method of claim 8, further comprising:
identifying additional associated electronic documents that are associated with the first electronic document, wherein providing the first electronic document to the plurality of ML models comprises providing the first electronic document together with the additional associated electronic documents to the plurality of ML models.

### Claim 15

A computer storage device having computer-executable instructions stored thereon, which, on execution by a computer, cause the computer to perform operations comprising:
receiving a first electronic document, comprising a first email, associated with a first source across a computer network;
dynamically generating, from the first electronic document, a plurality of topic-specific prompts using a plurality of machine learning (ML) models, each ML model of the plurality of ML models being differently-trained to identify a different specific topic within text;
receiving, for each topic-specific prompt of the plurality of topic-specific prompts, a response passage;
dynamically generating a language model prompt using customer relations management (CRM) data associated with the first source, enterprise suite data associated with the first source, and the response passages for the plurality of topic-specific prompts; and
dynamically generating an output text using a language model and the language model prompt.

### Claim 16 (depends on 15)

The computer storage device of claim 15, wherein the operations further comprise:
transmitting, across the computer network, the output text as a second email.

### Claim 17 (depends on 15)

The computer storage device of claim 15, wherein the operations further comprise:
displaying the plurality of topic-specific prompts in a user interface (UI);
displaying the output text in the UI;
annotating the output text, in the UI, to indicate elements in the output text having traceability to an associated input source; and
based on at least receiving a selection of an annotation of the output text in the UI, displaying at least a portion of the associated input source or an identification of the associated input source.

### Claim 18 (depends on 17)

The computer storage device of claim 17, wherein the associated input source comprises an input source selected from the list consisting of:
a response passage to a topic-specific prompt, an email thread comprising the first electronic document, CRM data, and enterprise suite data.

### Claim 19 (depends on 17)

The computer storage device of claim 17, wherein annotating the output text comprises highlighting the elements in the output text with differing colors, and wherein each of the differing colors of the highlighting corresponds to a category of the associated input source.

### Claim 20 (depends on 15)

The computer storage device of claim 15, wherein the operations further comprise:
identifying additional associated electronic documents that are associated with the first electronic document, wherein providing the first electronic document to the plurality of ML models comprises providing the first electronic document together with the additional associated electronic documents to the plurality of ML models.
