# US 2026/0259830 A1 · Efficient model agent communication with cache sharing

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

- Number: US 2026/0259830 A1
- Document ID: US20260259830A1
- Status: Published application
- Kind: A1
- Application number: 19/067,128
- Filed: 2025-02-28
- Published: 2026-09-03
- Earliest claimed: 2025-02-28
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Esha CHOUKSE; Madanlal S. MUSUVATHI; Shan LU; Yuhan LIU
- Web page: https://patentgrep.com/patent/US20260259830A1

## CPC

- G06F 12/084: with a shared cache
- G06F 16/3349: Reuse of stored results of previous queries
- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Example solutions for context sharing between GAI models includes: identifying a pair of GAI models including a first model and a second model; generating a first key-value (KV) cache of the first model; populating a second KV cache of the second model with one or more layers of the first KV cache; recomputing one or more other layers of the second KV cache; computing an output performance score for the second model based on a baseline metric; and transmitting a reuse pattern to a host device for use in context sharing between an instance of first model and an instance of second model, the reuse pattern identifying the plurality of first KV cache layers to be reused, thereby causing the host device to generate a local KV cache for the instance of second model by reusing the plurality of first KV cache layers from a KV cache of first model.

## Claims

### Claim 1

A context sharing system comprising:
a processor; and
a memory comprising computer-readable instructions, the processor, the memory and the computer-readable instructions configured to cause the processor to:
identify a first model and a second model;
generate a first key-value (KV) cache of the first model, the first KV cache including a plurality of first KV cache layers;
populate a second KV cache of the second model with one or more layers of the first KV cache layers;
recompute one or more other layers of the second KV cache;
generate an output performance score for the second model based on comparison between (a) an output generated by the second model while using the second KV cache and (b) a baseline metric; and
configure a host device with a reuse pattern for context sharing between an instance of the first model and an instance of the second model, the reuse pattern identifying the plurality of first KV cache layers to be reused, thereby causing the host device to generate a local KV cache for the instance of the second model by reusing the plurality of first KV cache layers from a KV cache of the instance of the first model.

### Claim 2 (depends on 1)

The context sharing system of claim 1, wherein the instance of the first model is configured to reason about the cause of a detected anomaly as part of a cybersecurity system, wherein the host device is configured to execute the instance of the second model to generate a recommended action for the detected anomaly.

### Claim 3 (depends on 1)

The context sharing system of claim 1, wherein the output performance score is a composite score generated by:
submitting a plurality of test samples to the second model, thereby generating a plurality of sample outputs;
scoring each sample output of the plurality of sample outputs relative to a baseline metric, thereby generating a plurality of sample output scores; and
calculating the output performance score based on the plurality of sample output scores.

### Claim 4 (depends on 1)

The context sharing system of claim 1, wherein the processor, the memory and the computer-readable instructions are further configured to cause the processor to:
generate a matrix of output performance scores, the matrix including a first axis representing a reuse start layer and a second axis representing a quantity of layers to reuse, each cell in the matrix being associated with a particular reuse start layer and a particular quantity of layers to reuse; and
for one or more cells in the matrix, generate another output performance score for a particular cell using the associated reuse start layer and the associated quantity of layers to reuse of that cell, wherein generating the other output performance score includes populating the second KV cache with the associated quantity of layers from the first KV cache starting at the associated reuse start layer and recomputing one or more other layers of the second KV cache.

### Claim 5 (depends on 1)

The context sharing system of claim 1, wherein generating an output performance score is further based on one or more of (a) an accuracy metric comparing an output of the second model with a ground truth and (b) a computational savings metric representing an amount of computation reduced by reusing the one or more layers of the first KV cache layers in the second KV cache.

### Claim 6 (depends on 1)

The context sharing system of claim 1, wherein the processor, the memory and the computer-readable instructions are further configured to cause the processor to:
receive, at a first agent executing the instance of the first model, a reuse pattern identifying the one or more layers of the first KV cache layers;
transmit, from the first agent to a second agent, the one or more layers of the instance of the first model based on the reuse pattern;
receive, at the second agent executing the instance of the second model, the one or more layers of the instance of the first model;
populate the local KV cache of the instance of the second model using the one or more layers of the instance of the first model; and
recompute all other layers of the local KV cache of the instance of the second model.

### Claim 7 (depends on 1)

The context sharing system of claim 1, wherein the first model and the second model are fine-tuned variants of a shared baseline model.

### Claim 8

A computerized method for context sharing between generative artificial intelligence (GAI) models, the method comprising:
populating a KV cache of a model with a layer of another KV cache generated by another model;
recomputing another layer of the KV cache;
computing an output performance score for the model based on comparison between (a) an output generated by the second model while using the KV cache and (b) a baseline metric; and
transmitting a reuse pattern to a host device for context sharing between an instance of the model and an instance of the other model, the reuse pattern identifying the layer to be reused by the instance of the model, thereby causing the host device to generate a local KV cache for the instance of the model by reusing the layer from the instance of the other model.

