SpecDec++: Boosting Speculative Decoding via Adaptive Candidate Lengths
Authors: Kaixuan Huang
Xudong Guo
Mengdi Wang
Venue: COLM 2025 (2025)
Keywords: speculative decoding
MDP theory
large language models
TL;DR: Based on MDP theory, we use a trained acceptance prediction head to determine when to stop the current proposal round for speculative decoding.

Abstract: Speculative decoding reduces the inference latency of a target large language model via utilizing a smaller and faster draft model. Its performance depends on a hyperparameter K -- the candidate length, i.e., the number of candidate tokens for the target model to verify in each round. However, previous methods often use simple heuristics to choose K, which may result in sub-optimal performance. We study the choice of the candidate length K and formulate it as a Markov Decision Process. We theoretically show that the optimal policy of this Markov decision process takes the form of a threshold policy, i.e., the current speculation should stop and be verified when the probability of getting a rejection exceeds a threshold value. Motivated by this theory, we propose SpecDec++, an enhanced version of speculative decoding that adaptively determines the candidate length on the fly. We augment the draft model with a trained acceptance prediction head to predict the conditional acceptance probability of the candidate tokens. SpecDec++ will stop the current speculation when the predicted probability that at least one token gets rejected exceeds a threshold. We implement SpecDec++ and apply it to the llama-2-chat 7B & 70B model pair. Our adaptive method achieves a 2.04x speedup on the Alpaca dataset (7.2% improvement over the baseline speculative decoding). On the GSM8K and HumanEval datasets, our method achieves a 2.26x speedup (9.4% improvement) and 2.23x speedup (11.1% improvement), respectively. The code of this paper is available at https://github.com/Kaffaljidhmah2/SpecDec_pp.

Published as a conference paper at COLM 2025
SpecDec++: Boosting Speculative Decoding via Adaptive Can- didate Lengths
Kaixuan Huang
Xudong Guo Tsinghua University
Princeton University
kaixuanh@princeton.c edu
gxd20@mails tsinghua. edu.. cn
Mengdi Wang
Princeton University
mengdiwwprince www.:weerriieooo..mm
Abstract
Speculative decoding reduces the inference latency of target large lan- guage model via utilizing a smaller and faster draft model. Its performance depends on hyperparameter K - the candidate length, i.e, the number of candidate tokens for the target model to verify in each round. However, previous methods often use simple heuristics to choose K, which may result in sub-optimal performance. We study the choice of the candidate length K and formulate it as a Markov Decision Process. We theoretically show that the optimal policy of this Markov decision process takes the form of a thresh- old policy, i.e., the current speculation should stop and be verified when the probability of getting a rejection exceeds threshold value. Motivated by this theory, we propose SpecDec+t, an enhanced version of speculative de- coding that adaptively determines the candidate length on the fly. We aug- ment the draft model with a trained acceptance prediction head to predict the conditional acceptance probability of the candidate tokens. SpecDec+t will stop the current speculation when the predicted probability that at least one token gets rejected exceeds threshold. We implement SpecDec++ and apply it to the 1laha-2-chat 7B & 70B model pair. Our adaptive method achieves 2.04x speedup on the Alpaca dataset (7.2% improvement over the baseline speculative decoding). On the GSM8K and HumanEval datasets, our method achieves 2.26x speedup (9.4% improvement) and 2.23x speedup (11.1% improvement), respectively. The code of this paper is available at https: gi thub. com/kaffalj dhmaaha d
1 Introduction
Current state-of-the-art Large Language Models (LLMs) have demonstrated extraordinary capabilities in various language tasks and have shown early signs of artificial general intelli- gence (Achiam et al., 2023; Anil et al., 2023; Team et al., 2023; Touvron et al., 2023a;b). As the top-performing LLMs often have hundreds of billions of parameters and extremely long context windows, there is an increasing demand for serving such huge models efficiently.
To decrease the inference latency, motivated by speculative execution techniques in proces- sors, speculative decoding (Chen et al., 2023a; Leviathan et al., 2023) incorporates draft model, which is smaller and faster, as the speculator for the target model, which is the large language model we want to accelerate. Given the current prefix, the draft model first auto-regressively generates tokens, taking substantially less time than would take the target model. The target model computes their log probabilities in parallel and then sequentially determines whether each token is accepted or not. Following the first rejected token (if any), the algorithm discards the remaining tokens and corrects the rejected token with fresh sample from a modified distribution. all tokens are accepted, a new token is sampled from the next-token probability given by the target model and appended to the
1

---

Published as a conference paper at COLM 2025
25
11.1% improvement
9.4% improvement 2.26x
No Speculative Decoding
Tokens per Second
7.2% improvement
2.23x
SpecDec
20
1.90x
2.04x
2.00x
2.07x
SpecDect+
-15
Alpaca
HumanEval
GSMBK
Figure 1: The performance of SpecDec++, Compared with the baseline speculative decoding (SpecDec) with fixed candidate lengths, by adaptively determining the candidate lengths via trained acceptance prediction head, SpecDec++ achieves relative 7.2%, 11.1%, and 9.4% improvement over the baseline methods on the Alpaca, HumanEval, and GSM8K dataset, respectively. The experiments are conducted with llama-2-chat 7B & 70B model pair on 2 NVIDÍA A100-80G GPUs.
sequence of accepted tokens, and then the process moves forward. Such draft- loops continue until the desired output is fully generated.
The speedup effect of speculative decoding depends two crucial aspects: (1) how well the draft model aligns with the target model, and (2) how fast the draft model gets compared to the target model. The two aspects influence the choice of the hyperparameter K: the number of candidate tokens generated by the draft model in each loop. When the draft model aligns well and/or or runs fast, we can choose larger K, which potentially allows more tokens to be accepted in each loop. However, a larger K also increases the chances of rejection so that more tokens get discarded.
Leviathan et al. (2023) studied the problem of choosing the hyperparameter K under the assumption that the acceptance rates of all the candidate tokens are constant. The authors showed that there exists one constant K that can maximize the speedup. However, such an assumption is unrealistic and does not approximate real-world cases well. Whether the draft model and the target model align well depends on the hardness of predicting the next token. Intuitively, when the next token is unambiguous from the prefix, the draft model and the target model align well, which means the acceptance probability of the current candidate token is large compared to other cases.
In this work, we aim to boost the performance of any speculative decoding algorithm by adaptively choosing the candidate length for each round. We first formalize the adaptive recision-making of K for speculative decoding decision to make at each timestep is whether or not to stop the current speculation round and submit the candidate tokens to the target model for verification and correction. The objective is to minimize the total inference time taken to generate a full response. Theoretically, we show that the optimal policy takes the form of threshold policy, i.e., is optimal to stop the speculation round whenever the probability of existing at least one rejected token in the candidates exceeds threshold.
Markov Decision Process (MDP). The
Inspired by the theory, we propose SpecDec++, an enhanced version of speculative decoding that adaptively determines the candidate length on the fly. First, we train an acceptance prediction head on top of the draft model to predict the acceptance probability of the candidate token. Training such an acceptance prediction head has two challenges: (1) there will be severe class imbalance problem, e-g., most tokens generated by the draft model will have a high probability of acceptance, depending on how well the two models align; (2) the input sequence to the model contains mostly tokens from the target model and only fraction of tokens generated by the draft model, so the training signal is sparse. To overcome the two challenges, imbalance problem, and we develop a token mixing approach by randomly mixing tokens from the target model and the draft model to increase training efficiency.
adopt weighted Binary Cross-Entrop
loss to address the class
2

---

Published as a conference paper at COLM 2025
At inference time, we opt to stop the current speculation round when the predicted probabil- ity of the existence of rejected token exceeds a constant stopping threshold. The procedure is illustrated in Figure 2. To validate the effectiveness of our proposed improvement tech- nique, we choose the simplest implementation of speculative decoding as the baseline and augment it with SpecDec++. When evaluating adaptive method achieves a 2.04x speedup compared with the 1.90x speedup of the baseline speculative decoding method on the Alpaca dataset. On the easier GSM8K and HumanEval datasets, our method boosts the baseline from 2.07x to 2.26x speedup and from 2.00x to 2.23x speedup, respectively.
7B & 70B model pair, our
We summarize the contributions below.
We formalize the dynamic choice of candidate length in speculative decoding as a Markov Decision Process (MDP) and conduct rigorous study on the inference time. We theoreti- cally show that when the probability that at least one foken gets rejected exceeds threshold, the optimal action is to stop the speculation and submit it for verification.
We propose SpecDec+t, an enhanced version of speculative decoding that adaptively determines the candidate length on the fly. We develop weighted binary cross-entropy loss and a token mixing method to efficiently train the prediction head and use it for dynamic recision-making in the decoding process.
We validate the effectiveness of SpecDec++ with a simple baseline implementation. Our method achieves an additional 7.2%, 9.4%, and 11.1% improvement over the baseline speculative decoding on the Alpaca, HumanEval, and GSMSK datasets, respectively.
2 Related Work
Improvements on Speculative Decoding. Since the proposal of speculative decoding,
people have been improving the algorithm from different perspectives, for example, (1) making the draft model align better with the target model (Zhou et al., 2024; Agarwal et al., 2024; Liu et al., 2023), (2) building smaller draft models or merging draft models into the target model (e.g. early-exiting) (Miao et al., 2023; Liu et al., 2024; Yang et al., 2023b; Bae et al., 2023; Zhang et al., 2024; Monea et al., 2023; Chen et al., 2023b), and (3) building heirachical system of speculative decoding (Spector & Re, 2023; Sun et al., 2024a).
In contrast, our work focuses on the theoretical properties of the candidate length selection, and our improvement is achieved through algorithmic improvements that are independent of system-level and hardware-level configurations and orthogonal to architectural or system- level improvements. This means SpecDec++ can be plugged into any implementation of speculative decoding as long as it adopts a form of draft models, e.g., EÁGLE et,,, 2024b). (024). Furthermore, it can be readily combined with other system and hardware improvements.
Medusa-like Methods. Several studies improve speculative decoding by abandoning the auto-regressivg draft model, including blockwise parallel sampling (Stern et al., 2018) and the popular Medusa (Cai et al., 2024). However, these approaches typically adopt a different method for verifying the candidate tokens, and the generated tokens may deviate from the target model's distribution under the general stochastic sampling setting. Therefore, we choose not to compare against this line of methods in our paper.
Heuristic Candidate Length Selection Methods. Leviathan et al. (2023) make the i.i.d. assumption on the acceptance probabilities of the candidate tokens and theoretically derive the optimal choice of K. Besides, Liu et al. (2024) and Kim et al. (2024) adopt simple heuristic that ends the speculation if the confidence of the current draft token distribution falls below threshold. Xu et al. (2023) uses the cumulative product of the confidences and extends to token trees. We include a discussion on why simple heuristics like confidence or entropy may lead to sub-optimal performance in Appendix B.1.
In comparison, our work systematically studies the candidate length selection within the theoretical MDP framework and uses the cumulative product of our trained prediction head to determine the end of the speculation. Due to space limit, please see Appendix B for an extended related work section.
3

