IP Library › Granted Patent US 12,373,494
Granted Patent B2
US 12,373,494 · App. 18/538,912 · Granted Jul 29, 2025

Speculative decoding in autoregressive generative artificial intelligence models

Inventors: Christopher Lott (San Diego, CA); Mingu Lee (San Diego, CA); Wonseok Jeon (San Diego, CA); Roland Memisevic (Toronto, CA)
Assignee: QUALCOMM Incorporated
G06F16/9027G06F40/284
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,373,494
App. No.
18/538,912
Granted
Jul 29, 2025
Kind
B2
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 (60)

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 to cause the processing system to:

receive 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 comprising a sequence of tokens corresponding to a candidate response to the input prompt, wherein the plurality of sets of tokens is organized into a tree data structure;

select, 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

output the selected set of tokens as a response to the input prompt;

wherein a root node of the tree data structure corresponds to the input prompt, and

wherein each path through the tree data structure corresponds to a different sequence of tokens corresponding to the candidate response to the input prompt.

2. The processing system of claim 1 , wherein:

the tree data structure includes a plurality of levels, each level corresponding to a token in the sequence of tokens, and

a number of tokens at a particular level in the tree data structure is based on a branching factor associated with an immediately prior level to the particular level in the tree data structure.

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

4. The processing system of claim 1 , wherein a size of each set of tokens is based on a computational complexity metric associated with generating a target set of tokens by the second generative artificial intelligence model.

5. The processing system of claim 1 , wherein the recursive adjustment of the target distribution comprises:

determining whether to accept or reject a first token in a set of tokens from the plurality of sets of tokens; and

adjusting a probability distribution used to verify a second token in the set of tokens subsequent to the first token based on the determination of whether to accept or reject the first token.

6. The processing system of claim 5 , wherein to adjust the probability distribution, the one or more processors are configured to cause the processing system to subtract a probability value associated with the first token from the probability distribution based on determining to reject the first token.

7. The processing system of claim 1 , wherein to select the set of tokens from the 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 a tree data structure representing the plurality of sets of tokens;

generate an adjusted probability distribution based on the rejection of the first token;

discard or ignoring, from the tree data structure, children tokens of the first token at levels deeper than the first level of 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.

8. The processing system of claim 1 , wherein to select the set of tokens from the plurality of sets of tokens, the one or more processors are configured to cause the processing system to:

reject each set of tokens generated by the first generative artificial intelligence model; and

sample, using the second generative artificial intelligence model, a token based on a target distribution that excludes probabilities associated with each set of tokens generated by the first generative artificial intelligence model, wherein the selected set of tokens comprises the sampled token.

9. The processing system of claim 1 , wherein:

the first generative artificial intelligence model corresponds to a draft model in a speculative decoding pipeline, and

the second generative artificial intelligence model corresponds to a target model in the speculative decoding pipeline.

10. A processor-implemented method, comprising:

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 comprising a sequence of tokens corresponding to a candidate response to the input prompt, wherein the plurality of sets of tokens is organized into a tree data structure;

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;

wherein a root node of the tree data structure corresponds to the input prompt, and

wherein each path through the tree data structure corresponds to a different sequence of tokens corresponding to the candidate response to the input prompt.

11. The method of claim 10 , wherein:

the tree data structure includes a plurality of levels, each level corresponding to a token in the sequence of tokens, and

a number of tokens at a particular level in the tree data structure is based on a branching factor associated with an immediately prior level to the particular level in the tree data structure.

12. The method of claim 10 , wherein a depth of the tree data structure corresponds to a parameter defining a maximum number of tokens generated by a single pass through the first generative artificial intelligence model.

13. The method of claim 10 , wherein a size of each set of tokens is based on a computational complexity metric associated with generating a target set of tokens by the second generative artificial intelligence model.

14. The method of claim 10 , wherein the recursive adjustment of the target distribution comprises:

determining whether to accept or reject a first token in a set of tokens from the plurality of sets of tokens; and

adjusting a probability distribution used to verify a second token in the set of tokens subsequent to the first token based on the determination of whether to accept or reject the first token.

15. The method of claim 14 , wherein adjusting the probability distribution comprises subtracting a probability value associated with the first token from the probability distribution based on determining to reject the first token.

16. The method of claim 10 , wherein selecting the set of tokens from the plurality of sets of tokens comprises:

rejecting a first token at a first level of a tree data structure representing the plurality of sets of tokens;

generating an adjusted probability distribution based on the rejection of the first token;