### Claim 9 (depends on 8)

The method of claim 8, wherein the output performance score is a composite score generated by:
submitting a test sample to the model, thereby generating a sample output;
scoring the sample output relative to a baseline metric, thereby generating a sample output score; and
calculating the output performance score based on the sample output score.

### Claim 10 (depends on 8)

The method of claim 8, further comprising:
generating a matrix of output performance scores, the matrix including a first axis representing a recompute start layer and a second axis representing a quantity of layers to recompute, each cell in the matrix being associated with a particular recompute start layer and a particular quantity of layers to recompute; and
for each cell in the matrix, computing another output performance score for a particular cell using the associated recompute start layer and the associated quantity of layers to recompute of that cell, wherein generating the other output performance score includes recomputing layers starting at the recompute start layer and for the associated quantity of layers, and populating the KV cache with the other layers from the other KV cache.

### Claim 11 (depends on 10)

The method of claim 10, wherein computing another output performance score for a particular cell further includes weighting the other output performance score based on a system load metric of a computing device.

### Claim 12 (depends on 8)

The method of claim 8, wherein generating an output performance score is further based on one or more of (a) an accuracy metric comparing an output of the model with a ground truth and (b) a computational savings metric representing an amount of computation reduced by reusing the one or more layers of the other KV cache layers in the KV cache.

### Claim 13 (depends on 8)

The method of claim 8, further comprising:
receiving, at a first agent executing the instance of the other model, a reuse pattern identifying the layer of the other KV cache;
transmitting, from the first agent to a second agent, the layer of the instance of the first model based on the reuse pattern;
receiving, at the second agent executing the instance of the model, the one or more layers of the instance of the other model;
populating the local KV cache of the instance of the model using the one or more layers of the instance of the other model; and
recomputing all other layers of the local KV cache of the instance of the model.

### Claim 14 (depends on 8)

The method of claim 8, wherein the model and the other model are fine-tuned variants of a baseline model.

### Claim 15

A computer storage medium having computer-executable instructions that, upon execution by a processor of a computer, cause the processor to at least:
identify a pair of generative artificial intelligence (GAI) models including a first model and a second model;
generate a first key-value (KV) cache of the first model, the first KV cache including a plurality of first KV cache layers;
populate a second KV cache of the second model with one or more layers of the first KV cache layers;
recompute one or more other layers of the second KV cache;
generate an output performance score for the second model based on comparison between (a) output generated by the second model while using the second KV cache and (b) a baseline metric; and
configure a host device with a reuse pattern for context sharing between an instance of the first model and an instance of the second model, the reuse pattern identifying the plurality of first KV cache layers to be reused, thereby causing the host device to generate a local KV cache for the instance of the second model by reusing the plurality of first KV cache layers from a KV cache of the instance of the first model.

### Claim 16 (depends on 15)

The computer storage medium of claim 15, wherein the output performance score is a composite score generated by:
submitting a plurality of test samples to the second model, thereby generating a plurality of sample outputs;
scoring each sample output of the plurality of sample outputs relative to a baseline metric, thereby generating a plurality of sample output scores; and
calculating the output performance score based on the plurality of sample output scores.

### Claim 17 (depends on 15)

The computer storage medium of claim 15, wherein the instructions further cause the processor to:
generate a matrix of output performance scores, the matrix including a first axis representing a reuse start layer and a second axis representing a quantity of layers to reuse, each cell in the matrix being associated with a particular reuse start layer and a particular quantity of layers to reuse; and
for one or more cells in the matrix, generate another output performance score for a particular cell using the associated reuse start layer and the associated quantity of layers to reuse of that cell, wherein generating the other output performance score includes populating the second KV cache with the associated quantity of layers from the first KV cache starting at the associated reuse start layer and recomputing one or more other layers of the second KV cache.

### Claim 18 (depends on 17)

The computer storage medium of claim 17, wherein computing another output performance score for a particular cell further includes weighting the other output performance score based on a system load metric of a computing device.

### Claim 19 (depends on 15)

The computer storage medium of claim 15, wherein generating an output performance score is further based on one or more of (a) an accuracy metric comparing an output of the second model with a ground truth and (b) a computational savings metric representing an amount of computation reduced by reusing the one or more layers of the first KV cache layers in the second KV cache.

### Claim 20 (depends on 15)

The computer storage medium of claim 15, wherein the instructions further cause the processor to:
receive, at a first agent executing the instance of the first model, a reuse pattern identifying the one or more layers of the first KV cache layers;
transmit, from the first agent to a second agent, the one or more layers of the instance of the first model based on the reuse pattern;
receive, at the second agent executing the instance of the second model, the one or more layers of the instance of the first model;
populate the local KV cache of the instance of the second model using the one or more layers of the instance of the first model; and
recompute all other layers of the local KV cache of the instance of the second model.