---

Published as a conference paper at COLM 2025
3 Inference Time Analysis of Speculative Decoding
3.1 Background of Speculative Decoding
To auto-regressively generate sequence from p(- xxprffxx using speculative decoding, we first generate K candidate tokens (y1, .y..,,....,, yyK) from q(- xprefix)
yi ~ (() Xprefix
i= .,,,
We refer to K as the candidate length, i.e,, the number of candidate tokens for this round. Next, we sequentially check if each y; is accepted or not. If there is any rejection, we replace the first rejected token with a fresh sample from the corresponding modified probability dis- tribution and discard the subsequent tokens. For completeness, the details of the speculative decoding algorithm are stated in Appendix C.
The key practical consideration is that the probabilities of the candidate tokens p(y; Xprefix: ./...., Ví 1) can be calculated in parallel by the target model with no additional overhead, as the forward time is bottlenecked by the memory operations (Pope et al., 2023).
3.2 Inference Time Decomposition of Speculative Decoding
Our objective is to minimize the total inference time, which satisfies
Troal Edtrat-Nrran + ftarget
(3.1)
where fdraft and ftarget are the time needed for one forward pass and Naraft and Narget are the total number of forward passes of the draft model and the target model, respectively. Equation (3.1) holds under the implicit assumption that the forward passes of each of the models take constant time, which true when we have enough computational resources to support the increased concurrency when the length of the input sequence grows (Leviathan et al., 2023). We empirically verify that Equation (3.1) holds in our setting; see Section 5.2.
Let N be the number of the final generated tokens. Note that N is random variable inherent to the target model and the initial prompt, independent of the draft model and the number of candidate tokens K of each round choose. Let Ndiscarded be the number of total discarded tokens. By the fact that Ndraft + Narget = N + Ndiscarded/ we have the following lemma.
Lemma 3.1. The total inference time of any speculative decoding algorithm Trota can be decomposed as
Total = To + draft Miscarded + (farget - +draft) Narget
(3.2)
where To &dratt N is the oracle inference time.
To minimize the total inference time, we are required to trade-off between two objectives: minimizing the number of the discarded tokens Ndiscarded and minimizing the number of forward passes of the target model Nargett The two objectives conflict with each other, as a larger candidate length will incur more discarded tokens but less number of forward passes of the target model. Equation (3.2) states that the total cost is the weighted sum of the two and the weights are given by draa and (4arget (daat).
4 SpecDec++: Theory and Algorithm
4.1 A Motivating Example: Oracle Performance of Greedy Speculative Decoding
Let us focus on a simplified deterministic setting of speculative decoding, where we use greedy decoding for the draft model and the target model. In this setting, the draft model deterministically generates a series of greedy tokens (Y,,..,, Yx), and the speculative de- coding algorithm reduces to sequentially checking whether Y; is also the greedy token of the target model. The first rejected token is replaced by the greedy token of the target model. If all the tokens are accepted, an additional token is generated by the target model directly.
4

---

Published as a conference paper at COLM 2025
For given prompt Xprompts let (X1, X,, XN) be the greedy tokens generated by the target model. We ask following question:
What is the oracle performance of the speculative decoding algorithm we can obtain by varying the number of candidate tokens, if wee have the knowledge of X2,.,....... .N) in hindsight?
Let consider the first speculation round. The draft model generates (Y,, Y2....) greedily. Let Y, be the first token such that Y; + X, The optimal strategy is to stop the speculation at time (i - 1), the last candidate token Y, is accepted, and Y will be generated directly by the target model, because (1) if we stop the speculation earlier, then the shorter candidate tokens will still be accepted, but this induces at least unnecessary forward pass of the target model; (2) if we stop the speculation later, then we waste at least one candidate token Y, By repeating the argument, we have the following.
Theorem 4.1. In the greedy decoding setting, for a given prompt Xprompt, let (X,, X2...,,, be the greedy tokens generated by the target model. We define Y; = argmax q(: xprompt, X1, X,...., X;-,,,,,,))) to be the greedy token of the draft model q condi- tioned on the partial generation of the target model. Let S be the set of disagreement between the draft model and the target model: S = {1 S S N Y; + X.). Then, by optimally stopping at time (i - 1) for every E S, obtain the oracle performance with Ndiscarded = 0 and Nargett = [|] + 1.
Empirical implication. We perform preliminary study where we use all the prompts in the Alpaca dataset and calculate the set of disagreement S for each prompt with the llama- BaatttBBlllaaa---hhee
model pair. The results show that the average Narget /N 0.164 + 0.078 and the corresponding oracle throughput is 27.06 + 4.13 ookens/seconee (2.92x speedup) in the setting of Section 5. In comparison, the average throughput for the target model without speculative decoding is 9.26 tokens/ tokens/second, while speculative decoding with the best fixed K gives 17.58 tokens/ /secon (1.90x speedup) (Section 5). We can see huge potential in adaptively tuning the candidate lengths, which motivates our subsequent study on stochastic settings and the development of SpecDectt.
4.2 Speculative Decoding as Markov Decision Processes
We formulate speculative decoding into the following Markov Decision Process (MDP) framework.
States. We define the tuple s px (Y,,..., Ys)) as the current state of the MDP. Specifically, Xprefix the concatenation of the prompt and the partial response containing all the accepted tokens. (Y,,..., Y₁) is the current candidate tokens, which are auto-regressively sampled from the draft distribution q:
Y; q(- xprefix Yi...,, Y-1)), i -1,2,...
The initial state of the MDP (Xprompt, Ø).
Actions. Given the current state (Xprefixx (Yı,..,, Y))), the decision to make is whether or not to end the current speculation round and submit the candidate tokens to the target model for verification. We denote the current action by E (stop, continue] as the choice of stopping or continuing the current speculation round.
Transitions. First, we draw a random sample Y 4k+1 and append Y441 the current list of the candidate tokens.
When a continue, the next state s' simply (Xpretix (Y,,..,, .,, Yr, (++)).
When stop, the candidate tokens (Y,,..,, Yx+1) are verified via speculative decoding (Algorithm 2). Let n be the number of the accepted tokens. Let y be the replaced token when k + 1 the fresh token from the next-token distribution given by
the target model when n = k + 1. The next state s' = (x (xpretixx Ø) with the new prefix
In practice, when Y2+1 is EOS (the special token denoting the end of sequence) or when the total length hits the maximal generation length, we manually set stop.
5

---

