# US 2025/0148015 A1 · Speculative decoding in autoregressive generative artificial intelligence models

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

- Number: US 2025/0148015 A1
- Document ID: US20250148015A1
- Status: Published application
- Kind: A1
- Application number: 19/012,626
- Filed: 2025-01-07
- Published: 2025-05-08
- Earliest claimed: 2023-04-20
- Assignees: QUALCOMM Incorporated
- Applicants: QUALCOMM Incorporated
- Inventors: Christopher LOTT; Mingu LEE; Wonseok JEON; Roland MEMISEVIC
- Web page: https://patentgrep.com/patent/US20250148015A1

## CPC

- G06F 16/9027: {Trees}
- G06F 40/284: Lexical analysis, e.g. tokenisation or collocates
- G06N 3/045: Combinations of networks
- G06N 3/047: Probabilistic or stochastic networks
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Certain aspects of the present disclosure provide techniques and apparatus for generating a response to a query input in a generative artificial intelligence model. An example method generally includes receiving a plurality of sets of tokens generated based on an input prompt and a first generative artificial intelligence model, each set of tokens in the plurality of sets of tokens corresponding to a candidate response to the input prompt; selecting, using a second generative artificial intelligence model and recursive adjustment of a target distribution associated with the received plurality of sets of tokens, a set of tokens from the plurality of sets of tokens; and outputting the selected set of tokens as a response to the input prompt.

## Claims

### Claim 1

A processing system comprising:
at least one memory having executable instructions stored thereon; and
one or more processors configured to execute the executable instructions in order to cause the processing system to:
generate, based on an input prompt and a generative artificial intelligence model, a first plurality of sets of tokens, each set of tokens in the first plurality of sets of tokens corresponding to a first portion of a candidate response to the input prompt;
generate, using the generative artificial intelligence model, a second plurality of sets of tokens, each set of tokens in the second plurality of sets of tokens corresponding to a second portion of the candidate response to the input prompt based on the first plurality of sets of tokens;
while generating the second plurality of sets of tokens, select a set of tokens from the first plurality of sets of tokens; and
output the selected set of tokens from the first plurality of tokens and an associated set of tokens from the second plurality of tokens as a response to the input prompt.

### Claim 2 (depends on 1)

The processing system of claim 1, wherein to select the set of tokens from the first plurality of sets of tokens, the one or more processors are configured to cause the processing system to select a longest sequence of accepted tokens from the first plurality of sets of tokens.

### Claim 3 (depends on 1)

The processing system of claim 1, wherein sets of tokens in the second plurality of sets of tokens include padding accounting for a number of tokens in the selected set of tokens from the first plurality of sets of tokens.

### Claim 4 (depends on 1)

The processing system of claim 1, wherein the first plurality of sets of tokens is represented as a tree data structure and wherein a root node of the tree data structure corresponds to the input prompt.

### Claim 5 (depends on 4)

The processing system of claim 4, wherein a depth of the tree data structure corresponds to a maximum number of tokens generated by a single pass through the generative artificial intelligence model.

### Claim 6 (depends on 4)

The processing system of claim 4, wherein a maximum size of the tree data structure is set based on a computational complexity metric associated with generating a set of tokens by the generative artificial intelligence model.

### Claim 7 (depends on 4)

The processing system of claim 4, wherein to select the set of tokens from the first plurality of sets of tokens, the one or more processors are configured to cause the processing system to:
reject a first token at a first level of the tree data structure representing the first plurality of sets of tokens;
generate an adjusted probability distribution based on the rejection of the first token;
discard or ignoring children tokens of the first token from the tree data structure; and
determine whether to accept or reject a second token at the first level of the tree data structure based on the adjusted probability distribution.

### Claim 8 (depends on 1)

The processing system of claim 1, wherein to select the set of tokens from the first plurality of sets of tokens, the one or more processors are configured to cause the processing system to:
reject each set of tokens in the first plurality of sets of tokens generated by the generative artificial intelligence model; and
sample, using the generative artificial intelligence model, a token based on a target distribution that excludes probabilities associated with each set of tokens in the first plurality of sets of tokens, wherein the selected set of tokens from the first plurality of sets of tokens comprises the sampled token.

### Claim 9 (depends on 1)

The processing system of claim 1, wherein the generative artificial intelligence model comprises a generative artificial intelligence model trained to generate multiple tokens in response to the input prompt based on forecast prompt embeddings.

### Claim 10 (depends on 1)

The processing system of claim 1, wherein the generative artificial intelligence model comprises a model including one or more non-autoregressive layers and one or more autoregressive layers.

### Claim 11 (depends on 10)

The processing system of claim 10, wherein the one or more autoregressive layers comprise one or more layers at atop of a stack of layers representing the generative artificial intelligence model.

### Claim 12 (depends on 10)

The processing system of claim 10, wherein the one or more autoregressive layers comprise one or more layers at a bottom of a stack of layers representing the generative artificial intelligence model.

