Cascade Speculative Drafting for Even Faster LLM Inference

Authors: ziyi chen xiaocong
yang  jiacheng
lin  chenkai
sun  kevin
chen-chuan  chang
jie  huang
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-15 05:34:25

Abstract: Introduced to enhance the efficiency of large language model (LLM) inference, speculative decoding operates by having a smaller model generate a draft. A larger target model then reviews this draft to align with its output, and any acceptance by the target model results in a reduction of the number of the target model runs, ultimately improving efficiency. However, the drafting process in speculative decoding includes slow autoregressive generation and allocates equal time to generating tokens, irrespective of their importance. These inefficiencies collectively contribute to the suboptimal performance of speculative decoding. To further improve LLM inference, we introduce Cascade Speculative Drafting (CS Drafting), a speculative execution algorithm that incorporates two types of cascades. The *Vertical Cascade* eliminates autoregressive generation from neural models, while the *Horizontal Cascade* optimizes time allocation in drafting for improved efficiency. Combining both cascades, CS Drafting achieves greater speedup compared to the baselines in our experiments, while preserving the same output distribution as the target model. Our code is publicly available at https://github.com/lfsszd/CS-Drafting.

Main paper: 
 introduction: 
 The advent of Large Language Models (LLMs), like GPT-4 [17] , has marked a significant milestone in the field of natural language processing (NLP). These models have not only excelled in various NLP tasks but have also found widespread applications in user-interactive settings, such as chatbots and virtual assistants. However, these applications involve an extremely high number of users, up to hundreds of millions daily. To serve in real-time at this scale, a low-latency system is not only cost-saving but also crucial for keeping the service running. In addition, the sheer scale of the service means that even a slight improvement in the latency of LLMs can greatly contribute to both the service provider and the community. Consequently, optimizing the latency of LLMs has become a critical area of research.Unfortunately, the ever-growing size of LLMs significantly increases the latency, especially in long-form generation, as autoregressive LLMs generate tokens one by one. An emerging solution, known as speculative decoding [14, 4, 25] , shows potential to mitigate this issue. In speculative decoding, a draft model (which is smaller and faster) generates k tokens in each step (with k being a hyperparameter) autoregressively, and these tokens are then reviewed by a target model (which is larger and slower) in parallel. In one single run, the target model will accept any tokens aligned with its output and further generate one token. The drafting process in speculative decoding enables the target model to generate multiple tokens in a single run while maintaining its output distribution unchanged. With a properly sized draft model, speculative decoding achieves a speedup of 2 to 3 times, making it a potential method for solving high latency issues.Figure 1 : The CS Drafting algorithm features a recursive and resource-efficient design, implemented through two cascades: the horizontal cascade and the vertical cascade. The horizontal cascade involves using larger draft models to generate the earlier tokens and smaller models for the later tokens. The vertical cascade requires each model to review drafts from smaller models with the exception of the smallest model, which is a statistical language model. As the horizontal cascade and vertical cascade are orthogonal, CS Drafting combines both approaches for optimal efficiency. The figure shows an example of Cascade Speculative Drafting with target model M t and draft models M d1 , M d2 , and M d3 .However, since draft models are typically required to generate multiple tokens in multiple steps, where each generation still involves inefficient autoregressive decoding, the performance of speculative decoding could be limited by the drafting latency. This inefficiency is also indicated by Leviathan et al. [14] , where it was observed that very small models (e.g., around two orders of magnitude smaller than the target model) are usually the best choice for drafting because their inference cost is lower compared to that of a larger draft model, despite the fact that larger draft models usually have higher-quality generation. This underscores that improving drafting efficiency is crucial for further enhancing the performance of speculative decoding.In light of this, one key strategy to address this bottleneck is to avoid the inefficient autoregressive generation of neural draft models. Based on this consideration, it is noted that statistical language models, such as bigram language models, incur negligible latency and computational resource costs compared to neural language models, owing to their simple structure. However, because the tokens generated by statistical language models usually do not have a high probability of being accepted by the target model, speculative decoding with statistical language models alone may not yield optimal results compared to using a well-sized neural language model from the same family as the draft model. Nonetheless, we notice that it is not necessary to use only one draft model in speculative decoding-statistical language models can serve as the "draft" model for the neural draft model, thereby eliminating autoregressive generation from the neural draft model. Furthermore, our analysis in Figure 2 reveals a pattern during the drafting step: tokens generated later in the sequence by the draft model show a progressively lower probability of being accepted by the target model. This is because the probability of a token being accepted is conditioned on the acceptance of the previous tokens. It indicates that later tokens from draft models are more prone to rejection, contributing less to the expected number of accepted tokens per draft step, yet incurring the same latency.Inspired by the above observations, we propose Cascade Speculative Drafting (CS Drafting), a speculative execution algorithm that comprises multiple draft models, with the smallest being a statistical language model. Each neural draft model reviews generations from a smaller model and then proposes its reviewed content to either a larger draft model or the target model. In this design, the drafting of each neural model is accelerated by drafting from a smaller model, avoiding the inefficiency of autoregressive generation from neural models. We refer to this tiered speculative decoding approach as the Vertical Cascade. In addition, we suggest the use of smaller, faster draft models for generating high-rejection tokens that are trailing in drafting generation, forming the Horizontal Cascade. Along with the aforementioned Vertical Cascade, these strategies compose our complete CS Drafting approach, as illustrated in Figure 1 .Through theoretical analysis and empirical studies, we demonstrate that the CS Drafting algorithm outperforms speculative decoding in terms of latency across various tasks and settings, achieving an additional speedup of up to 81% over speculative decoding. These findings highlight the practical advantages and efficiency enhancements offered by both vertical and horizontal cascades.The main contributions are summarized as follows:• We introduce Cascade Speculative Drafting (CS Drafting), a speculative-execution-based algorithm that improves language model inference speed without sacrificing generation quality. • We provide theoretical analyses supporting the effectiveness of the proposed CS Drafting approach. • We conduct empirical experiments showing that CS Drafting achieves further speedup over speculative decoding across different tasks and settings. 
