# US 2025/0384332 A1 · System and Method for Real-Time Optimization of Retrieval Augmented Generation (RAG) Hyperparameters

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

- Number: US 2025/0384332 A1
- Document ID: US20250384332A1
- Status: Published application
- Kind: A1
- Application number: 18/744,903
- Filed: 2024-06-17
- Published: 2025-12-18
- Earliest claimed: 2024-06-17
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Laurent Boué; Yasmin Bokobza; Kiran Rama; Naveen Panwar
- Web page: https://patentgrep.com/patent/US20250384332A1

## CPC

- G06F 16/90335: {Query processing}
- G06N 20/00: Machine learning
- G06N 3/00: Computing arrangements based on biological models
- G06N 3/045: Combinations of networks
- G06N 3/047: Probabilistic or stochastic networks
- G06N 7/01: Probabilistic graphical models, e.g. probabilistic networks
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method, computer program product, and computing system for processing a query provided to a generative AI model. A content portion retrieved by a Retrieval Augmented Generation system for the query is processed. User context information associated with a user providing the query is determined. Hyperparameters are generated for processing the prompt with the generative AI model by processing the query, the content portion, and the user context information using run-time surrogate model inversion optimization.

## Claims

### Claim 1

A computer-implemented method, executed on a computing device, comprising:
processing a query provided to a generative artificial intelligence (AI) model;
processing a content portion retrieved by a Retrieval Augmented Generation (RAG) system for the query;
processing user context information associated with a user providing the query; and
generating hyperparameters for processing the prompt with the generative AI model by processing the query, the content portion, and the user context information using run-time surrogate model inversion optimization.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, further comprising:
processing the prompt with the hyperparameters using the generative AI model.

### Claim 3 (depends on 2)

The computer-implemented method of claim 2, further comprising:
providing a result to the query from the generative AI model associated with the prompt and the hyperparameters.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, wherein processing the query includes generating an embedding for the query by processing the query with a language model.

### Claim 5 (depends on 4)

The computer-implemented method of claim 4, wherein processing the content portion includes generating an embedding for the content portion by processing the content portion with the language model.

### Claim 6 (depends on 5)

The computer-implemented method of claim 5, wherein generating the hyperparameters includes:
processing the embedding for the query, the embedding for the content portion, the user context information using a supervised machine learning model; and
generating the hyperparameters that maximize feedback associated with the query by performing an optimization of the hyperparameters based upon, at least in part, the embedding for the query, the embedding for the content portion, the user context information.

### Claim 7 (depends on 6)

The computer-implemented method of claim 6, further comprising:
processing telemetry data associated with a previous result provided to the user for a previous query.

### Claim 8 (depends on 7)

The computer-implemented method of claim 7, further comprising:
training the supervised machine learning model with the telemetry data associated with the previous result including an embedding for the previous query, an embedding for a previous content portion, user context information associated with the user providing the previous query, and feedback associated with the previous result.

### Claim 9

A computing system comprising:
a memory; and
a processor configured to:
process a query provided to a generative AI model;
process a content portion retrieved by a Retrieval Augmented Generation system for the query;
determine user context information associated with a user providing the query;
generate hyperparameters for processing the prompt with the generative AI model by processing the query, the content portion, and the user context information using run-time surrogate model inversion optimization; and
process the prompt with the hyperparameters using the generative AI model.

### Claim 10 (depends on 9)

The computing system of claim 9, wherein the processor is further configured to:
provide a result to the query from the generative AI model associated with the prompt and the hyperparameters.

### Claim 11 (depends on 9)

The computing system of claim 9, wherein processing the query includes generating an embedding for the query by processing the query with a language model.

### Claim 12 (depends on 11)

The computing system of claim 11, wherein processing the content portion includes generating an embedding for the content portion by processing the content portion with the language model.

### Claim 13 (depends on 9)

The computing system of claim 9, wherein generating the hyperparameters includes:
processing the embedding for the query, the embedding for the content portion, the user context information using a supervised machine learning model; and
generating the hyperparameters that maximize feedback associated with the query by performing an optimization of the hyperparameters based upon, at least in part, the embedding for the query, the embedding for the content portion, the user context information.

### Claim 14 (depends on 13)

The computing system of claim 13, wherein the processor is further configured to:
process telemetry data associated with a previous result provided to the user for a previous query.

### Claim 15

A computer program product residing on a non-transitory computer readable medium having a plurality of instructions stored thereon which, when executed by a processor, cause the processor to perform operations comprising:
processing a query provided to a generative AI model;
processing a content portion retrieved by a Retrieval Augmented Generation system for the query;
determining user context information associated with a user providing the query;
generating hyperparameters for processing the prompt with the generative AI model by processing the query, the content portion, and the user context information using run-time surrogate model inversion optimization;
processing the prompt with the hyperparameters using the generative AI model; and
providing a result to the query from the generative AI model associated with the prompt and the hyperparameters.

### Claim 16 (depends on 15)

The computer program product of claim 15, wherein processing the query includes generating an embedding for the query by processing the query with a language model.

### Claim 17 (depends on 16)

The computer program product of claim 16, wherein processing the content portion includes generating an embedding for the content portion by processing the content portion with the language model.

### Claim 18 (depends on 15)

The computer program product of claim 15, wherein generating the hyperparameters includes:
processing the embedding for the query, the embedding for the content portion, the user context information using a supervised machine learning model; and
generating the hyperparameters that maximize feedback associated with the query by performing an optimization of the hyperparameters based upon, at least in part, the embedding for the query, the embedding for the content portion, the user context information.

### Claim 19 (depends on 18)

The computer program product of claim 18, wherein the operations further comprise:
processing telemetry data associated with a previous result provided to the user for a previous query.

### Claim 20 (depends on 19)

The computer program product of claim 19, wherein the operations further comprise:
training the supervised machine learning model with the telemetry data associated with the previous result including an embedding for the previous query, an embedding for a previous content portion, user context information associated with the user providing the previous query, and feedback associated with the previous result.