discarding or ignoring, from the tree data structure, children tokens of the first token at levels deeper than the first level of 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.

17. The method of claim 10 , wherein selecting the set of tokens from the plurality of sets of tokens comprises:

rejecting each set of tokens generated by the first generative artificial intelligence model; and

sampling, using the second generative artificial intelligence model, a token based on a target distribution that excludes probabilities associated with each set of tokens generated by the first generative artificial intelligence model, wherein the selected set of tokens comprises the sampled token.

18. The method of claim 10 , wherein:

the first generative artificial intelligence model corresponds to a draft model in a speculative decoding pipeline, and

the second generative artificial intelligence model corresponds to a target model in the speculative decoding pipeline.

19. A non-transitory computer-readable medium having executable instructions stored thereon which, when executed by a processor, perform an operation comprising:

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 comprising a sequence of tokens corresponding to a candidate response to the input prompt, wherein the plurality of sets of tokens is organized into a tree data structure;

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;

wherein a root node of the tree data structure corresponds to the input prompt, and

wherein each path through the tree data structure corresponds to a different sequence of tokens corresponding to the candidate response to the input prompt.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 6, 2024
From: LOTT, CHRISTOPHER; LEE, MINGU; JEON, WONSEOK; MEMISEVIC, ROLAND
To: QUALCOMM INCORPORATED
Reel/Frame 066397/0753 →
Continuity (2)
Provisional Application 63460850 · Apr 20, 2023
Related Publication 20240354345A1 · Oct 24, 2024
References Cited (18)
US 7051029B1 · Fayyad et al. · 2006 [cited by applicant]
US 9734252B2 · Wolfram et al. · 2017 [cited by applicant]
US 20200142888A1 · Alakuijala et al. · 2020 [cited by applicant]
US 20210034335A1 · Svyatkovskiy et al. · 2021 [cited by applicant]
US 20220407702A1 · Jakobsson et al. · 2022 [cited by applicant]
US 20240160902A1 · Padgett · 2024 [cited by examiner]
US 20240202464A1 · Poirier · 2024 [cited by examiner]
US 20240202539A1 · Poirier · 2024 [cited by examiner]
US 20240354346A1 · Lott et al. · 2024 [cited by applicant]
Chen C., et al., “Accelerating Large Language Model Decoding with Speculative Sampling”, Deep Mind, arXiv:2302.01318v1 [cs.CL], Feb. 2, 2023, pp. 1-11. [cited by applicant]
Leviathan Y., et al., “Fast Inference from Transformers via Speculative Decoding”, arXiv:2211.17192v1 [cs.LG], Nov. 30, 2022, 12 Pages. [cited by applicant]
Stern M., et al., “Blockwise Parallel Decoding for Deep Autoregressive Models”, arXiv:1811.03115v1 [cs.LG], 32nd Conference on Neural Information Processing Systems, Montreal, Canada, Nov. 7, 2018, pp. 1-10. [cited by applicant]
International Search Report and Written Opinion—PCT/US2024/017336—ISA/EPO—May 29, 2024. [cited by applicant]
Leviathan Y., et al., “Fast Inference from Transformers via Speculative Decoding”, arXiv:2211.17192v1 [cs.LG], arxiv.org, Cornell University Library, 201 Olin Library Cornell University Ithaca, NY 14853, Nov. 30, 2022, … [cited by applicant]
Leviathan Y., et al., “Fast Inference from Transformers via Speculative Decoding”, arXiv:2211.17192v1 [cs.LG], arxiv.org, Cornell University Library, 201 Olin Library Cornell University Ithaca, NY 14853, Nov. 30, 2022, … [cited by applicant]
Xia H., et al., “Lossless Speedup of Autoregressive Translation with Generalized Aggressive Decoding”, arXiv:2203.16487v4 [cs.CL], arxiv.org, Cornell University Library, 201 Olin Library Cornell University Ithaca, NY 14… [cited by applicant]
Xia H., et al., “Lossless Speedup of Autoregressive Translation with Generalized Aggressive Decoding”, arXiv:2203.16487v4 [cs.CL], arxiv.org, Cornell University Library, 201 Olin Library Cornell University Ithaca, NY 14… [cited by applicant]
Zhang J., et al., “Draft & Verify: Lossless Large Language Model Acceleration via Self-Speculative Decoding”, arXiv:2309.08168v2 [cs.CL] May 20, 2024, 19 Pages. [cited by applicant]
Cited By (1)
US 12,724,827