# US 12,182,125 B1 · Systems and methods for trained embedding mappings for improved retrieval augmented generation

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

- Number: US 12,182,125 B1
- Document ID: US12182125B1
- Status: Granted
- Kind: B1
- Application number: 18/443,237
- Filed: 2024-02-15
- Granted: 2024-12-31
- Earliest claimed: 2024-02-15
- Assignees: Snark AI, Inc.
- Applicants: Snark AI, Inc.
- Inventors: Davit Buniatyan
- Web page: https://patentgrep.com/patent/US12182125B1

## CPC

- G06F 16/2455: Query execution
- G06F 11/3409: {for performance assessment}
- G06N 3/08: Learning methods
- G06N 20/00: Machine learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Systems and methods for implementing trained embedding mappings for improved retrieval augmented generation are disclosed. A system can maintain a dataset comprising a first set of embeddings corresponding to a first embeddings space and stored in association with a set of query results for the first set of embeddings. The set of query results can correspond to a second embeddings space. The system can train a transformation data structure using the first set of embeddings and the set of query results. The transformation data structure can be used to transform the first set of embeddings to the second embeddings space. The system can execute a search operation for the second embeddings space by applying the transformation data structure to a second set of embeddings corresponding to the first embeddings space.

## Claims

### Claim 1

A system, comprising:
one or more processors coupled to non-transitory memory, the one or more processors configured to:
store a dataset comprising a first set of embeddings corresponding to a first embeddings space and stored in association with a set of query results for the first set of embeddings, the set of query results corresponding to a second embeddings space;
train a transformation data structure using the first set of embeddings and the set of query results, the transformation data structure to transform the first set of embeddings to the second embeddings space, wherein the first embeddings space is different from the second embeddings space; and
execute a search operation for the second embeddings space by applying the transformation data structure to a second set of embeddings corresponding to the first embeddings space.

### Claim 2 (depends on 1)

The system of claim 1, wherein the dataset further comprises a corpus of text data corresponding to the second embeddings space.

### Claim 3 (depends on 1)

The system of claim 1, wherein the one or more processors are further configured to execute the search operation over a corpus of embeddings corresponding to the second embeddings space.

### Claim 4 (depends on 3)

The system of claim 3, wherein the one or more processors are further configured to:
generate a set of transformed embeddings based on an intermediate transformation data structure and the first set of embeddings; and
determine an error based on the set of transformed embeddings and the set of query results.

### Claim 5 (depends on 4)

The system of claim 4, wherein the one or more processors are further configured to update the intermediate transformation data structure according to the error to generate the transformation data structure.

### Claim 6 (depends on 4)

The system of claim 4, wherein the one or more processors are further configured to determine the error based on a similarity search between the set of transformed embeddings and the set of query results.

### Claim 7 (depends on 1)

The system of claim 1, wherein the one or more processors are further configured to:
receive a first query specifying the second set of embeddings; and
execute the search operation in response to the first query.

### Claim 8 (depends on 7)

The system of claim 7, wherein the one or more processors are further configured to execute the search operation during training of the transformation data structure in response to the first query.

### Claim 9

A method, comprising:
storing, by one or more processors coupled to non-transitory memory, a dataset comprising a first set of embeddings corresponding to a first embeddings space and stored in association with a set of query results for the first set of embeddings, the set of query results corresponding to a second embeddings space;
training, by the one or more processors, a transformation data structure using the first set of embeddings and the set of query results, the transformation data structure to transform the first set of embeddings to the second embeddings space, wherein the first embeddings space is different from the second embeddings space; and
executing, by the one or more processors, a search operation for the second embeddings space by applying the transformation data structure to a second set of embeddings corresponding to the first embeddings space.

### Claim 10 (depends on 9)

The method of claim 9, wherein the dataset further comprises a corpus of text data corresponding to the second embeddings space.

### Claim 11 (depends on 9)

The method of claim 9, further comprising executing, by the one or more processors, the search operation over a corpus of embeddings corresponding to the second embeddings space.

### Claim 12 (depends on 11)

The method of claim 11, wherein training the transformation data structure comprises:
generating, by the one or more processors, a set of transformed embeddings based on an intermediate transformation data structure and the first set of embeddings; and
determining, by the one or more processors, an error based on the set of transformed embeddings and the set of query results.

### Claim 13 (depends on 12)

The method of claim 12, further comprising updating, by the one or more processors, the intermediate transformation data structure according to the error to generate the transformation data structure.

### Claim 14 (depends on 12)

The method of claim 12, further comprising determining, by the one or more processors, the error based on a similarity search between the set of transformed embeddings and the set of query results.

### Claim 15 (depends on 9)

The method of claim 9, further comprising:
receiving, by the one or more processors, a first query specifying the second set of embeddings; and
executing, by the one or more processors, the search operation in response to the first query.

### Claim 16 (depends on 15)

The method of claim 15, further comprising executing, by the one or more processors, the search operation during training of the transformation data structure in response to the first query.

### Claim 17

A system, comprising:
one or more processors coupled to non-transitory memory, the one or more processors configured to:
store a dataset comprising a first set of embeddings corresponding to a first embeddings space and stored in association with a set of query results for the first set of embeddings, the set of query results corresponding to a second embeddings space;
train a transformation data structure using the first set of embeddings and the set of query results, the transformation data structure to transform the first set of embeddings to the second embeddings space, wherein the second embeddings space is a subset of the first embeddings space; and
execute a search operation for the second embeddings space by applying the transformation data structure to a second set of embeddings corresponding to the first embeddings space.

### Claim 18

A method, comprising:
storing, by one or more processors coupled to non-transitory memory, a dataset comprising a first set of embeddings corresponding to a first embeddings space and stored in association with a set of query results for the first set of embeddings, the set of query results corresponding to a second embeddings space;
training, by the one or more processors, a transformation data structure using the first set of embeddings and the set of query results, the transformation data structure to transform the first set of embeddings to the second embeddings space, wherein the second embeddings space is a subset of the first embeddings space; and
executing, by the one or more processors, a search operation for the second embeddings space by applying the transformation data structure to a second set of embeddings corresponding to the first embeddings space.
