# US 2026/0093731 A1 · Computing systems and methods for llm-based query expansion for use in information retrieval

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

- Number: US 2026/0093731 A1
- Document ID: US20260093731A1
- Status: Published application
- Kind: A1
- Application number: 19/324,823
- Filed: 2025-09-10
- Published: 2026-04-02
- Earliest claimed: 2024-07-12
- Assignees: The Toronto-Dominion Bank
- Applicants: The Toronto-Dominion Bank
- Inventors: Ilan GOFMAN; Jiapeng WU; Jesse Cole CRESSWELL; Guangwei YU; Maksims VOLKOVS
- Web page: https://patentgrep.com/patent/US20260093731A1

## CPC

- G06F 16/3338: {Query expansion}
- G06F 16/332: Query formulation
- G06F 16/3344: {using natural language analysis}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods for performing query expansion. A computing system uses a large language model (LLM) to generate one or more synthetic queries for each document of a set of documents. For a user query, the computing system: selects one or more of the synthetic queries related to the user query; generates an adaptive few-shot prompt to instruct the LLM to generate a response to the query, wherein the adaptive few-shot prompt comprises an example query-response pair for each of the selected one more synthetic queries; provides the adaptive few-shot prompt to the LLM as an input; and generates an amended query based on the output of the LLM in response to the adaptive few-shot prompt.

## Claims

### Claim at position 1

-20. (canceled)

### Claim 21

A system for performing query expansion, the system comprising:
a memory, a communication interface, and a processor operatively coupled to the memory and the communication interface;
the processor configured to:
for each document of a set of documents, use a large language model (LLM) to generate one or more synthetic queries related to the document;
select one or more synthetic queries related to a query;
dynamically generate an adaptive few-shot prompt to instruct the LLM to generate a response to the query, wherein the adaptive few-shot prompt comprises an example query-response pair for each of the selected one more synthetic queries;
provide the adaptive few-shot prompt to the LLM; and
generate an amended query by combining the query and an output of the LLM in response to the adaptive few-shot prompt.

### Claim 22 (depends on 21)

The system of claim 21, wherein using the LLM to generate the one or more synthetic queries comprises providing a query few-shot prompt to the LLM that instructs the LLM to generate a synthetic query that is answered by the document, wherein the query few-shot prompt comprises a plurality of example document-query pairs.

### Claim 23 (depends on 21)

The system of claim 21, wherein using the LLM to generate the one or more synthetic queries comprises dividing the document into one or more chunks corresponding to portions of text and instructing the LLM to generate a synthetic query for each of the one or more chunks.

### Claim 24 (depends on 21)

The system of claim 21, wherein the processor is further configured to, prior to selecting the one or more synthetic queries related to the query, discard any synthetic query that does not satisfy a quality requirement.

### Claim 25 (depends on 24)

The system of claim 24, wherein the processor is further configured to, for each synthetic query, determine whether the synthetic query satisfies the quality requirement by using the LLM to determine whether the synthetic query is relevant to the related document.

### Claim 26 (depends on 25)

The system of claim 25, wherein using the LLM to determine whether the synthetic query is relevant to the related document comprises providing the LLM with a relevance few-shot prompt that instructs the LLM to determine whether the synthetic query is relevant to the document, wherein the relevance few-shot prompt comprises one or more examples, each example comprising an example query, an example document or an example portion of a document, and an indication of whether the example query is relevant to the example document or the example portion of the document.

### Claim 27 (depends on 24)

The system of claim 24, wherein the processor is further configured to, for each synthetic query, instruct the LLM to generate a response to the synthetic query from the related document, and determine that the synthetic query does not satisfy the quality requirement if the LLM is unable to generate the response to the synthetic query from the related document.

### Claim 28 (depends on 27)

The system of claim 27, wherein the example query-response pair for a synthetic query comprises the synthetic query and the response to the synthetic query generated by the LLM from the related document.

### Claim 29 (depends on 21)

The system of claim 21, wherein the processor is further configured to store the synthetic queries in a synthetic query data store in the memory.

### Claim 30 (depends on 21)

The system of claim 21, wherein the processor is further configured to assign a similarity score to each synthetic query that represents a similarity between the synthetic query and the query, and the one or more synthetic queries related to the query are selected based on the respective similarity scores.

### Claim 31 (depends on 30)

The system of claim 30, wherein the similarity score is based on embeddings generated from an embedding model.

### Claim 32 (depends on 30)

The system of claim 30, wherein the selected one or more synthetic queries related to the query comprises k most similar synthetic queries to the query based on the respective similarity scores, wherein k is an integer greater than or equal to one.

### Claim 33 (depends on 30)

The system of claim 30, wherein the selected one or more synthetic queries related to the query comprises each synthetic query that has a similarity score that exceeds a predetermined threshold.

### Claim 34 (depends on 21)

The system of claim 21, wherein the output of the LLM in response to the adaptive few-shot prompt is a pseudo document.

### Claim 35 (depends on 21)

The system of claim 21, wherein the processor is further configured to perform an information retrieval task on the set of documents based on the amended query using a zero-shot information retrieval system.

### Claim 36 (depends on 35)

The system of claim 35, wherein the zero-shot information retrieval system comprises an embedded model and/or a reranker model, and the processor is further configured to, prior to performing the information retrieval task, tune the embedded model and/or the reranker model using the synthetic queries and their related documents.

### Claim 37

A method for performing query expansion, the method executed in a computing environment comprising one or more processors, a communication interface, and memory, and the method comprising:
for each document of a set of documents, causing a large language model (LLM) to generate one or more synthetic queries related to the document;
selecting one or more synthetic queries related to a query;
dynamically generating an adaptive few-shot prompt to instruct the LLM to generate a response to the query, wherein the adaptive few-shot prompt comprises an example query-response pair for each of the selected one more synthetic queries;
providing the adaptive few-shot prompt to the LLM; and
generating an amended query by combining the query and an output of the LLM in response to the adaptive few-shot prompt.

### Claim 38 (depends on 37)

The method of claim 37, further comprising, prior to selecting the one or more synthetic queries related to the query, discarding any synthetic query that does not satisfy a quality requirement.

### Claim 39 (depends on 38)

The method of claim 38, further comprising, for each synthetic query, determining whether the synthetic query satisfies the quality requirement by using the LLM to determine whether the synthetic query is relevant to the related document.

### Claim 40

A non-transitory computer readable medium storing computer executable instructions which, when executed by at least one computer processor, cause the at least one computer processor to carry out a method for performing query expansion, the method comprising:
for each document of a set of documents, instructing a large language model (LLM) to generate one or more synthetic queries related to the document;
selecting one or more synthetic queries related to a query;
dynamically generating an adaptive few-shot prompt to instruct the LLM to generate a response to the query, wherein the adaptive few-shot prompt comprises an example query-response pair for each of the selected one more synthetic queries;
providing the adaptive few-shot prompt to the LLM; and
generating an amended query by combining the query and an output of the LLM in response to the adaptive few-shot prompt.