Published as a conference paper at COLM 2025
P. F(Y, accepted Y..... acorpted, #pents)
mullipication
Acceptance Prediction Head
P(Y
Y; are accepted
Yi
Y2
Y
Yes
P
Draft Model
STOP
CONTINUE
precii
Figure 2: SpecDec++ uses trained acceptance prediction head to predict the conditional acceptance probability of the candidate tokens. When the predicted probability of the existence of at least rejected token exceeds the stopping threshold h, the current speculation round ends and the candidate tokens go through the target model for verification and correction.
x prefix (xprefix/ yi. y/) being the concatenation of the previous prefix and the newly generated tokens.
Our next theorem provides simple way to set the immediate cost so that the cumulative cost of the MDP matches the total inference time Speculative Decoding.
Theorem 4.2 (Immediate Cost of the MDP). Define cj = dran and C2 (Harget fdaatt) set the immediate cost of the MDP to be
c(s, continue,st s') T(31 < i k + Y, rejected) C1.
c(s, stop,s') 1(31 < <isk k 1,Y; is rejected) C1 + +2,
then the cumulative cost of the entire trajectory equals the total inference time Troal defined in Equation (3.1).
The theorem can be proved by invoking Lemma 3.1. For both continue and stop, we suffer loss ç if the current candidate token Yx+1 is discarded, which happens if there exists any candidate token Y (1 < S
that is rejected. If we stop at the current step, we suffer an additional cost C2 corresponding to the extra inference time of the target model.
Our next theorem 4.3 provides a sufficient condition for us to stop the current round of speculation and call the target model to verify the candidate tokens.
Theorem 4.3. For any time-homogeneon policy that has an upper bound for the number of candidate tokens, at the current state = (Xprefix (Yı,..,,,Y) when
C2
PP (P < i S k, Y; is rejected Xprefix)
C + C2 A'
the expected total cost stop is smaller than the expected total cost of continue, where A = A(T,, Xprompt p, C2) is problem-specific constant.
We defer the proof of Theorem 4.3 to Appendix E.
4.3 SpecDec++ Algorithm
Motivated by Theorem 4.3, we propose SpecDectt, adaptive speculative decoding algo- rithm that utilizes an additional prediction head to determine whether or not to stop the current speculation round. The additional prediction head fo is built top of the draft

---

Published as a conference paper at COLM 2025
model to predict the conditional probability
P (VVi Yi...., )
P(Y, is accepted Y....,, Y are accepted, x min (1,
qf (Yi) Xprefix/ ,,...,, 11-1)
We opt to implement small prediction head such that the computational overhead is negligible compared to a forward pass of the draft model. During inference time, we feed the input (Xprefix ,,, to the draft model and obtain the final embedding e; of the last token y, The predicted acceptance probability is given by
P(Y is accepted Yi,..., Y-1 are accepted, .Xpreix) = sigmoid(ffee))
(4.1)
If we have such a head fo, we propose to end the current round of speculation when the predicted probability that there exists one rejected token exceeds predefined threshold h
T(;))) stop + (31 S i i k, such that Y, is rejected x
h,
which can be computed by chain rule
((31 sis k, such that Y, is rejected xprefix)
=1 1 P(Y is accepted Yy...., Th....,y:u Yi-1 are accepted, xxrefix)
We summarize the proposed algorithm in Algorithm and illustrate it in Figure 2.
Algorithm SpecDec++
Require: draft model q, target model p, prefix Xprefix acceptance prediction head fa, thresh- old h.
Initialize the cumulative acceptance probability p
for = do
if then
Compute the final hidden embedding e; 1 of the token y; 1- end if
Compute 9: q(: Yt.efix.y1....... -/.-....ii-)
Sample yi 9:-
Update p <- p. sfgmoid
if p > h then
Break end if
end for
Let K be the number of candidate tokens in the previous for-loop.
Compute in parallel p: = p(- Xprefix, .......,.y-................... for 1,..., K 1. Sample fı, with r; ~ Unif(0, 1), 1,..., Compute the number of accepted tokens n min [ p(.)))))))))) if и < then
Sample y from the modified distribution Norm Norm|(Pn:1 9n 1x]1))]
else
Sample y' from pk+1
end if
Return Xprefix ./. Yn. y
4.4 Training Dataset Construction and Learning Objective
In this subsection, we focus on how to efficiently train an acceptance prediction head for SpecDec++. For each Xprompt in the prompt set D prompt first generate target re- sponse (X using the target model. Next, feed the prompt and the response
7

---

Published as a conference paper at COLM 2025
into the draft model to get q(- xprompt, "prompt.XX1.. ,,, X;-1)) for every i. We sample draft candidate Y; from the distribution
calculate the conditional acceptance probability P. = min (1, ((Y, XpoompxXi for each token, which will be the training target for the
acceptance prediction head.
Token Mixing. Ideally, the input to the acceptance prediction head should be (Xprompt, ,I,..,,yp 1, Yj). However, this naive construction is training-inefficien as only the final token Y; receives training signal. To overcome this, propose token mixing strategy, borrowing the random masking idea from BERT (Devlin et al., 2019): we randomly take 1% tokens from (X,, XN) and the remaining tokens from (Y,...., YN) to construct the response sequence, denoted by (Z,....,22 ZN). The losses are only computed for the to- kens from (Y,..., Yy). In this way, we trade the quality of the input sequences for training efficiency, as more tokens will receive training signals per forward pass of the model.
Weighted Binary Cross-Entropp (BCE) Loss. In the typical setting of speculative decoding where the draft model and the target model align reasonably well, there will be class imbalance issues in the training dataset, where most of the training examples will have P, close to 1. To accommodate the issues above, we train the prediction head using weighted binary cross-entropy (BCE) loss, taken over the tokens Z 's stemming from Y/'s. In summary, our final loss function is
Σ
(-Wace Wace P,log P. Wrej (1 (1-P;) log(1 P.)),
Xprompt D prompt
ISTEN:
Z, is taken from Y;
where Wace and Wrej are the weights and P.; = sigmoid (Xprommt Zi...., "i...,,7, Yi))).
5 Experiments
5.1 Experimental Setups
Datasets and Model Pairs. We adopt three datasets in our experiments: Alpaca (Taori et al., 2023), HumanEval (Chen et al., 2021), GSM8K (Cobbe et al., 2021). We only use prompts of the datasets and do not use responses. In the experiments, we solely focus on Ilama-2-chat models (Touvron et al., 2023b), while in Appendix D.4, we also provide additional experimental results on Gemma models (Team et al., 2024a;b). We choose to use 1lama-2-chat 7B as the draft model and Ilama-2-chat 70B as the target model. To reduce memory consumption, we use the bfloat16 format for the models.
Network Architecture, Weighted BCE Loss, and Stopping Criteria for SpecDectt, We build (D + llllayer ResNet with SiLU activation the acceptance prediction head, and we sweep from (linear layer) to 4 in the experiments. We adopt the weighted BCE loss where set Wace 1 and choose Wrej from {1,3, 6, 12). We tune the stopping threshold h in 0.3,, 0.5, 0.7, 0.9}. To ensure the robustness of SpecDectt, we manually stop each speculation round when the number of candidate tokens exceeds 20.
Baseline Method. We compare SpecDec++ with the simplest implementation of the spec- ulative decoding algorithm where the number of the candidate tokens K is fixed as hyperparameter. We tune K in {2,4, 4,,4,688 4,8,8 10, 12, 14).
Metrics. To measure the benefit of speculative decoding pipeline, we divide Equation (3.2) by N and get
latency = T / N = fdraft + fdraft Naiscarded / N + (ftarget - tdraft) Naagett N.
(5.1)
/N, We report two metrics: (1) discard rate Ndiscanded/ N, which is the average number of discarded tokens per one generated token, and (2) verification rate Ntarget/ / /N, which is the average number of the forward calls of the target model per one generated token.
Due to space limits, additional experimental setup is deferred to Appendix D.1.
8

---

Published as a conference paper at COLM 2025
Alpaca
HumanEval
GSM6K
SpecDec+ SpecDec
SpecDDcc+ SpecDac
SpecDecc+
1.5
1.5
1.5
SpecDic
Discard Hate
Discard
2.0
Discoud
5.0
0.5
0.5
0.5
0.15
0.30
0.25 Venliication Rate
0.15
0.30
Veniiictioo Rate
Venlication Rate
Figure 3: The average verification rates Narget/ / N and the average discard rates discarded N for SpecDec with different candidate lengths and SpecDec++ with different acceptance pre- diction heads and stopping thresholds. SpecDec++ has better Pareto frontiers than See on both the in-distribution dataset Alpaca and the two out-of-distribution datasets Hu-
FanEval and GSM8K.
5.2 Forward Time Analysis
First, we verify the correctness of Equation (3.1) and determine the forward time of the draft model fdratt and the target model ftarget under our specific setting. We collect all the (Naraft, Narget, Tooal) tuples from generations using speculative decoding (either the baseline version or SpecDect+) and perform a linear regression to determine the coefficients. We also determine the standalone inference time when using only the draft model the target model with linear regression. The linear regressions fit well with all R² 2 0.98 and the results are summarized in Appendix D.2, Table
The additional cost of the acceptance prediction head is negligible, as find that the average Idraft in SpecDec++ setting is smaller than the average draft in baseline SpecDec setting by 0.0004s, which is likely caused by random noise of the environment. Therefore, for both the baseline speculative decoding setting and SpecDec++ setting, we choose (fdrant taaggtt) = (0.0234, 0.112), which is the average between the two cases. For the stand-alone setting, we have (fdraft, farget) (0.0207, 0.108), indicating that the average throughput for the target model without speculative decoding is 9.26
5.3 Performance
We test the performances of the baseline speculative decoding with different K and SpecDec++ with the different acceptance prediction heads and different thresholds h. We calculate the discard rates Ndiscarded/ N and the verification rates Narget/ N (Equation (5.1)). The results are plotted in Figure 3. We see that SpecDec++ has strictly better Pareto frontiers than the baseline SpecDec on both the in-distribution test set Alpaca and the two out-of-distributio datasets HumanEval and GSMSK. Our method with adaptive candidate lengths improves upon the baseline method of fixed candidate lengths by reducing both the discard rate and the verification rate. The two metrics are independent of the actual forward times (taran and (tagget) and hence reusable for other hardware configurations, which indicates that SpecDec++ will still outperform the baseline under different sets of fdratt and target- Finally, we plug in the actual values of (fdran, ftagget = (0.0234, 0.112) as in Section 5.2. We summarize the throughputs in Table and visualize the improvements in Figure 1.
Table 1: The best throughputs achieved by SpecDec++ compared to the best throughputs achieved by the speculative decoding baseline on Alpaca, HumanEval, and GSM8K datasets.
Dataset
Alpaca
HumanEval
GSMSK
SpecDec++
18.88 (tokens/s)
20.61 (tokens/s)
20.95 (tokens/s)
SpecDec (baseline)
17.62 (tokens/s)
18.55 (tokens/s)
19.14 (tokens/s)
Discussions. As the distribution shift of the OOD datasets will influence the accuracies and the calibrations of the acceptance prediction heads, a natural question to ask is whether the optimal performances for different datasets are achieved with different acceptance

---

Published as a conference paper at COLM 2025
prediction heads and stopping thresholds. Empirically, confirm that this is indeed the case. Nevertheless, we find that using the acceptance prediction trained with Wrej = 6 and network depth D = and the stopping threshold tokens per second across the three datasets (2.03x for Alpaca, 2.21x for HumanBval, and 2.26x for GSM8K). Additional ablation studies on how the hyperparameters (Wrej, D, h) influence the final tokens per second can be found in Appendix D.3.
0.7 achieves over 99.3% of the best
6 Conclusion and Discussion
In this paper, we study the determination of the candidate lengths for speculative decoding, We formulate the problem as a Markov Decision Process and provide theorem that gives a sufficient condition to stop the current speculation. Motivated by the theoretical result, we propose SpecDec++ adaptively select the candidate length with a trained acceptance prediction head. We demonstrate significant algorithmic speedups over the naive Spec Dec baselines. Our paper focuses on the algorithmic aspects of speculative decoding with few assumptions on the system/ system/hardwarr hardware level implementations. Therefore, our method can be seamlessly integrated with other architectural or system-level improvements.
Theoretically, the acceleration achieved via SpecDec++ depends on the learnability of the conditional acceptance probability (Eqn. 4.1), which, in turn, depends on the amount of correlation between the degree of aligmment between the draft distribution and the target distribution and the existing context. While is hard to develop intuition into when such correlation is strong for a given pair of models, our empirical results demonstrate that the correlation indeed exists and can be extracted by training the acceptance prediction head, which ultimately leads to acceleration of speculative decoding. Meanwhile, the effectivenesses of many heuristic methods (Liu et al., 2024; Kim et al., 2024; Xu et al., 2023; Mamou et al., 2024) independently support the hypothesis that such correlation can be adequate for many pairs models.
Our final remark is the efficacy of speculative decoding in high-throughput scenarios. The conventional wisdom suggests that speculative decoding only improves latency and may hurt throughput when batch sizes are large. However, pointed out by Sadhukhan et al. (2025), in the prevalent long-context settings, KV cache loading becomes the main bottleneck of inference, and this memory bottleneck cannot be amortized by increasing batch sizes. Speculative decoding becomes an effective method to achieve speedup in this long-context scenario, even when the batch sizes are large. We leave for future work the adaptation of our analysis and technique to the bage-bat long-context settings.
Acknowledgments
We acknowledge Tianle Cai, Kaifeng Lyu, Zhuoming Chen, and Beidi Chen for the helpful feedback and discussion. Kaixuan Huang acknowledges the support Google PhD Fellow- ship. Mengdi Wang acknowledges support by NSF grants DMS-1953686, IIS-2107304, and ONR grant 1006977. The research is also supported by Princeton Language and Intelligence (PLI) Compute Cluster.
References
Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. Gpt-4 technical technical report. arXiv preprint arXit:2303.08774 2023.
Rishabh Agarwal, Nino Vieillard, Yongchao Zhou, Piotr Stanczyk, Sabela Ramos Garea, Matthieu Geist, and Olivier Bachem. On-policy distillation of language models: Learning from self-generated mistakes. In The Twelfth International Conference on Learning Represen- fations, 2024.
10

---

Published as a conference paper at COLM 2025
Rohan Anil, Andrew M Dai, Orhan Firat, Melvin Johnson, Dmitry Lepikhin, Alexandre Passos, Siamak Shakeri, Emanuel Taropa, Paige Bailey, Zhifeng Chen, et al. Palm technical report. arv preprint wrXi:2335510403,, 2023.
Jacob Austin, Daniel Johnson, Jonathan Ho, Daniel Tarlow, and Rianne Van Den Berg. Structured denoising diffusion models in discrete state-spaces. Advances in Neural Infor- mation Processing Systems, 34.17981-17993, 2021.
Sangmin Bae, Jongwoo Ko, Hwanjun Song, and Se- Young Yun. Fast and robust early-exiting framework for autoregressive language models with synchronized parallel decóding. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pp.
5910-5924, 2023.
Nikhil Bhendawade, Irina Belousova, Qichen Fu, Henry Mason, Mohammad Rastegari, and Mahyar Najibi. Speculative streaming: Fast Ilm inference without auxiliary models. arv preprint ar 1111:2240.11131, 2024.
Tianle Cai, Yuhong Li, Zhengyang Geng, Hongwu Peng, Jason D. Lee, Deming Chen, and Tri Dao. Medusa: Simple IIm inference acceleration framework with multiple decoding heads. arviv preprint Xiv: 2401.10774, 2024.
Charlie Chen, Sebastian Borgeaud, Geoffrey Irving, Jean-Baptiste Lespiau, Laurent Sifre, and John Jumper. Accelerating large language model decoding with speculative sampling. arXiv preprint arXiv:2302.013118 2023a.
Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. Evalu- ating large language models trained on code. ar aiv preprint ArXiv:2107 .03374, 2021.
Zhuoming Chen, Avner May, Ruslan Svirschevski, Yuhsun Huang, Max Ryabinin, Zhihao Jia, and Beidi Chen. Sequoia: Scalable, robust, and hardware-aware speculative decoding. ar Xiv preprint ar Xii::2442.12376 2024.
Ziyi Chen, Xiaocong Yang, Jiacheng Lin, Chenkai Sun, Jie Huang, and Kevin Chen-Chuan Chang. Cascade speculative drafting for even faster Ilm inference. arXiv preprint arXiv:2312.11462, 2023b.
Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reicchir Nakano, al. Training verifiers to solve math word problems. arv preprint ar trXiv22110.14666 2021.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT:
Pre-training of deep bidirectional transformers for language understanding. In Jill Burstein, Christy Doran, and Thamar Solorio (eds.), Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171-4184 Minneapolis, Minnesota, June 2019, Association for Computational Linguistics. doi: 10.18653 w1/66//////1191123... URL https: httt::s//aclanthologyy. org/N19-1423.
Cunxiao Du, Jing Jiang, Xu Yuanchen, Jiawei Wu, Sicheng Yu, Yongqi Li, Shenggui Li, Kai Xu, Liqiang Nie, Zhaopeng Tu, al. Glide with a cape: A low-hassle method accelerate speculative decoding. ar arv preprint ar arXiv:2402.02082 2024.
Yichao Fu, Peter Bailis, Ion Stoica, and Hao Zhang. Break the sequential dependency of Ilm inference using lookahead decoding, ar Xiv preprint ar XrX2::2402.00057, 2024.
Zhenyu He, Zexuan Zhong, Tianle Cai, Jason D Lee, and Di He. Rest: Retrieval-based speculative decoding. ar arviv preprint ar Xrx:::3311.088 108252, 2023.
Wonseok Jeon, Mukul Gagrani, Raghavv Goel, Junyoung Park, Mingu Lee, and Christopher Lott. Recursive speculative decoding: Accelerating Ilm inference via sampling without replacement. ar Xiv preprint ar 242.60002.44160, 2024.
11

---

Published as a conference paper at COLM 2025
Sehoon Kim, Karttikeya Mangalam, Suhong Moon, Jitendra Malik, Michael W Mahoney, Amir Gholami, and Kurt Keutzer. Speculative decoding with big little decoder. Advances in Neural Information Processing Systems, 36, 2024.
Siqi Kou, Lanxiang Hu, Zhezhi He, Zhijie Deng, and Hao Zhang. Cllms: Consistency large language models. ar Xiv preprint ar Xi::24403.0083: 2024.
Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph Gonzalez, Hao Zhang, and lon Stoica. Efficient memory management for large language model serving with pagedattention. In Proceedings of the 29th Symposium on Operating Systems Principles, pp. 611-626, 2023.
Yaniv Leviathan, Matan Kalman, and Yossi Matias. Fast inference from transformers via speculative decoding. In Andreas Krause, Emma Brunskill, Kyunghyun Cho, Barbara Engelhardt, Sivan Sabato, and Jonathan Scarlett (eds.), Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pp. 19274-19286. PMLR, 23-29 Jul 2023. URL https: https://proceedings mlr. ptt..prees//222// leviathan23a. html.
Xiang Li, John Thickstun, Ishaan Gulrajani, Percy S Liang, and Tatsunori B Hashimoto. Diffusion-Im improves controllable text generation. Adoances in Neural Information Pro- cessing Systems, 15:4338-43433 2022.
Yuhong Li, Yingbing Huang, Bowen Yang, Bharat Venkitesh, Acyr Locatelli, Hanchen Ye, Tianle Cai, Patrick Lewis, and Deming Chen. Snapkv: Llm knows what you are looking for before generation. arviv preprint 1rXio:2404.14400 2024a.
Yuhui Li, Fangyun Wei, Chao Zhang, and Hongyang Zhang. Eagle: Speculative sampling requires rethinking feature uncertainty. arxiv preprint ar arXtv:2401.15077 2024b.
Fangcheng Liu, Yehui Tang, Zhenhua Liu, Yunsheng Ni, Kai Han, and Yunhe Wang. Kangaroo: Lossless self-speculative decoding via double early exiting. arXiv preprint arXiv:2404.18911, 2024.
Xiaoxuan Liu, Lanxiang Hu, Peter Bailis, lon Stoica, Zhijie Deng, Alvin Cheung, and Hao Zhang. Online speculative decoding. arviv preprint xrXio:2310.07177, 2023.
Jonathan Mamou, Oren Pereg, Daniel Korat, Moshe Berchansky, Nadav Timor, Moshe Wasserblat, and Roy Schwartz. Dynamic speculation lookahead accelerates speculative decoding of large language models. arXiv preprint arXff::4405004330 2024.
Xupeng Miao, Gabriele Oliaro, Zhihao Zhang, Xinhao Cheng, Zeyu Wang, Rae Ying Yee Wong, Alan Zhu, Lijie Yang, Xiaoxiang Shi, Chunan Shi, Zhuoming Chen, Daiyaan Arfeen, Reyna Abhyankar, and Zhihao Jia. Specinfer: Accelerating generative large language model serving with speculative inference and token tree verification, 2023.
Giovanni Monea, Armand Joulin, and Edouard Grave. Pass: Parallel speculative sampling. arXiv preprint 1xXx::3311.1358 2023.
Reiner Pope, Sholto Douglas, Aakanksha Chowdhery, Jacob Devlin, James Bradbury, Jonathan Heek, Kefan Xiao, Shivani Agrawal, and Jeff Dean. Efficiently scaling trans- former inference. Proceedings of Machine Learning and Systems, 5, 2023.
Ranajoy Sadhukhan, Jian Chen, Zhuoming Chen, Vashisth Tiwari, Ruihang Lai, Jinyuan Shi, Ian En-Hsu Yen, Avner May, Tianqi Chen, and Beidi Chen. Magicdec: Breaking the lttency-thooughput tradeoff for long context generation with speculative decoding. In The Thirteenth International Conference on Learning Representations, 2025. URL https: //openreview. hwt.wwwwwweeeee...eee hott:forummidd-222/azzit
Andrea Santilli, Silvio Severino, Emilian Postolache, Valentino Maiorca, Michele Man- cusi, Riccardo Marin, and Emanuele Rodola. Accelerating transformer inference for translation via parallel decoding. In Anna Rogers, Jordan Boyd-Graber, and Naoaki Okazaki (eds.), Proceedings of the 61st Annual Meeting of the Association for Compulational
12

---

Published as a conference paper at COLM 2025
Linguistics (Volume 1: Long Papers), Pp. 12336-12355, Toronto, Canada, July 2023. As- sociation for Computational Linguistics. doi: 1018663/11/2023ac-longg 22l.o/2222.....oo....9.... URL https: happs://aclaan http://acaaannoooooorrrg////////
acl- 1an.llon..6680 689.
Benjamin Frederick Spector and Christopher Re. Accelerating LLM inference with staged speculative decoding. In Workshop on Efficient Systems for Foundation Models @ ICML2023, 2023. URL https: / http///pppeeeeeeeeeeeeeeeeeeeeee werriiiwwee//ffee seet/forrmmidddkke 3VYjLK.
Mitchell Stern, Noam Shazeer, and Jakob Uszkoreit. Blockwise parallel decoding for deep autoregressive models. Advances in Neural Information Processing Systems, 31, 2018.
Qidong Su, Christina Giannoula, and Gennady Pekhimenko. The synergy of speculative decoding and batching in serving large language models. ar Xio preprint ar Xio::310018811, 2023.
Hanshi Sun, Zhuoming Chen, Xinyu Yang, Yuandong Tian, and Beidi Chen. Triforce: Lossless acceleration of long sequence generation with hierarchical speculative decoding. Xiv preprint ar Xixi::2404.1 11912, 2024a.
Ziteng Sun, Ananda Theertha Suresh, Jae Hun Ro, Ahmad Beirami, Himanshu Jain, and Felix Yu. Spectr: Fast speculative decoding via optimal transport. Advances in Neural Information Processing Systems, 36, 2024b.
Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. Stanford alpaca: An Instruction-following Ilama model. https://gi ttte:///ggghgbbooo///asaa//a///a
alpaca, 2023.
Gemini Team, Rohan Anil, Sebastian Borgeaud, Yonghui Wu, lean-Baptiste Alayrac, Jiahui Yu, Radu Soricut, Johan Schalkwyk, Andrew M Dai, Anja Hauth, et al. Gemini: a family of highly capable multimodal models. Xiv preprint ar arXiv:2312.11805, 2023.
Gemma Team, Thomas Mesnard, Cassidy Hardin, Robert Dadashi, Surya Bhupatiraju, Shreya Pathak, Laurent Sifre, Morgane Rivière, Mihir Sanjay Kale, Juliette Love, et al. Gemma: Open models based on gemini research and technology. arXio preprint D1Xi::2433.08295, 2024a.
Gemma Team, Morgane Riviere, Shreya Pathak, Pier Giuseppe Sessa, Cassidy Hardin, Surya Bhupatiraju, Léonard Hussenot, Thomas Mesnard, Bobak Shahriari, Alexandre Ramé, et al. Gemma 2: Improving open language models at a practical size. arXiv preprint ar arXiv:2408.00118, 2024b.
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and efficient foundation language models. arXiv preprint 13777,130.. 2023a.
Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. ar arXiv preprint arXiv:2307 .09288, 2023b.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural informa- tion processing systems, 30, 2017.
Yizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu, Noah A. Smith, Daniel Khashabi, and Hannaneh Hajishirzi. Self-instruct: Aligning language models with self-generated instructions. In Anna Rogers, Jordan Boyd-Graber, and Naoaki Okazaki (eds.), Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 13484-13508, Toronto, Canada, July 2023. Association for Computational Linguistics. doi: 10.18653 11l/222..cll-ong.g... 754. URL https: httpa/aaaaaanaayaaaa/aaoo org/2023. acl acl-long. 754.
13

---

Published as a conference paper at COLM 2025
Heming Xia, Zhe Yang, Qingxiu Dong, Peiyi Wang, Yongqi Li, Tao Ge, Tianyu Liu, Wenjie Li, and Zhifang Sui. Unlocking efficiency in large language model inference: A compre- hensive survey of speculative decoding. arXiv preprint ar arXiv:2401.07851, 2024.
Daliang Xu, Wangsong Yin, Xin Jin, Ying Zhang, Shiyun Wei, Mengwei Xu, and Xuanzhe Liu. Llmcad: Fast and scalable on-device large language model inference. ar preprint arXiv:2309.044 04255,, 2023.
Nan Yang, Tao Ge, Liang Wang, Binxing Jiao, Daxin Jiang, Linjun Yang, Rangan Majumder, and Furu Wei. Inference with reference: Lossless acceleration of large language models. arxiv preprint Xxto:2304.04487, 2023a.
Sen Yang, Shujian Huang, Xinyu Dai, and Jiajun Chen. Multi-candidate speculative decod- ing. XrXiv preprint ar arXio:2401.06706, 2024.
Seongjun Yang, Gibbeum Lee, Jaewoong Cho, Dimitris Paapalliopoulos and Kangwook Lee. Predictive pipelined decoding: A compute-latency trade-off for exact Ilm decoding, ar preprint Xiv:2330 005900, 2023b.
Aonan Zhang, Chong Wang, Yi Wang, Xuanyu Zhang, and Yunfei Cheng. Recurrent drafter for fast speculative decoding in large language models. arXiv preprint ar XrXo::240.00919, 2024.
Weilin Zhao, Yuxiang Huang, Xu Han, Chaojun Xiao, Zhiyuan Liu, and Maosong Sun. Ouroboros: Speculative decoding with large model enhanced drafting. arXiv preprint arXio:2402.13720, 2024.
Shuzhang Zhong, Zebin Yang, Meng Li, Ruihao Gong, Runsheng Wang, and Ru Huang, Propd: Dynamic token tree pruning and generation for 1lm parallel decoding. arXiv preprint ar Xix:2402.11385, 2024.
Yongchao Zhou, Kaifeng Lyu, Ankit Singh Rawat, Aditya Krishna Menon, Afshin Ros- tamizadeh, Sanjiv Kumar,
Kagy, and Rishabh Agarwal. Distillspec: Improv- ing speculative decoding via knowledge distillation. In The Twelfth International Conference on Learning Representations, 2024. URL https: /opp///vee/eeeeeee/eeeee/ee net//forumiidrrry-1332222
14

---

Published as a conference paper at COLM 2025
A Limitations
Our theoretical result contains a problem-specific constant A which is hard to analyze theoretically or estimate empirically. Nevertheless, the choice of the stopping threshold h can be determined through hyperparameter search; see Appendix D.3. As is the case with all speculative decoding algorithms, our method relies on the implicit assumption that the draft model and the target model align well. For a weak draft model, the acceptance prediction head may perform badly.
B Additional Related Work
Large language models mostly based Transformer architectures (Vaswaní et al., 2017) that auto-regressively predict the probability of the next token given its predecessors. One bottleneck of the inference speed lies in the fact that auto-regressive decoding is an inherently con-paallllliable sequential operation: the probabilities of future tokens depend the current token and there is no trivial way to skip the current token when predicting future tokens. Therrefore the inference time of auto-regressive decoding scales linearly with the number of the generated tokens.
However, the time of a forward pass to compute the log probabilities of the tokens through transformers is nearly constant for batched sequences with different lengths within proper range, thanks to the increasingly powerful parallel computing units (Pope et al., 2023; Vaswani al., 2017; Chen et al., 2023a; Leviathan al., 2023).
Therefore, to overcome the bottleneck of the auto-regressive decoding, one can find fast way to generate K tokens, which often increases FLOPs, and the ask the target model to verify and correct the candidates (Stern et al., 2018; Chen et al., 2023a; Leviathan et al., 2023); see comprehensive survey (Xia et al., 2024). For those methods to work, we assume that we have enough computational resources (e.g. CUDA memories) to support the increased concurrency. Nevertheless, in the long-context generation regime, the memory issue becomes prominent, which requires additional KV-cache management techniques such as compression or retrieval (Li et al., 2024a; Sun et al., 2024a).
Improvements of Speculative Decoding Methods
The performance of speculative decoding depends on how well the draft model aligns with the target model, and how fast the draft model is compared to the target model. People have been improving speculative decoding in two aspects: (1) making the draft model align better with the target model via distillation (Zhou et al., 2024; Agarwal et al., 2024) and online learning (Liu et al., 2023); and (2) making the token generation faster and cheaper, e.g. training multiple smaller draft models from stratch (Miao et al., 2023).
In addition, the candidate tokens can be generated without a separate draft model (Stern et al., 2018; Li et al., 2024b; Du et al., 2024; Bhendawade al., 2024), such as building additional modules that predict the next k tokens (Medusa heads (Cai et al., 2024), RNN heads (Zhang et al., 2024), soft tokens (Monea al., 2023)), early-exiting methods that reuse the intermediate representations of the target model (Liu et al., 2024; Yang et al., 2023b; Bae et al., 2023), and retrieval-based methods that involve constructing an n-gram datastore and using retrieval to generate candidates (He et al., 2023; Zhao et al., 2024; Yang et al., 2023a; Fu et al., 2024).
Those techniques can be combined, resulting in heirachical system (Spector & Re, 2023; Zhao et al., 2024; Sun et al., 2024a).
Token Tree Generation, Verification and Pruning.
Paralleling across the batch dimension via token trees is another direction to increase throughputs (Miao et al., 2023; Xu et al., 2023; Su et al., 2023). For greedy decoding, token tree generation and verification are studied (Cai et al., 2024). For the stochastic sampling setting, REST (He et al., 2023) proposes a straightforward approach: keeping the token paths that coincide with the stochastic tokens given by the target model. There are also researches extending the stochastic speculative decoding to the token tree setting, which often needs to
15

---

Published as a conference paper at COLM 2025
adjust the drafting and verification probabilities to ensure unbiasedness, e.g. MCSD (Yang et al., 2024), Recursive SD (Jeon et al., 2024), Sequoia (Chen et al., 2024), EAGLE (Li et al., 2024b), SpecTR (Sun et al., 2024b).
One important problem to study is how to construct and prune the token tree to maximize throughputs and avoid heavy communication overheads, which is studied in (Chen et al., 2024; Zhong et al., 2024). Our work can serve as a starting point towards the problem, as the candidate length K can be viewed as the depth of a token tree with only one branch.
Diffusion language models. Diffusion language models either in the discrete space (see D3PM (Austin et al., 2021) and its follow-ups) in the embedding space (see Diffusion- LM (Li et al., 2022) and its follow-ups) are non-autoregreesive language models, whose generation time can scale sub-linearly with the sequence length. BERT-type encoder-only models and auto-regressive decoder-only models can be also viewed diffusion model, with mask prediction and next-token prediction being the denoising operation (Austin et al., 2021). Viewing next-token prediction as Jacobi iteration (Santilli et al., 2023) and denoising operation is a powerful idea and it leads to subsequent work such as lookahead decoding (Fu et al., 2024) and consistency LLMs (Kou et al., 2024).
B.1 Discussion: Sub-optimality of Heuristic Methods
In this section, we discuss the potential sub-optimality of several training-free heuristic methods for determining the candidate lengths. For example, it may be tempting to use the entropy of the draft model H((((- xprefix .,, Y;-1)) merely the likelihood of the sampled draft candidate token g(Y; xprefix probability, and choose to stop the current round of speculation when these indicators fall under a threshold. However, we point out that this type of training-free heuristics confuses the inherent uncertainty of the draft distribution with the alignment between draft and target distributions, which is fundamentally flawed.
Yi) as a surrogate for the acceptance
First of all, the theoretical acceptance probability is min (1, p P
q(Y) "prefix Vi...Y. which de-
pends on the target distribution p. Therefore, heuristic methods that do not incorporate the information of the target model will be sub-optimal.
Furthermore, when the draft model and the target model align well, the acceptance prob- ability will be high regardless of the entropy of the current draft candidate token or the likelihood of the sampled Y, For the extreme case when the draft model and the target model aligns perfectly well i.e, p(Yi YI,...,, Yi-1) = q(Yi Y,,..., Y;-1), by the rejection sampling scheme of speculative decoding, the sampled candidate tokens are guaranteed to be accepted, and the optimal candidate lengths will be infinite. Using either entropy-based methods or saalihood-basee methods will stop the speculation earlier and results in sub-optimal performance.
C Additional Background on Speculative Decoding Algorithm
Rejection Sampling. The algorithmic foundation of the Speculative Decoding algorithm lies in rejection
Specifically, if we want to sample from target discrete distribution p(x), we first sample from a draft distribution (x)). We accept the sample x with prob-
ability min p(x) ); otherwise we replace with a sample from the modified distribution q(x)
Norm((p +) where 2+ = max(z,0) the positive part of z and Norm Σn fxx
f())
normalizes function f to make it proper probability distribution. The proof of the unbiasedness of rejection sampling can be found in Chen et al. (2023a).
Speculative Decoding. Speculative decoding extends to the auto-regressive generation scenarios by chaining K rejection sampling procedures together. The full algorithm is provided in Algorithm 2.
16

---

Published as a conference paper at COLM 2025
Algorithm 2 Speculative Decoding (Chen et al., 2023a; Leviathan et al., 2023)
Require: draft model target model p, prefix xprefix number of candidate tokens K.
for to do
Compute qi = q( xprefix/ ........1)).......
Sample y/ ~ 9:-
end for
Compute in parallel p; = p(- xprefix/ y1,, .........yy....1..... 1/--1) for 1,...,,+1 Sample TK with r; ~ Unif(0, 11, 1,....
Compute the number of accepted tokens n min if < then
((V))\/(())KK))
Sample y from the modified distribution Norm (pm+1 9
else
Sample y' from PK+1
end if
Return Xprefix V1..... Yn, y
D Additional Experimental Results
D.1 Experimental Setups
The subsection continues Section 5.1.
Datasets. We adopt three datasets in our experiments: (1) Alpaca (Taori et al., 2023), an instruction-folloiing dataset generated using Self-Instruct (Wang et al., 2023) from OpenAl's text-davinci-O6 -003 model; (2) HumanEval (Chen et al., 2021), a test dataset containing Python code synthesis problems; and (3) GSM8K (Cobbe et al., 2021), a dataset of high- school math problems. We only use prompts of the datasets and do not use responses.
Dataset splits. We split the Alpaca dataset into train/ dev /test splits, containing 40k, 10k, 2k prompts, respectively. We use train split to train the prediction heads and evaluate them on the dev split. We benchmark the performance of SpecDectt on the test split. For HumanEval and GSM8K, we only them for benchmarking the out-of-distribution (OOD) performance of SpecDec++, For each test dataset, we subsample 150 examples for benchmarking the performances.
Mixing probability. As in Section 4.4, we mix the response tokens from the generations from the target model and the predicted next-tokens from the draft model. We set an aggressive value 1% = 15% so only 15% of the tokens are from the target model, as we find empirically that the draft model and the target model often align well. Setting smaller increases the training efficiency as more supervision signals are used.
Training Details. We train all the acceptance prediction heads on the train split of the Alpaca dataset for 3 epochs with batch size 32. We use Adam optimizer and a cosine learning rate schedule with the initial learning rate 5e
Hardware configuration. We use 2 NVIDIA A100 GPUs with 80G memory for the experi- ments. We shard the 70B model across the two devices and communication overhead occurs when inferring with llama-2-chat 70B. When doing speculative decoding, the 7B model is loaded only on one device.
Inference setting. We set the maximal sequence length to be 512. We use temperature = 1 and adopt top-k sampling with k = 50. We do not integrate KV cache management techniques such PagedAAteenti (Kwon et al., 2023) or KV cache pre-allocation.
Experiments Compute Resources. The required compute resources are estimated to be 500 hours on NVIDIA A100-80G GPUs for the training dataset generation, 400 hours 1 NVIDIA A100-80G GPU for training 20 acceptance prediction heads (sweeping D from 0 to 4 and Weyi among 1,3, 6, 12), 500 hours on 2 NVIDIA A A100-80G GPUs for the whole
17

---

Published as a conference paper at COLM 2025
evaluation set. The full research project would require at least 2x the reported compute, there were preliminary experiments that are not in the paper.
D.2 Forward Time Analysis
We report the full results of the linear regression in Section 5.2 in Table 2. We also visualize draft and ttrget across the three settings in Figure 4.
Table 2: The forward time of the draft model (1aama2-chat--7B) and the target model (Ilama- 2-chat-70B) under different settings and different datasets. We perform linear regression to calculate the forward times.
Setting
Dataset
fdraft
ftanget
R 0.9994 0.9998
Alpaca
0.0206
0.108
HumanEval
0.0207
0.107
0.9994 & 0.9998
stand-alone
GSM8K
0.0206
0.109
0.9990 0.9992
average
0.0207 + 0.0001
0.108 + 0.001
Alpaca
0.0232
0.114
0,9983
HumanEval
0.0246
0.111
0.9965
SpecDec
GSM8K
0.0229
0.113
0.9926
average
0.0236 1 0.0007
0.112 0.001
Alpaca
0.0240
0.110
0.9982
HumanEval
0.0229
0.111
0.9880
SpecDec++
GSM8K
0.0225
0.113
0.9925
average
0.0231 E 0.0006
0.111 = 0.001
draft model
target model
0.024
Forwerd Time
0.112
0.022
0.108
0.020
SpecDec
SpecDec**
Stand-alone
SpecDec
SpecDecte
Figure 4: The forward time of the draft model (llama-2-chat-7)) and the target model (0aama--chaat-0BB) under different settings. For each setting, we perform linear regression to calculate the forward times and then average them across different datasets. The additional cost of the acceptance prediction head is negligible compared to the systematic error and the random noise of the environment. Full results are in Table 2.
From Figure 4, we see that the additional cost of the acceptance prediction head is negligible. Besides, in the standalone setting where only the draft model or the target model is used, both draftt and ftaggtt decrease, which indicates that speculative decoding induces minor overhead in forward passes.
After getting ldratt and target, we use Equation (5.1) to calculate the theoretical throughputs (tokens per second), which match the noisier empirical throughputs well with relative error < 6.2% for all prompts.
D.3 Ablation Studies.
We fix Wac = 1 and study how the hyperparameters Wrej, D,h influence the final through- puts (tokens per second). First, we calculate the (unweighted) binary KL divergence between the ground-truid truth probability and the predicted probability, i.e.
KL(pllq) = log a
P. + (1 p)) log 1 1-9
1-p
As KL(p)l4) = BCE(pllg) - H(p), the binary KL divergence is metric for how well the acceptance prediction head fits the ground-truth probabilities. Next, for each acceptance
18

---

Published as a conference paper at COLM 2025
prediction head, report the best throughput by varying the stopping threshold h among {0.1, 0,5, 0.7,0,,, and the corresponding h that achieves the best performance. The results are summarized in Table 3.
From the table, we see that increasing wre increases the unweighted eval KL. Most the prediction heads trained with re = perform the best with = 0.3 under all three datasets, and similarly, most prediction heads trained with rejj 3, 12 perform the best with 0.5, 0.7, respectively. This synergy between Wrej and expected, since increasing Wrej forces the acceptance prediction head to focus more the cases where the candidate token is rejected and thus mitigates the over-confidence issue. In return, the stopping threshold h can be set to a higher value to adjust for the increased predicted probability of existing one rejection.
We bold the throughputs that are above 99% of the maximum throughput of the same dataset. We see that there are two sets of hyperparameters that consistently achieve 99% of the maximum throughputs across the three datasets: Wnj = 6, D = 3 0.7 and rej = 6, D = 4, 0.7.
Table 3: The performance of the acceptance prediction heads with different loss weights Wrj and network depths D. The train/eval KL refers to the binary KL divergence between the ground-truth probability and the predicted probability. For the three datasets, we report the best throughput and the corresponding stopping threshold h. The throughputs are bolded they are above 99% of the maximum throughput of the same dataset.
Wrej
Depth D train/KL KL
eval/KL
Alpaca
HumanEval
GSM8K
0.422
0.412
18.48 (h =0.3)
19.91 (h 0.5)
20.32 (h 0.3)
1
0.409
0.390
18.39 (h = 0.3)
20.29 (h = 0.3)
20.44 (h = 0.3)
1
2
0.391
0.387
18.87 (h 0.3)
20.26 (h 0.3)
20.87 0.3)
1
3
0.387
0.384
18.82 (h 0.3)
20.10 (h = 0.3)
20.86 (h = 0.3)
1
0.384
0.383
18.57 (h 0.3)
20.51 (h 0.3)
20.73 0.3)
3
0
0.515
0.491
18.31 (h 0.5)
20.12 (h = 0.7)
20.36 (h = 0.5)
3
0.479
0.461
18.88 (h 0.5)
20.32 = 0.5)
20.70 0.5)
3
2
0.475
0.458
18.60 (h 0.5)
20.17 (h 0.5)
20.61 (h 0.3)
3
3
0.462
0.454
18.76 (h = 0.5)
20.32 (h = 0.5)
20.88 0.5)
3
4
0.465
0.451
18.88 (h 0.5)
20.50 (h 0.7)
20.82 0.5)
6
0
0.657
0.637
18.67 (h = 0.7)
19.90 (4 = 0.9)
20.24 (h = 0.7)
1
0.620
0.596
18.75 (h 0.7)
20.09
0.9)
20.86 0.7)
6
2
0.607
0.589
18.65 (h 0.7)
20.17 (h 0.9)
20.70 (h 0.7)
3
0.617
0.582
18.80 (h 0.7)
20.47 = 0.7)
20.95 0.7)
6
4
0.603
0.575
18.87 (h 0.7)
20.61 (h 0.7)
20.77 (h 0.7)
12
0
0.922
0.871
18.55 (h = 0.9)
19.93 (h = 0.9)
20.62 (h = 0.9)
12
1
0.830
0.805
18.71 (h 0.9)
20.25 (h 0.9)
20.73 (h 0.9)
12
2
0.834
0.794
18.58 (I 0.9)
20.39 (h 0.9)
20.77 (h 0.7)
12
3
0.801
0.781
18.76 (h 0.9)
20.29 (4 0.9)
20.67 0.9)
12
4
0.799
0.773
18.82 (h 0.9)
20.19 (4 = 0.9)
20.65 (h = 0.9)
D.4
New Experiments on Gemma
We further validate SpecDec++ by repeating all the experiments on a new pair of models: Gemma-1.1-228 (Team et al., 2024a) and Gemma-2-27B-it (Team et al., 2024b). The Pareto frontiers of verification rates versus discard rates are plotted in Figure 5, and the empirical speedup is reported in Table 4. Specifically, see that
SpecDec++ has better Pareto frontiers in terms of discard rates v.s. verification rates tradeoff than the baseline SpecDec algorithm the Alpaca, GSM8K, and HumanEval datasets. The Pareto improvement indicates that SpecDec++ will have better speedups than SpecDec under arbitrary hardware configurations.
19

