# US 2025/0209271 A1 · Expediting Generative Token Production using Speculative Sampling, Added Guidance, and Language Models of Different Capacities

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

- Number: US 2025/0209271 A1
- Document ID: US20250209271A1
- Status: Published application
- Kind: A1
- Application number: 18/395,189
- Filed: 2023-12-22
- Published: 2025-06-26
- Earliest claimed: 2023-12-22
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Ayyoob IMANIGOOGHARI; Mohsen FAYYAZ; Eric Chris Wolfgang SOMMERLADE
- Web page: https://patentgrep.com/patent/US20250209271A1

## CPC

- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06F 40/40: Processing or translation of natural language (natural language analysis G06F40/20; semantic analysis G06F40/30)
- G06N 3/045: Combinations of networks
- G06N 3/096: Transfer learning
- G06F 16/35: Clustering; Classification
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A technique accelerates the generative production of tokens using a target language model that operates in cooperation with a draft language model. The target language model is more capable, but slower, compared to the draft language model. In operation, the draft language model transforms prompt tokens into draft tokens. The target language model edits the draft tokens, e.g., by selecting zero, one, or more of the draft tokens, and by also predicting a next token to follow the draft token(s) (if any) that are selected. Further, the target language model produces guidance vector information. In a subsequent cycle, the draft language model uses the guidance vector information to produce an updated set of set of draft tokens. The guidance vector information informs the draft language model of the embedding space being used by the target language model. This achieves a more effective cooperative relation between the two models.

## Claims

### Claim 1

A method for accelerating generation of output tokens using a target language model, which operates in cooperation with a draft language model, comprising:
receiving, by the target language model, a set of draft tokens produced by the draft language model based on, at least in part, prompt tokens provided to the draft language model;
the target language model using more parameters and being more accurate compared to the draft language model, the target language model consuming more memory and processing resources compared to the draft language model, and the target language model being slower in operation compared to the draft language model;
producing, using the target language model, one or more target output tokens based on the prompt tokens and the set of draft tokens,
the one or more target output tokens including zero, one, or more draft tokens chosen from among the set of draft tokens, and an additional target output token which is predicted by the target language model to follow the zero, one, or more draft tokens that are selected;
generating, using the target language model, guidance vector information based on the prompt tokens and the set of draft tokens; and
forwarding the one or more target output tokens and the guidance vector information to the draft language model, for use by the draft language model in generating updated draft tokens.

### Claim 2 (depends on 1)

The method of claim 1, wherein the target language model includes a multi-layer neural network that applies an attention operation to input tokens that are input to the target language model, and the draft language model is another multi-layer neural network that applies an attention operation to input tokens that are input to the draft language model.

### Claim 3 (depends on 1)

The method of claim 1, wherein a server system implements the target language model and a local system implements the local language model, the server system being accessible to the local system via a computer network.

### Claim 4 (depends on 1)

The method of claim 1, wherein both the target language model and the draft language model are implemented by a same system.

### Claim 5 (depends on 1)

The method of claim 1, wherein the producing accepts a particular draft token of the zero, one, or more draft tokens upon determining that a probability generated by the target language model for the particular draft token is greater than a probability generated by the draft language model for the particular draft token.

### Claim 6 (depends on 1)

The method of claim 1, wherein the target language model operates by:
transforming the prompt tokens and the set of draft tokens to hidden state information using a base target language model;
transforming the hidden state information to output token probability information, on basis of which the one or more target output tokens are produced; and
transforming the hidden state information to the guidance vector information.

### Claim 7 (depends on 1)

The method of claim 1, further comprising producing the one or more target output tokens in a single forward pass of the target language model.

### Claim 8 (depends on 1)

The method of claim 1, wherein the draft tokens in the set of draft tokens that are produced auto-recursively by the draft language model.

### Claim 9 (depends on 1)

The method of claim 1,
further comprising transforming, using the draft language model, the prompt tokens, the one or more target output tokens, and the guidance vector information to the updated draft tokens,
wherein the target language model is trained based on a first loss measure that depends on a difference between first ground-truth information and the one or more target output tokens, and a second loss measure that depends on a difference between second ground-truth information and the updated draft tokens.

