{"pub_number":"US12373494B2","doc_number":"12373494","country":"US","kind_code":"B2","patent_type":"utility","status":"active","title":"Speculative decoding in autoregressive generative artificial intelligence models","abstract_text":"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":[{"number":1,"text":"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 co","independent":true},{"number":2,"text":"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.","independent":false,"depends_on":[1]},{"number":3,"text":"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.","independent":false,"depends_on":[1]},{"number":4,"text":"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.","independent":false,"depends_on":[1]},{"number":5,"text":"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.","independent":false,"depends_on":[1]},{"number":6,"text":"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.","independent":false,"depends_on":[5]},{"number":7,"text":"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.","independent":false,"depends_on":[1]},{"number":8,"text":"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.","independent":false,"depends_on":[1]}],"description":"CROSS-REFERENCE TO RELATED APPLICATIONS\nThis application claims priority to and benefit of U.S. Provisional Patent Application Ser. No. 63/460,850, entitled\n“\nSpeculative Decoding in Autoregressive Generative Artificial Intelligence Models,\n”\nfiled Apr. 20, 2023, and assigned to the assignee hereof, the entire contents of which are incorporated herein by reference.\nINTRODUCTION\nAspects of the present disclosure relate to generative artificial intelligence models, and more specifically to speculative decoding in generative artificial intelligence models (also referred to herein as\n“\ngenerative artificial intelligence models\n”\n).\nGenerative artificial intelligence models can be used in various environments in order to generate a response to an input prompt (also referred to as a query or an input). For example, generative artificial intelligence models can be used in chatbot applications in which large language models (LLMs) are used to generate an answer, or at least a response, to an input prompt. Other examples in which generative artificial intelligence models can be used include a latent diffusion model, in which a model generates an image from an input text description of the content of the desired image, decision transformers, in which future actions are predicted based on sequences of prior actions within a given environment, or the like.\nGenerally, generating a response to a query using generative artificial intelligence models may be computationally expensive. For example, in a chatbot deployment in which a large language model is used to generate a response to a query formatted as a text query, a response to the query may be generated using a pass through the large language model for each token (e.g., a word or part of a word) generated as part of the response. The output of each pass may be a probability distribution on a set of tokens (e.g., words or parts of words) from which the next token (e.g., a word or part of a word) may be selected, for example, b","inventors":[{"name":"Christopher Lott","slug":"christopher-lott","city":"San Diego","country":"US"},{"name":"Mingu Lee","slug":"mingu-lee","city":"San Diego","country":"US"},{"name":"Wonseok Jeon","slug":"wonseok-jeon","city":"San Diego","country":"US"},{"name":"Roland Memisevic","slug":"roland-memisevic","city":"Toronto","country":"CA"}],"assignees":[{"name":"QUALCOMM Incorporated","slug":"qualcomm-incorporated","country":"US"}],"examiners":[],"cpc_codes":["G06F 16/9027","G06F 40/284"],"ipc_codes":["G06F 16/901","G06F 40/284"],"filing_date":"2023-12-13","pub_date":"2025-07-29","grant_date":"2025-07-29","expiration_date":"2043-12-13","family_members":[],"citations_made":[{"pub_number":"US7051029B1","category":"applicant"},{"pub_number":"US9734252B2","category":"applicant"},{"pub_number":"US20200142888A1","category":"applicant"},{"pub_number":"US20210034335A1","category":"applicant"},{"pub_number":"US20220407702A1","category":"applicant"},{"pub_number":"US20240160902A1","category":"examiner"},{"pub_number":"US20240202464A1","category":"examiner"},{"pub_number":"US20240202539A1","category":"examiner"},{"pub_number":"US20240354346A1","category":"applicant"}],"non_patent_literature":["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.","Leviathan Y., et al.,","“","Fast Inference from Transformers via Speculative Decoding","”",", arXiv:2211.17192v1 [cs.LG], Nov. 30, 2022, 12 Pages."],"drawings_count":0,"source_id":"uspto_patent_grants","upstream_forward_citations":0,"metrics":{"forward_citations":1,"indexed_forward_citations":1,"backward_citations":9,"npl_citations":10,"citations_per_year":1.0,"pagerank":0.17328679513998632,"citation_rank":2224640,"pagerank_rank":2224640,"velocity_rank":2224640,"family_citations":1}}