hottub.patents
US 12,229,192 B2#2160482 Most CitedActiveUnited States (USPTO)Utility

Speculative decoding in autoregressive generative artificial intelligence models

3Forward Citations (#2160482 Global)
3.0/yrCitation Velocity (#2160482 Global)
0.35Citation PageRank (#2160482 Global)
5Prior Art Cited
8Claims (1 Indep. · 7 Dep.)
0Drawings / Sheets

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.

Interactive Citation Constellation Global Citation Ranking

Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 5 · Forward citations: 3.

Claims (8 — 1 Independent, 7 Dependent)

  1. Claim 1Independent Claim

    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; speculatively 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 speculatively 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

  2. Claim 2Depends 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.

  3. Claim 3Depends 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.

  4. Claim 4Depends 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.

  5. Claim 5Depends 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.

  6. Claim 6Depends 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.

  7. Claim 7Depends 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.

  8. Claim 8Depends 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.

Technical Overview & Description

CROSS-REFERENCE TO RELATED APPLICATIONS This application claims priority to and benefit of U.S. Provisional Patent Application Ser. No. 63/460,850, entitled “ Speculative Decoding in Autoregressive Generative Artificial Intelligence Models, ” filed Apr. 20, 2023, and assigned to the assignee hereof, the entire contents of which are incorporated herein by reference. INTRODUCTION Aspects 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 “ generative artificial intelligence models ” ). Generative 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. Generally, 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

References Cited — Backward Prior Art (5)

Non-Patent Literature (10)

  • 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.