preliminary: 
 The core concept of speculative decoding [14] involves the utilization of a small draft model for sequential token generation with validation by a larger target model resulting in reduced latency. This design accelerates sampling from autoregressive models without altering output distributions. At its heart, there are two key observations: 1) certain generations in language modeling are simpler than others and can be predicted by more efficient models correctly, and 2) using speculative execution along with a new sampling method enables faster, exact decoding from large models.Specifically, let x be the input tokens at a run and M t and M d are the target and the draft model respectively, k be the number of draft tokens generated per step, and M t (x)[i] and M d (x)[i] be their probability output at i-th token when input is x. We interpret speculative sampling as a two-stage operation. In the proposing stage, we sample {x t+1 , ..., x t+k } from draft model M d autoregressively and append them to x. In the reviewing stage, let x i ∈ {x t+1 , ..., x t+k } represents the token at the current position, and we accept it if 1] and proceed to resample x i from a recalibrated distribution norm(max(0,M d (x)[i -1] ≤ M t (x)[i -1]; in the event that M d (x)[i -1] > M t (x)[i -1], we reject x i with a probability of 1 -Mt(x)[i-1] M d (x)[i-M t (x)[i -1] -M d (x)[i -1])) and reject any token following x i . At the end, the target model will generate one additional token following the accepted tokens. Such a design guarantees the output is the same as sampling autoregressively using the target model alone [14] .Speculative decoding was empirically validated on various tasks and model sizes, demonstrating a significant acceleration in inference times (2x-3x faster) compared to standard implementations, without affecting the outputs. Importantly, it does not require task-specific training, altering model architectures, or changing training procedures, making it a practical solution for reducing the latency of LLM inference.Require: draft models {M d1 , ..., M dn }, target mode M t , pref ix, flag isF irstCall, hyperparameters K nn , l draftList ← [M d1 , ..., M dn ] ▷ Initialize curGen and curProb. curGen ← pref ix, curProbs ← a list of ones with the same length as prefix ▷ Unpack the a list of k for the current function call.[k 1 , ..., k n-1 ] ← first row of K nn ▷ Generate using MaG for the Base case of the recursive call. if draftList is empty then M ← first element of draftList res ← M(curGen) return res.generation, res.logits end if ▷ Perform the horizontal cascade with the for loop. for i ← 1 to n do ▷ Prepare the arguments for the next recursive call. curTarget ← the i-th item of draftList curDraftList ← the sublist of draftList starting from index i + 1 curK ← the submatrix of K nn from with the top-left corner at (i + 1, i + 1) extending to the bottom-right corner curPrefix ← curGen while curGen.length -curPrefix.length is less thank i do curPrefix ← curGen ▷ Perform the vertical cascade with the recursive call. [x 1 , .., x u ], [p 1 , p 2 , ..., p v ] ← CascadeSpeculativeDraftingStep(curDraftList, curTarget, cur- Prefix, False, curK, l) curGen ← [x 1 , .., x u ] s ← curProbs.length + 1 Add elements of [p 1 , p 2 , ..., p v ]to curProbs end while end for ▷ Set lenience to 1 when the original target model reviews.if isFirstCall then l ← 1 end if ▷ Use M t to review the draft generation. [x 1 , ..., x out ], [p ′ 1 , p ′ 2 , ..., p ′ out ] = review(M t , curGen, curProbs, l) return [x 1 , ..., x out ], [p ′ 1 , p ′ 2 , ..., p ′ out ]3 Cascade Speculative DraftingIn this section, we introduce our proposed method, Cascade Speculative Drafting (CS Drafting), a speculative execution algorithm that incorporates two types of cascades: vertical cascade and horizontal cascade. 
vertical cascade: 
 A notable inefficiency of the speculative decoding algorithm is the reliance on the autoregressive generation of a smaller draft model. Since the draft model must run k times for each target model run, the cost can still be significant despite its smaller size. In light of this, we reduce the drafting inefficiency by using an even smaller model to assist in drafting and employing the original draft model to review the generation of this smaller model. In addition, since this process can be performed again on the draft model that drafts for the original model, we recursively perform this process until it reaches a statistical draft model that involves negligent cost, such as a bigram language model. In this approach, we expect each recursion step will reduce the drafting latency without altering the output distribution. We refer to this recursive speculative approach as Vertical Cascade.Additionally, we incorporate lenience, a hyperparameter that loosens the review process by the target model, allowing for faster speed at the trade-off of potentially differing results from the target model [14] . Lenience can be adopted during sampling or greedy decoding with speculative decoding. Let lenience l ∈ [1, ∞). When sampling, the acceptance condition for tokenx i is transformed to M d (x)[i] ≤ l × M t (x)[i].If the acceptance condition is not satisfied, with a probability of 1 -l×Mt(x) M d (x) , we reject x i and any following tokens. 2 When performing greedy decoding, the acceptance condition becomes deterministic and is simply eitherargmaxM d (x)[i] = argmaxM t (x)[i] or M d (x)[i] ≤ l × M t (x)[i].For the speculative decoding algorithm, the reduced quality introduced by lenience is generally undesirable. However, for the vertical cascade approach, lenience affects the final output only if it is applied when the target model reviews. Therefore, we can limit the application of lenience in the vertical cascade only when draft models review and do not apply lenience when the target model reviews. This can ensure the final output is not altered while further reducing latency.Another key observation is that during the drafting steps of speculative decoding, not all drafting tokens are created equal, as illustrated in Figure 2 . The first draft token is more likely to be accepted as it only depends on itself; the last token is rarely accepted, as it has a chance of being reviewed only if all preceding tokens are accepted. From a theoretical perspective, assume the event of acceptance of each token being a Bernoulli distribution with probably p, the probability of n-th token being accepted is p n , implying an exponential decrease of value for tokens generated later in the sequence.Inspired by this observation, we designed Horizontal Cascade, an approach that improves time allocation by draft token allocation. Horizontal Cascade assigns the largest draft model to perform the generation of the first draft token due to its highest output alignment with the target model, and it progressively uses a smaller as the new draft token to be generated is less likely to be accepted. This process stops after the smallest model, i.e., a statistical language model finishes. This design reduces the time cost of generating unimportant draft tokens with a costly draft model, leading to a reduction in overall latency.As both Vertical Cascade and Horizontal Cascade remark cascade toward faster draft models, a statistical language model, which is the basis of the cascade, becomes essential for the efficiency of both approaches. In our pursuit of a more effective statistical language model, we noticed a general pattern: in language model generation, some words and phrases from the input query frequently reappear in the generated content. In light of this observation, we designed the Max-Gram (MaG) algorithm. It greedily identifies maximal matches between the initial input (or existing generation) and tokens from the end of the generation. In cases where there is no match, we resort to a bigram model based on the probability distribution of Wikipedia (chosen to maintain the generality). We include a GPU-friendly version of the Max-Gram algorithm in Appendix A.Combining the horizontal and vertical cascades, the algorithm of cascade speculative decoding is presented in Algorithm 1. At its center, the horizontal cascade is realized by the for loop, while the vertical cascade is implemented through recursive calls. Notably, the MaG model is incorporated as the smallest draft model to avoid autoregressive generation from a neural model. An example of CS Drafting is shown in Figure 1 .The algorithm requires an upper-triangular hyperparameter, K nn , with each row serving as the stop criteria for a layer of recursive calls. For simplicity, we assume the lenience l is universal for the algorithm, except when the target model is under review; thus, the algorithm can benefit from the speedup of lenience without altering the output distribution. 
analysis: 
 In this section, we provide theoretical analyses for Cascade Speculative Drafting. We begin with some notions. Let M t be the target model, M d be the draft model, and k be the number of draft tokens generated per step. Expected walltime improvement factor (EWIF) is the expected time improvement achieved by an algorithm under the i.i.d. assumption of token acceptance.Despite the simple setting of EWIF, it is demonstrated that it aligns with the experimental results in most instances [14] . Therefore, our analysis will concentrate on EWIF.We analyze EWIF of vertical cascade using generating functions, a well-studied topic in combinatorial mathematics [24] . The properties of generating functions are useful in the recursion and evaluation process making our final expression simple.We begin with the derivation of the probability generating function for speculative decoding. Theorem 4.1. For speculative decoding between M t and M d , let p i be the probability of generating i tokens. The probability generating function of p i satisfies the following equation:EQUATIONwhere α = α(M t , M d ).Proof in Appendix C.1.Corollary 4.2. The EWIF of speculative decoding isϕ ′ (α,k) (1) (ck+1) = 1-α k+1 (1-α)(ck+1) .We use the generating function to derive the EWIF of a vertical cascade and analyze the case involving two draft models, M d1 and M d2 . Theorem 4.3. Assume k to be the speculative decoding parameter between M d1 and M d2 , and n to be the number of steps M t reviews. The EWIF by this system isEQUATIONwhereϕ(x) = ϕ (α(M d 1 ,M d 2 ),k) (x), α = α(M t , M d ), and c d1 , c d2 be c(M t , M d1 ), c(M t , M d2 ) respectively. Corollary 4.4. ϕ α ′ ,k (α) < α for any 1 > α > 0, 1 > α ′ > 0, k > 0, so if c d2 ≪ 1, the EWIF of M d1 and M d2 is higher than EWIF of M d1 alone. Proof in Appendix C.2.Therefore, with the statistical model having negligible cost (i.e., c d2 ≪ 1), it can almost always improve the efficiency of an SD system.We also present an analysis of the walltime improvement offered by the horizontal cascade.To assist the analysis, we establish the notions. Let M t be the target model, {M i } be the draft models assisting generation with M i being the draft model generating the i-th token. In the simpler case of the speculative decoding, M i = M d for any i. Let x be the input to the model at a single run, M t (x) and M i (x) are then the output probability distribution with input x. To simplify notation, let 1 : Simulated EWIF under the assumption that the acceptance distribution is a Bernoulli distribution. BASE and SMALL refer to FLAN-T5-BASE and FLAN-T5-SMALL. In the simulation, speculative sampling with horizontal cascade exceeded the performance of the vanilla speculative decoding on both CNN Dailymail [16] and WMT EnDe [2] datasets.α i = α(M t (x), M i (x)) and c i = c(M t (x), M i (x)). Dataset M d1 M d2 k 1 k 2 EWIFTheorem 4.5. The expected walltime improvement factor (EWIF) of the horizontal cascade isT (k, α 1 , ..., α k , c 1 , ..., c k ) = k i=0 i j=1 αj 1+ k i=1 ci .Furthermore, theorem 4.5 can be used to analyze the importance of the tokens in the drafting step.Corollary 4.6. The probability of i-th token being accepted is i j=1 α j . The derivative of EWIF with respect to α l is dT (k,α1,...,α k ,c1,...,c k )dα l = k i=l i j=1,j̸ =l αj 1+ k i=1 ci. Specifically, dT (k,α1,...,α k ,c1,...,c k )dα1 = k i=1 i j=2 αj 1+ k i=1 ciand dT (k,α1,...,α k ,c1,...,c k )dα k = k-1 j=1 αj 1+ k i=1 ci .Using the information provided by Leviathan et al. [14] , we calculate a simulated EWIF under the assumption that the event of acceptance by the target model is a Bernoulli trial. The results, shown in Table 1 , indicate that speculative sampling with a horizontal cascade achieved better EWIF than vanilla speculative sampling under this assumption. 
experimental setup: 
 Metrics We use both our proposed standardized walltime improvement and walltime for evaluation:• Standardized walltime improvement (SWI) assumes each forward run of a model takes a constant amount of time which can be recorded data of previous work [14] or heuristics such as the total number of the parameters of a model. Under this assumption, the value of SWI is the speedup of the speculative method over autoregressive generation. SWI alleviates hardware variation and features full reproducibility of experiment results. • Walltime refers to the actual elapsed time taken to complete a specific task or operation in a realworld scenario. Despite being less reproducible and sensitive to noise, walltime better represents the performance for individual users. In our experiment, walltime is measured in the form of the number of tokens generated per second on our GPU.Datasets We chose two commonly used datasets for our experiments. For both datasets, we conducted experiments in a zero-shot chain-of-thought setup [13, 23] :• GSM8K [7] is a dataset comprising 8,500 high-quality, linguistically diverse, grade-school math word problems. It focuses on multi-step reasoning with problems that are typically solvable using basic arithmetic in 2 to 8 steps. The experimental results on FLAN-T5. Speedup (MS) is the standardized walltime improvement with the assumption that the latency of each run of a model is its number of parameters (model size). Speedup (PW) is the SWI with the assumption that the latency of each run of a model is the time cost data reported from previous work [14] .vertically by combining with other advanced decoding methods. To verify this, we also leverage tree attention, as used in Medusa [3] , and compare its performance with Medusa.Implementation Details To ensure the generality of our findings, we perform experiments on both encoder-decoder and decoder-only models. For encoder-decoder models, we choose our target and draft models from the FLAN-T5 [6] family for our experiment, as there is a large variation in model sizes within the FLAN-T5 family (ranging from 77 million to 11 billion parameters). We use FLAN-T5-XXL as our target model, FLAN-T5-BASE and FLAN-T5-SMALL as our reviewing draft models. For decoder-only models, we select Vicuna-7B [28] , a fine-tuned version of LLaMA [20] as the target model. We use a 68M model with the same tokenizer as the reviewing draft model 3 .We also leverage tree attention [15, 3] with CS Drafting for the experiments on Vicuna-7B. In both cases, the Max-Gram algorithm is used as the generating draft model. Since we do not observe any significant difference between sampling with temperature 1 and greedy decoding in previous speculative decoding experiments [14] , and to ensure our experiments are fully reproducible, we perform sampling at temperature 0, i.e., using greedy decoding by default. To align our experiment with current common usage, we do not perform fine-tuning for CS Drafting, and the generation is conducted in a zero-shot manner. We include hyperparameter details in Appendix B. All of our experiments involving walltime are performed on a single NVIDIA A40 GPU.Table 2 presents the main experimental results. In two settings of SWI, Cascade Speculative Drafting has outperformed the speculative decoding algorithm. For GSM8K, CS Drafting achieved a maximum additional speedup of 44% over the fastest speculative algorithm; for MMLU, the maximum additional speedup improvement over speculative decoding is 81%.Effectiveness of MaG When comparing CS Drafting with one neural model and MaG against the fastest speculative decoding setup, we found that CS Drafting with one neural model gained up to a 70% speedup on MMLU and a 32% speedup on GSM8K. Notably, the MaG algorithm only involves a bigram model with parameters equal to the tokenizer size, making its memory cost negligible."In addition, the speedup gained using CS Drafting with one neural model involves no additional deployment overhead while reducing both latency and computational cost, making it a superior choice over speculative decoding.Draft Model Size Despite FLAN-T5-SMALL mostly outperforming FLAN-T5-BASE as a draft model for speculative decoding, in CS Drafting with the aid of MaG, FLAN-T5-BASE consistently outperforms FLAN-T5-SMALL. This implies that with the limitation of a single draft model, the ideal size of the draft model might increase with the assistance of the MaG model.As shown in Table 3 , CS Drafting achieves a significant walltime improvement over speculative decoding. Moreover, CS Drafting exceeds Medusa when combined with tree attention [15, 3] . This suggests that CS Drafting can be integrated with other efficient designs for speculative decoding to further accelerate inference. We leave the exploration of more advanced combinations as future work.We perform a hyperparameter study on K 00 , the hyperparameter with the greatest effect on our experiments. As shown in Table 4 , the performance of CS Drafting only decreases slightly when this hyperparameter is sub-optimal. Therefore, end users who do not require maximum performance can use a simple setup to achieve near-optimal performance with CS Drafting. Furthermore, we conduct an ablation study by removing the horizontal cascade. On GSM8K, with Vicuna-7B and K 00 = 1, this results in a performance drop from 56.16 to 53.55.6 Related Work 
efficienct methods for language model inference: 
 In the era of large language models, efficiency during inference becomes a key to model service. To reduce the model inference cost and speed up, several efficient methods have been proposed, including pruning, knowledge distillation and quantization [21] . Model pruning takes structured [26, 22] or unstructured [9, 5] methods to remove the redundant model parameters to reduce the storage memory and increase inference speed. Knowledge distillation takes the approach of transferring knowledge from a superior teacher model to a smaller student model [11, 8] . Quantization maps high-precision data representations (e.g. 32 bits) into low-precision ones (e.g. 8 bits) to reduce memory consumption [1, 18] .With the success of Speculative Decoding [4, 14] in reducing the large language model inference latency, some recent works have attempted to improve Speculative Decoding by reducing the rejection rate. Zhou et al. [29] propose using generalized knowledge distillation and achieve a lower rejection rate compared to other knowledge distillation methods. Avoiding an additional draft model, self-drafting is an approach to speculative decoding by reusing part of the target model together with added weight to perform drafting [27, 12] . Tree attention involves generating multiple candidates during drafting to increase the chance of acceptance [19, 15] . Besides reducing the rejection rate, improving drafting efficiency can also reduce latency. Spector et al. [19] propose using speculative decoding for drafting, showing similarities to the vertical cascade; however, their method only has two layers of speculative decoding and does not observe the recursive nature of the vertical cascade nor the lenience among draft models, two crucial aspects for the performance of vertical cascade. 
conclusion: 
 In this work, we propose a novel algorithm, CS Drafting, which involves two cascades: the vertical cascade and the horizontal cascade. The vertical cascade eliminates the necessity of autoregressive generation from a neural language model, while the horizontal cascade effectively allocates the cost of drafting tokens at different positions. CS Drafting achieves additional speedup over baselines in various settings while maintaining the same output distribution as the target model. 
limitations: 
 Our experiments demonstrate strong performance for our methods. However, it is possible, though unlikely, that the outcome might differ on a system with different hardware configurations. To account for this, we report both standardized walltime improvement and raw walltime for a more robust evaluation. Additionally, we provide theoretical analyses to justify the improvements, which is independent of the hardware configurations.A Max-Gram Implementation  
 
 Appendix: To reduce the number of hyperparameters to tune, we use MaG to generate 10 tokens at once, as it is rare for more than 10 tokens to be accepted with the exception when CS Drafting is combined with tree attention. We do not use lenience when the reviewer is M t to ensure the output distribution does not change. We also avoid lenience between MaG and its reviewer, since there is still a significant performance gap between MaG and a neural model. C.1 Proof for Theorem 4.1Proof. The probability of accepting i tokens is α i -α i+1 , with the exception of the k + 1-th token, which has a probability of α k of being accepted. This is because it requires all the first i tokens to be accepted and the i + 1-th token to be rejected for this to happen. Therefore, Table 5 : The experimental results on FLAN-T5 with hyperparameter details. Speedup (MS) is the standardized walltime improvement with the assumption that the latency of each run of a model is its number of parameters (model size). Speedup (PW) is the SWI with the assumption that the latency of each run of a model is the time cost data reported from previous work [14] . k 11 , k 12 , k 22 , l are the hyperparameters. k 11 and k 12 represent the step limitation target model and the draft models, k 22 is the step limitations between the first and second draft model, and l is lenience as shown in algorithm 1. For speculative decoding, the k 11 is simply the k.EQUATIONBy rearranging the terms, we can achieve an expression much easier to work withEQUATIONC.2 Proof for Theorem 4.3Proof. Let α ′ = α(M d1 , M d2 ). We first calculate the expected number of tokens being generated in a step of vertical cascade with M d1 , M d2 . With the property of generating function, the coefficient of term x j of ϕ n (x) is the probability of the sum of acceptance length of n speculative step being j. Therefore, ϕ n (x) represents the probability generating function right before M t performs the generation.To achieve the expected number of token acceptances of a probability-generating function, we seek for an operator that can map the probability-generating function into the desired expectation.To achieve the operator, we begin with a single polynomial term of x j . Fortunately, given the end result of 1-α j+1 (1-α) [14] , the operator T α (f (x)) = 1-αf (α) (1-α) will convert x j to 1-α j+1 (1-α) . In addition, due to the linearity of the operator, this can be extended to any polynomial. Therefore, we achieved the desired operator to map a probability-generating function into the desired expectation.Apply operator T α to ϕ n (x), we achieved the result of 1-αϕ n (α) (1-α) for the expected number of accepted tokens. Furthermore, since the number of M d1 calls is n, and M d2 is called k time for each M d1 call given a total of nk calls of M d2 . The time cost is 1 + nc d1 + nkc d2 which implied the EWIF of the system being 1-αϕ n (α)(1-α)(1+nc d 1 +nkc d 2 ) . For Corollary 4.4, since both 0 < α < 1 and 0 < α ′ < 1, we have α i+1 α ′i+1 < αα ′ , meaning that 1-α k+1 α ′k+11-αα ′ < 1. Together with α -1 < 0, we have ϕ α ′ ,k (α) < 1 + (α -1) = α. If we also let nkc d2 = 0, we have1-αϕ n (α) (1-α)(1+nc d 1 +nkc d 2 ) > 1-αα n (1-α)(1+nc d 1 ), which is the EWIF for speculative decoding with step size n.Code is publicly available at https://github.com/lfsszd/CS-Drafting. 38th Conference on Neural Information Processing Systems (NeurIPS2024).For simplicity, we assume the probability outputs are not standardized. We refer the readers to the speculative decoding paper[14] for the discussion on standardized sampling.https://huggingface.co/double7/vicuna-68m 


Decision: This paper introduces a novel approach to accelerating LLM decoding by combining speculative decoding with vertical and horizontal model cascades. The originality is evident in the innovative techniques: horizontal cascades, which use larger models for initial tokens and smaller ones for subsequent tokens, and vertical cascades, which verify outputs through a series of cascaded models. The authors effectively demonstrate speed improvements over traditional speculative decoding and show that their method can enhance performance when integrated with existing techniques.

To further strengthen the paper, the authors should incorporate valuable discussions from the review period into the final version. This addition would address any remaining gaps and improve the clarity of the proposed methods. Overall, the paper is an original contribution to the field, and I recommend it for acceptance.

Reviews: review: paper_summary: paper_summary: This study introduces a novel method to accelerate large language model (LLM) decoding by integrating speculative decoding with two types of model cascades: vertical and horizontal. The horizontal cascade utilizes larger draft models for generating initial tokens, while smaller models assist in producing subsequent tokens. The vertical cascade implements a series of verification steps using a stack of cascaded models of varying sizes. Through the integration of these approaches, the authors report notable improvements in decoding speed across benchmarks.
strength_weakness: strength_weakness: **Algorithmic Complexity**: The paper discusses the use of horizontal and vertical cascades, but each additional cascade increases the algorithmic complexity of the decoding process. This complexity can become particularly challenging with larger models. The paper does not address how to balance this increased complexity with the potential speedup gains. Important questions such as the optimal number of cascades and the comparative usefulness of horizontal versus vertical cascades remain unanswered.

**Ablation Study**: The max-gram drafting technique appears to be quite efficient for generating many tokens without needing to invoke other medium-sized models. However, the paper lacks an ablation study to analyze the impact of different model combinations on decoding performance. Including such a study would provide valuable insights into the efficiency and effectiveness of the proposed method.

**Memory and Compute Constraints** The use of multiple models in complex scenarios poses challenges related to memory and computational limits. With limited memory and bandwidth, adding more cascades might not lead to faster end-to-end latency, especially as the target models grow in size. The paper does not consider this factor or provide a discussion on its implications.
questions: questions: Please see the "Weaknesses" section.
limitations: limitations: Ok.
paper_summary: paper_summary: The paper proposes to use multiple draft model for speculative decoding. Specifically, the smallest model could be the statistic language model which has negligible latency therefore reducing the cost of autoregressive regression. Experiments show the proposed method works better than baselines.
strength_weakness: strength_weakness: (1) Algorithm 1 is heavy and should be simplified for the reader.

(2) The whole pipeline seems to introduce lots of engineering work. For instance, we need to set hyperparameters for how to choose model size for each token position. Lenience is also used which is good but increases the complexity of the pipeline.
questions: questions: N/A
limitations: limitations: N/A
paper_summary: paper_summary: This paper concentrates on the inference efficiency of LLMs and thinks that the autoregressive generation contained in drafting process of speculative decoding leads to the suboptimal performance of speculative decoding.  It introduces a novel speculative execution algorithm,  Cascade Speculative Drafting (CS Drafting), which containes Vertical Cascade and Horizontal Cascade to achieve better speedup, while preserving the same output distribution as the target model.
strength_weakness: strength_weakness: 1. The model employs a heuristic approach, involving a large number of hyperparameters, especially the $k$-matrix, whose quantity is related to the involved drift models. 
2. The experimental results are not sufficient. On one hand, it does not compare with the latest speculative decoding methods. On the other hand, the model does not explore performance with different number of candidate tokens. It also lacks ablation studies and does not individually investigate the different impacts of the two cascade methods.
3. There are writing issues in the article, such as the first line of Algorithm 1, line 178, and line 292. Additionally, many variables in Algorithm 1 are not explained.
questions: questions: 1. The description of the core algorithm, Algorithm 1, in this paper is not clear. It would be helpful to include an explanation of the overall logic of the algorithm and add descriptions of some variables. 
2. The paper lacks relevant ablation experiments to illustrate the relationship between the two cascade methods and lacks analytical experiments to demonstrate the robustness of the method with different numbers of candidate tokens.
limitations: limitations: The authors adequately addressed the limitations and, if applicable, potential negative societal impact of their work.

Comments: title: Response to Authors
comment: Thank you to the authors for their response. It was helpful in gaining a better understanding of the paper. I am maintaining my positive score.
Dear Reviewer FGcM, thank you again for reviewing our paper! We hope our response addresses your questions. Please let us know your thoughts, and we are more than happy to answer any further questions.
Dear Reviewer LRu7, thank you again for reviewing our paper! We hope our response addresses your questions. Please let us know your thoughts, and we are more than happy to answer any further questions.
Thank you for your feedback! We are glad that our response addressed your concerns. We will incorporate your suggestions into the final version.
Thank you very much for your response. After reading your reply, I am very pleased with the improvements in the score. I hope you can incorporate our suggestions into the final version.