### Claim 13

A processor-implemented method, comprising:
generating, based on an input prompt and a generative artificial intelligence model, a first plurality of sets of tokens, each set of tokens in the first plurality of sets of tokens corresponding to a first portion of a candidate response to the input prompt;
generating, using the generative artificial intelligence model, a second plurality of sets of tokens, each set of tokens in the second plurality of sets of tokens corresponding to a second portion of the candidate response to the input prompt based on the first plurality of sets of tokens;
while generating the second plurality of sets of tokens, selecting a set of tokens from the first plurality of sets of tokens; and
outputting the selected set of tokens from the first plurality of tokens and an associated set of tokens from the second plurality of tokens as a response to the input prompt.

### Claim 14 (depends on 13)

The method of claim 13, wherein selecting the set of tokens from the first plurality of sets of tokens comprises selecting a longest sequence of accepted tokens from the first plurality of sets of tokens.

### Claim 15 (depends on 13)

The method of claim 13, wherein sets of tokens in the second plurality of sets of tokens include padding accounting for a number of tokens in the selected set of tokens from the first plurality of sets of tokens.

### Claim 16 (depends on 13)

The method of claim 13, wherein the first plurality of sets of tokens is represented as a tree data structure and wherein a root node of the tree data structure corresponds to the input prompt.

### Claim 17 (depends on 16)

The method of claim 16 wherein a depth of the tree data structure corresponds to a maximum number of tokens generated by a single pass through the generative artificial intelligence model.

### Claim 18 (depends on 16)

The method of claim 16, wherein a maximum size of the tree data structure is set based on a computational complexity metric associated with generating a set of tokens by the generative artificial intelligence model.

### Claim 19 (depends on 16)

The method of claim 16, wherein selecting the set of tokens from the first plurality of sets of tokens comprises:
rejecting a first token at a first level of the tree data structure representing the first plurality of sets of tokens;
generating an adjusted probability distribution based on the rejection of the first token;
discarding or ignoring children tokens of the first token from the tree data structure; and
determining whether to accept or reject a second token at the first level of the tree data structure based on the adjusted probability distribution.

### Claim 20 (depends on 13)

The method of claim 13, wherein selecting the set of tokens from the first plurality of sets of tokens comprises:
rejecting each set of tokens in the first plurality of sets of tokens generated by the generative artificial intelligence model; and
sampling, using the generative artificial intelligence model, a token based on a target distribution that excludes probabilities associated with each set of tokens in the first plurality of sets of tokens, wherein the selected set of tokens from the first plurality of sets of tokens comprises the sampled token.

### Claim 21 (depends on 13)

The method of claim 13, wherein the generative artificial intelligence model comprises a generative artificial intelligence model trained to generate multiple tokens in response to the input prompt based on forecast prompt embeddings.

### Claim 22 (depends on 13)

The method of claim 13, wherein the generative artificial intelligence model comprises a model including one or more non-autoregressive layers and one or more autoregressive layers.

### Claim 23 (depends on 22)

The method of claim 22, wherein the one or more autoregressive layers comprise one or more layers at a top of a stack of layers representing the generative artificial intelligence model.

### Claim 24 (depends on 22)

The method of claim 22, wherein the one or more autoregressive layers comprise one or more layers at a bottom of a stack of layers representing the generative artificial intelligence model.

### Claim 25

A processing system comprising:
means for generating, based on an input prompt and a generative artificial intelligence model, a first plurality of sets of tokens, each set of tokens in the first plurality of sets of tokens corresponding to a first portion of a candidate response to the input prompt;
means for generating, using the generative artificial intelligence model, a second plurality of sets of tokens, each set of tokens in the second plurality of sets of tokens corresponding to a second portion of the candidate response to the input prompt based on the first plurality of sets of tokens;
means for selecting, while generating the second plurality of sets of tokens, a set of tokens from the first plurality of sets of tokens; and
means for outputting the selected set of tokens from the first plurality of tokens and an associated set of tokens from the second plurality of tokens as a response to the input prompt.

### Claim at position 26

26-36. (canceled)

### Claim 37

A non-transitory computer-readable medium having executable instructions stored thereon which, when executed by one or more processors, perform an operation comprising:
generating, based on an input prompt and a generative artificial intelligence model, a first plurality of sets of tokens, each set of tokens in the first plurality of sets of tokens corresponding to a first portion of a candidate response to the input prompt;
generating, using the generative artificial intelligence model, a second plurality of sets of tokens, each set of tokens in the second plurality of sets of tokens corresponding to a second portion of the candidate response to the input prompt based on the first plurality of sets of tokens;
while generating the second plurality of sets of tokens, selecting a set of tokens from the first plurality of sets of tokens; and
outputting the selected set of tokens from the first plurality of tokens and an associated set of tokens from the second plurality of tokens as a response to the input prompt.

### Claim 38 (depends on 1)

A mobile device comprising the processing system of claim 1.
