# US 2025/0147973 A1 · In-context and semantic-aware ensemble model for document retrieval

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

- Number: US 2025/0147973 A1
- Document ID: US20250147973A1
- Status: Published application
- Kind: A1
- Application number: 18/504,256
- Filed: 2023-11-08
- Published: 2025-05-08
- Earliest claimed: 2023-11-08
- Assignees: Adobe Inc.
- Applicants: Adobe Inc.
- Inventors: Tong Yu; Xiang Chen; Victor Soares Bursztyn; Uttaran Bhattacharya; Eunyee Koh; Saayan Mitra; Alexandru Ionut Hodorogea; Kenneth Russell; Saurabh Tripathy; Manas Garg
- Web page: https://patentgrep.com/patent/US20250147973A1

## CPC

- G06F 16/24578: {using ranking}
- G06F 16/3347: {using vector based model}
- G06F 16/93: Document management systems
- G06F 16/951: Indexing; Web crawling techniques
- G06N 3/042: Knowledge-based neural networks; Logical representations of neural networks
- G06N 3/045: Combinations of networks
- G06N 3/08: Learning methods
- G06N 20/20: Ensemble learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method, apparatus, non-transitory computer readable medium, and system for document retrieval include obtaining a query and a document. A prompt generator generates a prompt for a reasoning model based on the query and the document. The reasoning model generates a reasoning result based on the prompt. In some cases, the reasoning result indicates that the document answers the query. A machine learning model provides the document in response to the query based on the reasoning result.

## Claims

### Claim 1

A method of document retrieval, comprising:
obtaining a query to a database and a document from the database;
generating, using a prompt generator, a prompt for a reasoning model based on the query and the document;
generating, using the reasoning model, a reasoning result by performing a self-attention mechanism on the prompt, wherein the reasoning result indicates that the document answers the query based on a query-document contrastive learning loss; and
providing the document from the database in response to the query based on the reasoning result.

### Claim 2 (depends on 1)

The method of claim 1, wherein obtaining the document comprises:
generating, using a semantic search model, a query embedding based on the query;
ranking, using the semantic search model, a plurality of documents based on the query embedding to obtain a ranking result; and
selecting, using the semantic search model, the document from the plurality of documents based on the ranking result.

### Claim 3 (depends on 2)

The method of claim 2, wherein:
computing a document embedding based on the document; and
comparing the query embedding to the document embedding, wherein the ranking is based on the comparison.

### Claim 4 (depends on 2)

The method of claim 2, further comprising:
combining, using an ensemble model, the reasoning result and the ranking result to obtain a selection result, wherein the document is provided based on the selection result.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
evaluating, using a rule-based model, the document to obtain a rule-based result, wherein the selection result is based at least in part on the rule-based result.

### Claim 6 (depends on 1)

The method of claim 1, wherein generating the prompt further comprises:
formulating the prompt as a multiple-choice question.

### Claim 7 (depends on 1)

The method of claim 1, wherein obtaining the document comprises:
retrieving a plurality of documents from the database, wherein the document is selected from the plurality of documents based on the reasoning result.

### Claim 8

A method of training a machine learning model, comprising:
obtaining training data including a prompt, a document, and a ground-truth reasoning result that indicates whether the document answers a query indicated by the prompt;
initializing a reasoning model;
generating, using the reasoning model, a predicted reasoning result that indicates whether the document answers the query; and
training the reasoning model based on the predicted reasoning result and the ground-truth reasoning result.

### Claim 9 (depends on 8)

The method of claim 8, wherein training the reasoning model comprises:
computing a cross entropy loss based on the predicted reasoning result and the ground-truth reasoning result.

### Claim 10 (depends on 8)

The method of claim 8, further comprising:
training a semantic search model to rank documents based on search queries.

### Claim 11 (depends on 10)

The method of claim 10, wherein training the semantic search model comprises:
calculating a contrastive loss based on the query and the document.

### Claim 12 (depends on 10)

The method of claim 10, further comprising:
training an ensemble model to combine a reasoning result of the reasoning model and a ranking result of the semantic search model.

### Claim 13 (depends on 12)

The method of claim 12, wherein training the ensemble model comprises:
performing a grid search of weights of the semantic search model, the reasoning model, and a rule-based model.

### Claim 14

An apparatus, comprising:
at least one processor;
at least one memory including instructions executable by the at least one processor;
a prompt generator comprising parameters stored in the at least one memory, wherein the prompt generator is trained to generate a prompt based on a query and a document; and
a reasoning model comprising parameters stored in the at least one memory, wherein the reasoning model is trained to output a reasoning result by performing a self-attention mechanism on the prompt, and wherein the reasoning result indicates that the document answers the query based on a query-document contrastive learning loss.

### Claim 15 (depends on 14)

The apparatus of claim 14, further comprising:
a semantic search model comprising parameters stored in the at least one memory, wherein the semantic search model is trained to output a ranking result based on the query and to rank a plurality of documents based on the ranking result.

### Claim 16 (depends on 15)

The apparatus of claim 15, further comprising:
an ensemble model comprising parameters stored in the at least one memory, wherein the ensemble model is trained to combine the ranking result and the reasoning result.

### Claim 17 (depends on 14)

The apparatus of claim 14, further comprising:
a rule-based model comprising parameters stored in the at least one memory, wherein the rule-based model is configured to output a rule-based result based on the document.

### Claim 18 (depends on 14)

The apparatus of claim 14, wherein:
the reasoning model comprises a large language model (LLM).

### Claim 19 (depends on 18)

The apparatus of claim 18, wherein:
the reasoning model comprises a transformer model.

### Claim 20 (depends on 14)

The apparatus of claim 14, further comprising:
a database storing a plurality of documents.