### Claim 10 (depends on 9)

The method of claim 9, wherein the draft language model is also trained based on the second loss measure.

### Claim 11 (depends on 9)

The method of claim 9, wherein the first ground-truth information is text that is manually specified by a human reviewer as being correct, and wherein the second ground-truth information is text auto-recursively generated by the target language model.

### Claim 12 (depends on 9)

The method of claim 9, further comprising evaluating improvements of a cooperative combination of the draft language model and the target language model over another language model based on:
a number of floating point operations that are performed by the target language model and the draft language model, and a latency of the target language model; and
a number of floating point operations that are performed by said another language model and a latency of said another language model.

### Claim 13 (depends on 1)

The method of claim 1, further comprising switching to a mode in which the target language model is asked by the draft language model to generate an instance of guidance vector information for initial prompt tokens, and wherein generation of output tokens thereafter takes place using the draft language model independent of interaction with the target language model.

### Claim 14

A computing system for using a draft language model to accelerate generation of output tokens using a target language model, comprising:
an instruction data store for storing computer-readable instructions; and
a processing system for executing the computer-readable instructions in the data store, to perform operations including:
receiving a set of target output tokens produced by the target language model, and guidance vector information produced by the target language model;
transforming prompt tokens, the set of target output tokens, and the guidance vector information into draft tokens,
the draft language model using fewer parameters and being less accurate compared to the target language model, the draft language model consuming less memory and processing resources compared to the target language model, and the draft language model being faster in operation compared to the target language model; and
sending the draft tokens to the target language model, for use by the target language model in producing an updated set of target output tokens and updated guidance vector information.

### Claim 15 (depends on 14)

The computing system of claim 14, wherein the updated set of target output tokens are produced by the target language model by selecting from among the draft tokens.

### Claim 16 (depends on 14)

The computing system of claim 14, wherein the operations further comprise switching to a mode in which the target language model is asked by the draft language model to generate an instance of guidance vector information for initial prompt tokens, and wherein generation of output tokens thereafter takes place using the draft language model independent of interaction with the target language model.

### Claim 17

A computer-readable storage medium for storing computer-readable instructions, a processing system executing the computer-readable instructions to perform operations, the operations comprising each of:
receiving, by a target language model, a set of draft tokens produced by a draft language model based on, at least in part, prompt tokens provided to the draft language model;
the target language model using more parameters and being more accurate compared to the draft language model, the target language model consuming more memory and processing resources compared to the draft language model, and the target language model being slower in operation compared to the draft language model;
producing, using the target language model, one or more target output tokens based on the prompt tokens and the set of draft tokens,
the one or more target output tokens including zero, one, or more draft tokens chosen from among the set of draft tokens, and an additional target output token which is predicted by the target language model to follow the zero, one, or more draft tokens that are selected;
generating, using the target language model, guidance vector information based on the prompt tokens and the set of draft tokens; and
transforming, using the draft language model, the prompt tokens, the one or more target output tokens, and the guidance vector information to updated draft tokens,
the target language model being trained based on a first loss measure that depends on a difference between first ground-truth information and the one or more target output tokens, and a second loss measure that depends on a difference between second ground-truth information and the updated draft tokens.

### Claim 18 (depends on 18)

The computer-readable storage medium of claim 18, wherein the draft language model is also trained based on the second loss measure

### Claim 19 (depends on 18)

The computer-readable storage medium of claim 18, wherein the first ground-truth information is text that is manually specified by a human reviewer as being correct, and wherein the second ground-truth information is text auto-recursively generated by the target language model.

### Claim 20 (depends on 18)

The computer-readable storage medium of claim 18, further comprising evaluating improvements of a cooperative combination of the draft language model and the target language model over another language model based on:
a number of floating point operations that are performed by the target language model and the draft language model, and a latency of the target language model; and
a number of floating point operations that are performed by said another language model and a latency of said another language model.