---

Published as a conference paper at COLM 2025
When deployed on Nvidia A100-80G GPU, SpecDec++ achieves relative 1.4%, 12.4%, and 7.7% improvement over the baseline methods on the Alpaca, HumanEval, and GSMSK datasets, respectively.
Alpaza
HumanEval
GSMBK
3.0
2.0
Spe-Deor+ SpwaDoc
SpocDec
Diwaadd Rale
2.
BpecDec
Discard Rate
1.
Discart Rate
SpecDec
1.
0.5
0.30
0.35
0.45
0.45
0.50 0.55 0.80
0.2
0.5
0.4
025
0.30 0.3
0.40
0.45
Vonficationn Rate
Verfiictionn Rate
Vertication Ritte
Figure 5: The average verification rates Ntarget/ / N and the average discard rates discarded / N for SpecDec with different candidate lengths and SpecDec++ with different acceptance pre- diction heads and stopping thresholds. SpecDec++ has better Pareto frontiers than Spec on both the in-distribution dataset Alpaca and the two out-of-distribution datasets Hu- manEval and GSM8K. The model pair Gemma-1.112B-a. Gemma---27B-it.
Table 4: The speedup achieved by SpecDec++ compared to the best speedup achieved by the speculative decoding baseline Alpaca, HumanEval, and GSM8K datasets. The model pair is Gemma-1.1 1.1-2B-it/ 1--2-it//Gemm-22--- Gemmma--27B-ii..
Dataset
Alpaca
HumanEval
GSM8K
SpecDec++
1.35x
2.07x
1.58x
SpecDec (baseline)
1.33x
1.84x
1.47x
relative improvement
+1.4%
+12.4%
+7.7%
We observe fewer improvements on the Alpaca dataset and the GSM8K dataset compared to the llama-2-7b-chat/IIn chatt/llma---70b-chh model pair. This phenomenon may be caused by weaker alignment between the draft Gemma model and the target Gemma model. On Alpaca, the baseline SpecDec achieves 1.33x speedup for the Gemma model pair but achieves 1.90x speedup for the Llama model pair; on GSM8K, the baseline Spec achieves 1.47x speedup for the Gemma model pair but it achieves 2.07x speedup for the Llama model pair. We see our chosen Gemma model pair performs worse than the Llama model pair, although the model size ratios are roughly the same for the two model families (27B/2B v.s. 70B/7B).
We suspect that for the Gemma-1.1-2BB and Gemma-2-278B model pair on the Alpaca dataset, our acceptance prediction head ends up suggesting an approximately fixed draft length, therefore only achieving a small improvement over the baseline. For settings like math (GSM8K) and coding (HumanEval), the generation involves mixture of tokens of verbal reasoning and tokens of math calculation code writing, which naturally require an adaptive draft length.
In summary, although the specific numbers of the improvement vary across different model pairs and different prompt settings, the proposed SpecDec++ indeed achieves an adequate amount of improvements over the baseline. Backed by the theoretical results, our proposed method a principled extension of the SpecDec method, and adaptively determining the draft length naturally includes the baseline (a fixed draft length) as a special case.
20

