Calculating Consecutively Accepted Tokens
In a text generation process, a sequence of 4 candidate tokens is proposed. For each token, a random number is drawn and compared to a probability ratio to determine if the token is accepted or rejected. A token at index t is rejected if its corresponding random number r_t is greater than its probability ratio. The process stops at the first rejected token, and the number of consecutively accepted tokens from the start is counted.
Based on the data provided below, what is the final count of consecutively accepted tokens?
0
1
Tags
Ch.5 Inference - Foundations of Large Language Models
Foundations of Large Language Models
Foundations of Large Language Models Course
Computing Sciences
Application in Bloom's Taxonomy
Cognitive Psychology
Psychology
Social Science
Empirical Science
Science
Related
Set of Accepted Speculative Tokens
Calculating Consecutively Accepted Tokens
In a speculative decoding process, the number of consecutively accepted tokens from the start of a draft sequence, denoted by , is determined by finding the index of the first rejected token. The formula is: .
Given a draft sequence of 5 tokens () with the following randomly generated numbers () and probability ratios (), what is the calculated value of ?
- t=1: =0.4, =0.7
- t=2: =0.8, =0.9
- t=3: =0.6, =0.5
- t=4: =0.3, =0.8
- t=5: =0.7, =0.6
Consider the formula for calculating the number of consecutively accepted tokens in speculative decoding: . If the very first token in a drafted sequence (at index ) is rejected, this formula will yield a value of .