---

Published as a conference paper at COLM 2025
E Theoretical Analysis
In the section, we present the proof of Theorem 4.3.
For any time-homogeneous policy π, define random variable (s) the total cost-to-go from the current state = (Xprefix (YI...,,yy) when taking action a.
M E ((, with $1 = 5, 01
(s,
where the next state S;41 given as) follows the stochastic transition of the MDP, a; = rs(s) for i 2, and M is a random variable of the number of total steps. We make the assumption that π has an upper bound for the number of candidate tokens, so we exclude the cases where the policy π potentially leads to an infinite loop and hence M co. Let (T((s) = (s (s)).
proof of Theorem 4.3. We analyze the difference C* C"(s, continue)- - C (s, stop) for three cases.
Case 1. 1 {E1 s < k + such that Y, is rejected).
Let xprefix be the next prefix given by the speculative decoding algorithm, where the first rejected token among (Y,,.., Yx+1) replaced by the token from the modified distribution. We know that
C (s, c1 c2 + C* (A Ø)).
If we choose to continue at the current step, we know that no matter how many additional steps we continue to generate draft tokens, we will eventually discard them and get the same new prefix preffx Let N continue (s) be the total number of extra continue's induced by the policy given the current state and action continue. We have
C (s, continue) = c1 + C1 (1 + N continue (s)) + + + C CTT Ø)).
In summary, we have
(s - C stop) 2 C1, conditioned on E,.
Case 2. Es (V1 si k is accepted, Yx42 is rejected).
we stop the current round of speculation, then all the candidate tokens (Y,,..., Yx 1) will be accepted and an additional X4 is sampled from p(. Xprefix .y...., 11))).
C (s, stop) c2 + C (((xpretix Yi...., Yk (212),
Again, if we choose to cont inue at the current step, as Y2+2 is rejected, future generated tokens beyond Y2+2 will also be discarded. After the verification, Yx+2 will be replaced by W ~ Norm (p(-Ixiprefxx/ Y1 .,, 1) - q(- p Y1 ...., Y++1) +. Let Nonttnue (s) be the total number of extra continue's induced by the policy ı given the current state and action continue. We have
C" (s, continue) = Ci (1 + N (s)) + 02 + C (((Xprefix Yi...., YK41, (++2),0))
Denote A C" (((xrreixx Y,...,, YK41, X1+2), Cd (((xpreixx Yr..., Ye4s, Wx+2), Ø)). In summary, we have
C (s,conniiue -
2 C1 A,, conditioned on Eg.
Case E3 (V1 <is kisk+22 + Y; is accepted].
Similar to Case 2, if we stop the current round of speculation, then all the candidate
tokens (Yi,..,, 11) will be accepted, and an additional X sampled from p(:
Xprefix, Yg...,, 1)-
C (s, c2 + ((((((rreixx Yy..., YK-1, Xx+2), 21))
21

---

Published as a conference paper at COLM 2025
If we choose to continue at the current step, there is no immediate cost at the current step and we transit to (Xprefix (Y,,..., x++1)).
C" (s, continue) C" ((xprefix/ (Yi,..., Yx+1)))-
Denote A2 Ca (( II....,
x Xx+2), Ø)) - C ((Xperxf (Y Yx+1))). We have
(s, continue)
2 - 22, conditioned on Eg.
Summary. At the current state, the values of (Y,,... Yx) are known. We calculate the conditional expectation of C= continue) (s, stop) given the current observation. For simplicity of notation, we do not explicitly write out the condition on (Yi...., YR).
E|C" continue) C* stop)]
21(()) P(E2) E[A1 &2]) + + E| &g]).
When the right-hand side of the above inequality is larger than zero, the expected total cost of continus is larger than the expected cost of stop. Therefore, we obtain sufficient condition to stop at the current step.
To continue the analysis, we assume that we have an almost-sure upper bound A on | Eg] and E E[Az| Ez]:
E[AI &g] S A a.s. and E(A2 &g] S A a.s..
A naive bound for A is the upper bound of C, e.g. max Naaget Itargtt max Naraft drafft- We assume that both the maximum generated tokens and the numbers of candidate tokens per round have upper limit, the upper bound is finite.
Then
P(E) + P(E)( E/A P(E) E[A2 &g)) 2 0 P(E))2+ E3] P({))AA &g]
+()))+P(EE)))) P(G))2++(()))
P(E)) 2 - +
+
+ P(E)) + +
Finally, we note that
P(ε) [31 < k+ 1, such that Y; is rejected Yi...., Yyl
2 3 < i < k, such that Y; is rejected Yı...., Ygl,
which concludes the proof.
22


Reviews:
[{"review_id": "8BJu6g7HHg", "reviewer": "Reviewer_jQ11", "summary": "This paper introduces ​SpecDec++​, an enhanced speculative decoding algorithm designed to improve the efficiency of LLMs by adaptively determining the candidate length for each round of decoding. The authors formulate the problem of choosing length $K$ as a ​Markov Decision Process and theoretically demonstrate that the optimal policy is a threshold policy. This means speculation should stop when the probability of rejecting at least one token exceeds a certain threshold. Based on this theory, SpecDec++ dynamically adjusts K during inference by training an acceptance prediction head on the draft model to estimate the probability of token acceptance. The proposed method is shown to be effective across different datasets and can be integrated with other speculative decoding improvements, making it a viable and powerful tool for accelerating LLM inference.", "questions": "", "limitations": "", "rating": 8, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "1. The proposed method is well-motivated, and the authors have theoretically proven its superiority.\n2. The method proposed in the paper is practical and can be well integrated into existing chain-based SpecDec methods, showing great application potential.\n3. The paper validates the effectiveness of the method on multiple datasets and demonstrates a stable improvement in acceleration compared to the SpecDec baseline.\n4. The paper is clearly written and easy to follow.", "reasons_to_reject": "In terms of comparison experimental study, the paper lacks comparisons with other speculative decoding paradigms and methods (like medusa, eagle, sequoia, DySpec, or any comparable methods). Additionally, the experimental setup is relatively simple and does not explore the acceleration of target models and draft models of different scales.", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "ngMVlUCsXI", "reviewer": "Reviewer_3xMF", "summary": "This paper presents SpecDec++, a method for dynamically determining draft length in speculative decoding. The problem of determining the draft length is cast as a Markov decision process, where the action space consists of whether to generate another draft token or halt and verify the current draft, and the state space consists of all possible drafted contexts. Under this framing, minimizing the expected decoding time amounts to halting once the probability that any one of the drafted tokens is rejected falls below a threshold (which depends on the latency of the draft and target models). SpecDec++ trains an acceptance prediction head, and uses the above halting criterion based on the predicted acceptance probability to adjust draft length. Some exploration went into training The prediction head is trained with a class-weighted binary cross-entropy loss and a sample of target tokens are replaced with draft tokens. Dynamically adjusting the draft length is shown to increase throughput relative to vanilla speculative sampling on three datasets.\n\nI appreciated the paper's clear framing of the draft length prediction problem. My main concern is the lack of baselines that update the draft length dynamically.", "questions": "", "limitations": "", "rating": 5, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "The main contribution of this work is in framing the draft length prediction problem as a Markov decision process and analytically solving for the halting threshold. I found the writing to be very clear, although more space is spent describing the mechanics of speculative decoding than is probably necessary.", "reasons_to_reject": "The experiments are light, with only vanilla speculative sampling considered as a baseline. This paper makes no claim as to how this proposed method compares empirically to other methods for dynamically adjusting the draft length [1]. Although there is a discussion in Appendix B about why heuristics such as token-level draft distribution statistics are not appropriate, these methods are never evaluated.\n\n[1] Mamou, Jonathan, et al. \"Dynamic speculation lookahead accelerates speculative decoding of large language models.\" arXiv preprint arXiv:2405.04304 (2024).", "questions_to_authors": "- line 111: \"...including block __paralleling__ sampling...\"\n- line 130: \"...we first __generates__ $K$ candidate tokens...\"\n- Appendix D.3 varies the weight on the rejection class, $w_{rej}$, but does not touch $w_{acc}$. Was $w_{acc}$ tuned, or was it fixed to 1 in experiments?\n- How important was tuning $w_{rej}$, $w_{acc}$, and $r$ to achieve acceptance prediction performance above baseline speculative sampling?", "extra_scores": {}}, {"review_id": "zAwbHdqLzh", "reviewer": "Reviewer_HC5A", "summary": "The paper proposes an approach to dynamically adjust the draft length in speculative decoding. This allows for avoidance of unnecessary calls to the large model on tokens that will be rejected. To achieve this, the paper proposes an MDP for determining whether the next token in the drafter is likely to be accepted. This is instantiated via a simple binary classification head on top of the drafter’s outputs. Experiments show this approach can speed up speculative decoding by 5-10%.", "questions": "", "limitations": "", "rating": 7, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "- Logical method, with a nice combination of formal grounding and empirical results.\n- Very well written, likely useful for future work to build upon.", "reasons_to_reject": "- Missing comparison to baseline adaptive draft length using confidence of small model (e.g., per BiLD).\n- Experiments on more datasets would (as ever) be welcome.", "questions_to_authors": "- Empirically, how well does the proposed approach compare to using confidence of small model?\n\n- Fundamentally, the learnability of Equation 4.1 depends on how well we can predict the relative likelihood of the large model given information from the small model. Comment about the viability of this task might be useful. One might also imagine leveraging information from the larger model on previously rejected tokens, e.g., per\n\nAishwarya PS, “Tandem Transformers for Inference Efficient LLMs”, ICML 2024\n\n- “take constant time, which is true when we have enough computational resources to” → constant in what? What kind of computational resources – compute or memory?\n\n- “In the typical setting of speculative decoding where the draft model and the target model align reasonably well” → what does “align” mean here? Why is this the typical setting? See also Appendix D.4.\n\n- Algorithm 1, what is the end index of the for loop?\n\n- Similar ideas may have been considered in contemporaneous work:\n\nZhong et al., “Speeding up Speculative Decoding via Approximate Verification”, arXiV 2025", "extra_scores": {}}]

Author rebuttal:

Meta-review: Reviewers do not find the ideas to deviate significantly from other contemporaneous work on speculative decoding but state to be mostly on the positive side due to good execution with both positive experimental results and theoretical analysis of the work. Although similar ideas on using a second model to accelerate a more expensive one are being explored by different teams there is still not a principled way to accomplish this and this paper might contribute on this recent body of knowledge. However one reviewer notes during rebuttal discussions that some comparisons to other work based on heuristics could have been incorporated. The AC is still overall leaning positive.
Decision: Accept