DySpec: Faster Speculative Decoding with Dynamic Token Tree Structure

## Abstract

Abstract While speculative decoding has recently appeared as a promising direction for accelerating the inference of large language models (LLMs), the speedup and scalability are strongly bounded by the token acceptance rate.
Prevalent methods usually organize predicted tokens as independent chains or fixed token trees, which fails to generalize to diverse query distributions.
In this paper, we propose DySpec , a faster speculative decoding algorithm with a novel dynamic token tree structure.
We begin by bridging the draft distribution and acceptance rate from intuitive and empirical clues, and successfully show that the two variables are strongly correlated. Based on this, we employ a greedy strategy to dynamically expand the token tree at run time. Theoretically, we show that our method can achieve optimal results under mild assumptions. Empirically, DySpec yields a higher acceptance rate and speedup than fixed trees. DySpec can drastically improve the throughput and reduce the latency of token generation across various data distribution and model sizes, which significantly outperforms strong competitors, including Specinfer and Sequoia. Under low temperature setting, DySpec can improve the throughput up to 9.1 × \times × and reduce the latency up to 9.4 × \times × on Llama2-70B. Under high temperature setting, DySpec can also improve the throughput up to 6.21 × \times × , despite the increasing difficulty of speculating more than one token per step for draft model.

## 1 Introduction

Recent years have witnessed the prosperity of large language models (LLMs), shown by their unprecedented capabilities in understanding and generating human languages in various domains and tasks (OpenAI, ; Anthropic, ).
Despite this rapid progress, the major bottleneck in the real-world deployment of LLMs stems from their inference latency, due to the nature of auto-regressive decoding. Generating $n$ tokens requires $n$ sequential runs, making the process time-consuming and leading to under-utilizing available computation resources.

To address this challenge, recent works (Chen et al., ; Leviathan et al., ) have proposed speculative decoding to accelerate the inference. Speculative decoding first leverages a draft model to sample a bunch of tokens as candidates, which are later verified in parallel by the target model. If the verification of a token fails, its succeeding tokens must all be rejected to ensure output distribution is unbiased. Therefore, the performance of speculative decoding is strongly bounded by the acceptance rate of predicted tokens.

Figure: (a) Chain.
Refer to caption: extracted/5913908/figures/structure-2.png

To this end, several methods have explored tree structures to enhance the acceptance rate, as illustrated in Figure 1. For instance,
Sun et al. () developed SpecTr, introducing DraftSelection algorithm to make draft model select multiple candidates while maintaining the same output distribution as the target model.
Miao et al. () created SpecInfer, which constructs token trees using small speculative models with learnable branch numbers of each layer. Similarly, Cai et al. () proposed Medusa, which bases token tree construction directly on draft model probabilities, optimizing efficiency when the draft model closely approximates the target model. Meanwhile, Chen et al. () introduced Sequoia, which estimates acceptance rates for candidate tokens and uses dynamic programming to optimize the token tree based on the estimated metric.
However, a common limitation of these methods is their reliance on fixed patterns of tree construction, which can lead to suboptimal performance across diverse query distributions, resulting in a relatively low acceptance rate as tree size grows. This raises an important research question:

RQ 1: How can we find a near-optimal token tree structure for speculative decoding?
To answer the research question, we will first establish the connection between acceptance rate and draft distribution through the following hypothesis.

###### Hypothesis 1 .

Predicted tokens of higher draft probability statistically have a higher acceptance rate.

Fortunately, this is further validated by our preliminary studies, as demonstrated in Figure 2.
With the observation,
we propose DySpec to dynamically expand the token tree based on draft distribution.
DySpec employs a greedy search strategy to maximize the expected length of the predicted sequences. Compared with its fixed counterpart, the dynamic token tree yields a higher acceptance rate and speedup.
We conduct benchmarking experiments on various datasets and different model scales, the experimental results demonstrate our proposed DySpec can efficiently improve the inference performance. Specifically, on the Llama2-70B model, DySpec achieves a 9.1$\times$ throughput improvement and 9.4$\times$ reduction in latency.

###### Hypothesis 1 .

## 2 Preliminary

#### Speculative Decoding.

Chen et al. () and Leviathan et al. () proposed speculative decoding as a means to accelerate auto-regressive decoding. This approach samples generations from an efficient draft model as speculative prefixes and verifies these tokens in parallel using a slower target model. Through rejection sampling, it ensures that the outputs have the same distribution as those from the target model alone.

We denote the distribution of the draft model as $D[\cdot]$(^1^11We use $D[\cdot]$ as an abbreviation of conditional probability $D(x_{t}|x_{<t})$, and similarly for $T[\cdot]$.), and the target distribution as $T[\cdot]$. In speculative decoding, a token $x$ sampled from $D$ is accepted with a probability of $\min(1,\frac{T[x]}{D[x]})$. In case of rejection, another token $y$ will be sampled from a residual distribution $\texttt{norm}(\texttt{relu}(T-D))$ to adjust the output aligned with the target distribution.

#### Tree Attention.

Transformer (Vaswani et al., ) models use the attention mechanism to aggregate sequential information. In implementation, the auto-regressive model uses an upper triangle mask to preserve causality. In the context of tree-based dependency, Liu et al. () first proposed tree attention to represent the hierarchy as:

$$ $\texttt{mask}(A)_{i,j}=\left\{\begin{array}[]{ll}1&,\ \ i\texttt{ is ancestor of }j,\\ 0&,\texttt{ otherwise.}\\ \end{array}\right.$ $$

In speculative decoding, tree attention has later been adopted by SpecInfer (Miao et al., ) and Medusa (Cai et al., ) for parallel verification.

## 3 Bridging Draft Distribution with Acceptance Rate

Figure: Figure 2: Connection between acceptance rate/target distribution and draft distribution on CNN DailyMail.The density of each block is normalized by column.
Refer to caption: extracted/5913908/figures/heatmap2.png

During verification, the acceptance probability of sampled token $x$ is given by $\min(1,\frac{T[x]}{D[x]})$. We now derive the connection between draft distribution and acceptance rate as follows.

Since the draft distribution acts as the approximation of the target distribution, the two distributions should not be too ”far” away. Without loss of generality, we assume that the KL divergence of $D$ from $T$ is constrained by constant $c$, i.e.,

$$ $D_{\mathrm{KL}}(D\parallel T)=\sum D[x]\log\frac{D[x]}{T[x]}\leq c.$ (1) $$

To satisfy the constraint, $T[\cdot]$ should not diverge much from $D[\cdot]$.
Nevertheless, for a token $x$ with large draft probability $D[x]$, $\frac{T[x]}{D[x]}$ cannot be too small, as it would contribute significantly to $D_{\mathrm{KL}}$. On the other hand, tokens with small $D[x]$ have less impact to $D_{\mathrm{KL}}$, allowing for greater variation.
The above analysis implies that predicted tokens of higher draft probability statistically have a higher target probability and acceptance rate.

We further validate our hypothesis through preliminary experiments.
As shown in Figure 2 (right), the draft distribution shows a strong correlation with the target distribution in real-world scenarios.
More importantly, Figure 2 (left) demonstrates that the distributions of acceptance rate, under the same draft probability, resemble binomial distributions. As draft probability grows larger, predicted tokens are more likely to be accepted. These observations provide strong empirical support for our previous claim.
It also inspires us to design a dynamic token tree construction algorithm to explore more on sub-trees of higher draft probability, since they are more likely to be accepted in later verification.

## 4 Method

Under a fixed speculative budget $b$ (i.e. the number of tokens for each verification), the optimal token tree yields the highest acceptance rate. In practice, finding the optimal tree is unfeasible, since the target distribution is unknown before verification. Nevertheless, given Hypothesis 1, we can transform the original problem into the following problems.

### 4.1 Dynamic Token Tree Construction

Given the speculative token tree, the way we sampling this tree, the draft model output distribution, and correspond target model output distribution, we can get the expectation of the total number of Speculative decoding verification. Considering each node $t_{i}$ in speculative token tree independently, we denote its draft distribution as $p_{d}[i,\cdot]$, and the relevant target distribution as $p_{t}[i,\cdot]$.

Assume that node $t_{i}$ have ancestors $a_{1},...,a_{i}$, and previous sibling node $s_{1},...,s_{j}$, then the probability we verify the node $t_{i}$ can be represent as $\prod_{i}P[accepta_{i}]\times\prod_{j}P[rejects_{j}]$.

In Speculative Decoding, the probability we accept token $x$ with draft probability $p_{d}[x]$ and target probability $p_{t}[x]$, is $\min(1,\frac{p_{t}[x]}{p_{d}[x]})$, denote as $SD[x]$.
So the probability we take verification on node $t_{i}$ is $\prod_{i}SD[a_{i}]\times\prod_{j}(1-SD[s_{j}])$. Then the contribution of node $t_{i}$ to expectation of total accepted token number is $\prod_{i}SD[a_{i}]\times\prod_{j}(1-SD[s_{j}])\times SD[t_{i}]$.

The total expectation of accepted token number of this speculative token tree is

$$ $\sum_{u}\prod_{i}SD[a_{i,t_{u}}]\times\prod_{j}(1-SD[s_{j,t_{u}}])\times SD[t_ {u}]$ (2) $$

With expected acceptance rate, we can construct the optimal speculative token tree. However, there are still two problems:

- 1.
When we generate speculative token tree, we cannot know the target probability to get $SD[\cdot]$.
- 2.
The draft token $t_{i}$ is sampled from draft output distribution, we could only decide how many sampling we take, instead of which token to take. Otherwise the take action we made will infect the probability we keep tokens in speculative token tree.

To solve problem 1, we note that the acceptance rate is positive-related to draft output distribution. Given Hypothesis 1, we use draft model output distribution to estimate the acceptance rate $SD[t_{i}]\approx p_{d}[t_{i}]$.

To solve problem 2, we only use these estimated values to decide if we will make the sampling. For given intermediate token tree status, we can detect all expandable tree nodes, and pick the expandable tree node with maximum estimated value. Repeat this action until we reach the max tree size, DySpec will generate the optimal speculative token tree. The proof of optimality is provided in Appendix D.

Now we can get the algorithm to generate the optimal speculative token tree.

### 4.2 Algorithm

Given the prompt, DySpec can get the logits of the last token, which is the root of the speculative token tree. Suppose we have already constructed a partial speculative token tree as Figure 3. There are two ways to expand a node:

- 1.
Any token without a leaf node can undergo the first sampling.
- 2.
Nodes marked with ”–/–” indicate that we have already performed several samplings at the same position and have obtained an estimated value for the next sampling at this position (on the arrow line). The ”–/–” node corresponds to the result of the next sampling.

We refer to these two types of nodes as expandable nodes in the current state.

Figure: Figure 3: An example of the predicted token tree.
Refer to caption: extracted/5913908/figures/tree_bold.png

DySpec use a heap to maintain all the expandable tokens by their estimated values, that we can get the node with maximum estimated value in $O(logN)$ time. After we make the next sampling represented by the top node of the heap. Upon determining the result of the sampling, we then update the state of the current token tree using the obtained token and its corresponding estimated value. This process generates two new expandable nodes:

- 1.
When the current node is rejected, the next sampling at the same position, with the corresponding estimated value being the probability of this sampling failure multiplied by the expected acceptance rate of the next sampling itself.
- 2.
When the current node is accepted, proceeding with subsequent sampling, with the corresponding estimated value being the probability of this sampling success multiplied by the expected acceptance rate of the next sampling itself.

Thus, we have successfully expanded the token tree by one node. This process is repeated until the predetermined budget is reached. The pseudo-code is presented in Algorithm 1.

Figure: Algorithm 1 Speculative token tree construction algorithm with fixed number

### 4.3 Analyze Overhead

Assume the speculative token tree size is $N$, depth is $D$. Greedy expand method will generate the optimal token tree one by one. For each token, greedy expand method choose the expandable token with maximum estimated valueand then make a sampling to generate the next token, then update the token tree.

To quickly choose the expandable token with maximum estimated value, we can use heap to maintain all expand-able tokens’ estimated value, which introduce $O(logN)$ time complexity to maintain the token tree and related auxiliary structures. The total time complexity of token tree construction is $O(NlogN)$.

Although one step inference’s time consume of draft model is usually much lower than target model, it is still non negligible. Denote draft model inference time as $T_{d}$, target model inference time as $T_{t}$, the total time of one step of greedy expand method is

$$ $O(NlogN+T_{t}+NT_{d})$ (3) $$

With accepted token number $e$, the latency of generate one token can be represent as $O((NlogN+T_{t}+NT_{d})/e)$.

In the implementation, the time complexity of constructing a token tree for a single operation is
$O(vocab_size)$, due to the sampling and updating of the residual distribution. Typically, the inference of a draft model involves higher time complexity. However, model inference benefits from regular computational workloads and can be efficiently accelerated by GPUs, whereas the complex logical operations involved in token tree construction suffer from low efficiency when implemented in Python. To mitigate this overhead, we implemented the token tree construction in C++, making it negligible compared to the inference times of both the target and draft models.

Even if we disregard the overhead associated with constructing the token tree, accelerating the target model still requires us to achieve a speedup factor of approximately $k\approx 1/e+\frac{NT_{d}}{eT_{t}}$, where
$1/k$ represents the acceleration rate. As the number of tokens
$N$ increases, the term
$N/e$ grows significantly. For instance, with
$N=64$, $N/e$ typically exceeds $10$
, and for
$N=768$,
$N/e$ can surpass
$70$. This rapid growth severely limits the potential for acceleration by simply increasing the size of the token tree.

To address this limitation, we need to develop a more efficient method for generating draft tokens. It’s important to note that the token tree structure will branch out significantly after a few steps, resulting in a relatively shallow depth. If we can generate draft tokens layer by layer, the latency for generating one token can be represented as
$O((NlogN+T_{t}+DT_{d})/e)$, where the time cost of one step can be considered constant for an appropriate input size. For
$N=64$, $D$ is typically less than $10$, and for
$N=768$,
$D$ is usually less than $30$.

However, the greedy expansion method struggles to align with layer-by-layer generation because, without revealing the estimated values of all tokens, it is challenging to determine how many tokens should be included in the shadow layers.

### 4.4 Construct Token Tree with Threshold

To accelerate inference, we must reduce the number of draft generations. In the greedy expansion method, we select the token with the highest estimated value at each step, and this value monotonically decreases with each selection. Once the token tree construction is complete, all tokens with an estimated value greater than a certain threshold $C$ are chosen, while those with lower values are discarded. If we could determine this threshold $c$ at the outset, it would be possible to construct the optimal speculative token tree layer-by-layer. In practice, we can choose an appropriate threshold $C$ (typically around $1/n$) and relax the constraint on
$N$. This adjustment has a minimal impact on the number of accepted tokens but significantly improves latency. The pseudo-code is provided in Appendix A.2.

## 5 Empirical Results

### 5.1 Setup

We implement DySpec using Llama models. We employs JackFram/Llama68m (JF68m) and Llama2-7B as the draft model, and Llama2-7B, Llama2-13B, Llama2-70B (Touvron et al., ) as the target models. We conduct evaluations on various datasets with varying sizes and characteristics, including C4(en) (Raffel et al., ), OpenWebText (Gokaslan & Cohen, ) and CNN DailyMail (Nallapati et al., ).

For a fair comparison, we follow the setting in Sequoia (Chen et al., ), using the first 128 tokens as the fixed prompt and generating 128 tokens as completion.
We evaluate our method with different target temperatures and set the draft temperature to 0.6.
All experiments are conducted on a computation node with one NVIDIA A100 40GB GPU and 32 CPU cores.

### 5.2 Overhead of tree construction

As analyzed in the Section 4.3, the construction of the token tree introduces complex logic, which is inefficient in Python despite its time complexity of $O(NlogNvocab_size)$. To address this, we implemented the construction in C++, making the construction time negligible. The profiling results are shown in Figure 4. The additional overhead introduced by DySpec is the Tree Construction, which accounts for less than two percent of the total execution time in the Llama2-68M/Llama2-7B and Llama2-68M/Llama2-13B pairs. In the Llama2-7B/Llama2-70B pair with CPU-offloading, all components except draft and target model inference cost less than two percent of the total execution time.

Generating masks, sampling tokens, and verification consume significant time under both the Llama2-68M/Llama2-7B and Llama2-68M/Llama2-13B settings. These three components represent the common overhead of all speculative decoding methods, with the primary time spent on waiting for the completion of model execution via CUDA synchronization. In the Llama2-7B/Llama2-70B setting, CPU-offloading and waiting for model execution results overlap, which is why they are not reflected in the profiling results.

Figure: (a) Llama2-68M/Llama-7B
Refer to caption: extracted/5913908/figures/pie7B.png

### 5.3 Effectiveness of Dynamic Token Tree

Table 1 presents the experimental results, detailing the number of accepted tokens and the latency per token in second, when using JF68M as the draft model and Llama2-7B as the target model. Similarly, Table 2 shows the corresponding results for the scenario where JF68M serves as the draft model and Llama2-13B as the target model. In both cases, the maximum draft token tree size is set to 64. For the draft model, DySpec leverages CUDA Graph to capture 129 different input lengths ranging from 128 to 258, thereby accelerating inference, much like Sequoia does.

The results indicate that DySpec consistently outperforms both Sequoia and Specinfer across various data distributions and generation temperatures, leading to a higher number of accepted tokens at each decoding step. The values in the table represent the average time taken to generate a single token in seconds, with the number of tokens accepted by the target model during a single validation in parentheses.

**Table 1: latency per token. The draft model is JF68m and the target model is Llama2-7B. Guess length is 64.**
| Dataset | Temp | Ours | Sequoia | Specinfer | Baseline |
| --- | --- | --- | --- | --- | --- |
| C4 | 0 | 0.00730(5.25) | 0.00871(4.99) | 0.01289(3.32) | 0.02303 |
| C4 | 0.6 | 0.00994(3.71) | 0.01185(3.45) | 0.01215(3.44) | 0.02191 |
| OWT | 0 | 0.00960(3.79) | 0.01001(3.81) | 0.01489(2.54) | 0.02191 |
| OWT | 0.6 | 0.01096(3.07) | 0.01206(3.04) | 0.01262(2.97) | 0.02634 |
| CNN | 0 | 0.00926(3.97) | 0.00936(4.04) | 0.01464(2.58) | 0.02246 |
| CNN | 0.6 | 0.01071(3.18) | 0.01127(3.22) | 0.01245(3.06) | 0.02242 |

**Table 2: latency per token. The draft model is JF68m and the target model is Llama2-13B. Guess length is 64.**
| Dataset | Temp | Ours | Sequoia | Specinfer | Baseline |
| --- | --- | --- | --- | --- | --- |
| C4 | 0 | 0.00969(4.98) | 0.01141(4.35) | 0.01541(3.14) | 0.03033 |
| C4 | 0.6 | 0.01245(3.62) | 0.01505(3.15) | 0.01527(3.15) | 0.02824 |
| OWT | 0 | 0.01270(3.59) | 0.01340(3.44) | 0.01872(2.44) | 0.03117 |
| OWT | 0.6 | 0.01443(3.02) | 0.01588(2.80) | 0.01653(2.75) | 0.02827 |
| CNN | 0 | 0.01190(3.82) | 0.01248(3.67) | 0.01803(2.52) | 0.03054 |
| CNN | 0.6 | 0.01385(3.11) | 0.01527(2.91) | 0.01581(2.84) | 0.02812 |

For larger target models such as Llama2-70B, we employ CPU offloading due to GPU memory constraints. We selected Llama2-7B as the draft model. Despite the time consumed for data synchronization between the CPU and GPU, the inference time for the CPU-offloaded model, with a naive implementation, is approximately 15 seconds per step. By incorporating some overlapping tricks for weight loading (adapted from Sequoia), the inference time is still around 5 seconds per step. In contrast, Llama2-7B requires only about 25 milliseconds per step, resulting in a $T_{t}$/$T_{d}$ ratio of approximately $2\times 10^{3}$. Note that DySpec did not employ CUDA Graph in this scenario due to the significant GPU memory overhead associated with capturing sequences of varying lengths. With 129 distinct sequence lengths and the memory-intensive nature of the draft model Llama2-7B, this approach would be prohibitively resource-demanding.

In this scenario, the acceleration rate is roughly equivalent to the number of accepted tokens per target model step. Set the maximum draft token tree size to 64, DySpec achieves up to a 9.1x improvement in throughput and a 9.4x reduction in latency compared to auto-regressive generation, while also outperforming state-of-the-art methods in consistency, as demonstrated in Table 3.

**Table 3: latency per token. The draft model is Llama2-7B and the target model is Llama2-70B. Guess length is 64.**
| Dataset | Temp | Ours | Sequoia | Specinfer | Baseline |
| --- | --- | --- | --- | --- | --- |
| C4 | 0 | 0.53696(9.10) | 0.88920(6.08) | 1.14332(4.67) | 5.59650 |
| C4 | 0.6 | 0.78912(6.21) | 0.94550(5.72) | 0.92829(5.75) | 5.34781 |
| OWT | 0 | 0.78106(7.23) | 0.91815(6.41) | 1.10449(4.83) | 5.52462 |
| OWT | 0.6 | 0.87547(6.77) | 0.94224(6.07) | 0.97772(5.46) | 5.30340 |
| CNN | 0 | 0.81716(6.93) | 0.90751s(6.42) | 1.10608(4.83) | 5.31049 |
| CNN | 0.6 | 0.89055(6.95) | 0.92659(6.07) | 0.92885(5.75) | 5.29280 |

## 6 Conclusion

We introduce DySpec, a faster speculative decoding algorithm that incorporates a dynamic token tree structure for sampling. Based on the connection between draft probability and acceptance rate,
we apply a greedy strategy to dynamically expand the token tree to maximize the expected length of predicted generations. Empirical results reveal the efficacy and scalability of DySpec by consistent improvements in acceptance rate across various datasets and generation temperatures. Specifically, on the Llama2-70B model with temperature=0, DySpec achieves a 9.1$\times$ throughput improvement and 9.4$\times$ reduction in latency.

## Appendix A Token Tree Construction Algorithm

We present the details of our token tree construction algorithms and the corresponding verification method to ensure that the output probability distribution is consistent with the target model.

### A.1 Token Tree Construction Algorithm with Fixed Size

We demonstrate the proposed token tree construction algorithm with fixed size in Algorithm 1.

The optimal predicted token tree can be generated by greedily expanding the leaf node with the highest expectation. This method can be implemented using priority queues, similar to REST He et al. ().

Assume that we have a partial token tree. Then we use a heap to maintain all extendable nodes (leaf nodes or the last predicted node of its parent). Each time we extend the extendable node with the highest estimated acceptance rate. After adding one node to token tree, there are two more extendable node. One is its first child(the first prediction following this token). This prediction will only occur if the current node is received, so its estimated acceptance rate is $\texttt{previous_rate}\times p$, where $p$ is the estimated acceptance rate of current token. The other extendable node is its next neighbor(the next prediction of the same previous tokens). This prediction will only occur if the current node is rejected, so its estimated acceptance rate is $\texttt{previous_rate}\times(1-p)$.

The algorithm starts with a single root node, which represents the input prefix. Then repeat the aforementioned process $m$ times. The estimated acceptance rate of the node can be expressed as the product of its all ancestor nodes’ probability multiply the probability that all its previous predictions failed under the same prefix tokens.
The new extendable nodes (i.e., $v_{0}$ and $v_{1}$ in Algorithm 1) should have the lower estimated acceptance rate than previous predicted tokens. It means that we generated tokens with decreasing acceptance rate and the residual nodes remain in heap or are not extendable have lower acceptance rate than any generated tokens, which means that we get the optimal token tree.

Note that the estimated acceptance rate is independent of its actual token, because we made this prediction before we know what the token is. If what this token is affects whether or not we keep the sample in draft token tree, then the final result will be biased.

Algorithm 1 will call draft model $m$ times, which is inefficient for large $m$. An alternative way is generating predicted tokens layer by layer. To do this, we can relax the fixed $m$ limitation to an appropriate threshold. Algorithm 1 will greedily generate the first $m$ nodes with largest estimated acceptance rate. If we set the threshold to be the same as the acceptance rate of the last token, we will exactly get the same result as the previous algorithm. And it will only call the draft model layer number times.

### A.2 Token Tree Construction Algorithm with Threshold

Figure: Algorithm 2 Token tree construction algorithm with threshold

We present our token tree construction algorithm with threshold in Algorithm 2. The different between Algorithm 1 and Algorithm 2 is that we extend all nodes with estimated acceptance rate above the threshold.

### A.3 Verification

After the process of token tree, we need a corresponding verification method to ensure that the output probability distribution is consistent with the target model. Our method can be seen as the method dynamically choose the branch number of each token. So the verification method is similar to SpecInfer (Miao et al., ) and Sequoia (Chen et al., ).
We present our verification algorithm in Algorithm 3.

Figure: Algorithm 3 Verify Algorithm

The major difference between Sequoia and ours is that we directly return when the distribution of draft output become all zeros. In that case the estimated acceptance rate in our method is 0 and will never be extended.

## Appendix B Additional Experiments

For all experiments, we selected 1000 pieces of data from each dataset to conduct the experiment. For CNN daily we used test splits. For openwebtext we used train split. For C4 we used en splits. All the results were the result of a single run.

### B.1 DySpec with large token tree size

Under CPU-offloading setting, target model inference is extremely larger than draft model. For Llama2-70B as target and llama2-7b as draft on A100 40G, target model inference time is 2000 $\times$ larger than draft model, which gives us the opportunity to construct a larger token tree. Following Sequoia’s setting, we also make the guess token tree size up to 768. The result shows that our method can achieve a higher accepted token per step, and lower latency per token than SOTA at 0 target temperature.

**Table 4: Latency per token(accepted token per step). The draft model is Llama2-7B and the target model is Llama2-70B. Guess length is 768.**
| Dataset | Temp | Ours | Sequoia | Specinfer | Baseline |
| --- | --- | --- | --- | --- | --- |
| C4 | 0 | 0.42412(16.04) | 0.62841(9.40) | 0.86(8.66)* | 5.59650 |
| C4 | 0.6 | 0.88494(7.14) | 0.66293(8.96) | 1.09(6.93)* | 5.34781 |
| OWT | 0 | 0.54885(11.79) | 0.62979(9.81) | 1.02(7.36)* | 5.52462 |
| OWT | 0.6 | 0.81002(7.66) | 0.65147(9.12) | 1.21(6.18)* | 5.30340 |
| CNN | 0 | 0.54739(11.46) | 0.60206(9,54) | 0.95(7.87)* | 5.31049 |
| CNN | 0.6 | 0.87648(7.02) | 0.65835(8.80) | 1.02(6.24)* | 5.29280 |

On higher temperatures, DySpec demonstrates superior performance compared to Specinfer, but it does not surpass Sequoia. This is due to efficiency constraints that prevent us from implementing the full version of DySpec’s greedy method. Instead, we must employ a threshold to construct the token tree layer by layer. The exact threshold varies over time, which limits our ability to fully utilize the 768-token budget. For instance, at a target temperature of 0.6 on the OpenWebText dataset, with a maximum tree size set to 768 and a threshold of 0.001, the average tree size is 551.79. Figure 5 illustrates the token tree size at each step alongside the number of accepted tokens.

To maximize the potential of DySpec’s greedy expansion method, we need to develop mechanisms for dynamically adjusting the threshold or create an alternative algorithm that eliminates the draft model inference overhead while preserving the token-by-token expansion mechanism.

Figure: Figure 5: Token Tree size with accepted token number each step.
Refer to caption: extracted/5913908/figures/treesize.png

## Appendix C Block-Sparsity Friendly Token Order

The special sparsity in tree attention brings opportunity to further optimize the attention operation.
Since modern attention libraries (e.g. FlashAttention) compute block by block, different token permutations can have distinct computation workloads. To find the optimal token order, we formalize the optimization problem as below:

###### Definition 1 (Block-Sparsity Friendly Token Order) .

Given a tree $\mathcal{T}$ with size $n$ and computation block size $b$, find a permutation $\mathcal{P}$, s.t. the attention mask of tree $\mathcal{P}(\mathcal{T})$ has the minimal number of non-zero blocks.

Exhaustively searching through all permutations is computationally prohibitive. A near-optimal solution to this problem is heavy path decomposition (HPD) (Sleator & Tarjan, ), which traverses nodes in descending order of their subtree sizes. This approach is effective because it groups nodes along longer paths into the same blocks whenever possible, while the long path contribute a lot to the total number of blocks in the tree attention mask ($O(L^{2})$ blocks for path with length $L$). Given the way DySpec constructs the speculative token tree, previous sibling nodes are often allocated more budget to constrain their subtrees. Consequently, the depth-first search (DFS) order closely approximates the HPD order. DySpec leverages DFS to rearrange node indices, thereby reducing the number of non-zero blocks in the attention mask. As illustrated in Figure 6 and Figure 7, DFS order is typically more conducive to block sparsity.

Figure: Figure 6: Comparing DFS order with original order.
Refer to caption: extracted/5913908/figures/attention-1-1.png

Figure: (a) original order
Refer to caption: extracted/5913908/figures/origin.png

###### Definition 1 (Block-Sparsity Friendly Token Order) .

### C.1 Efficiency of Optimized Tree Attention

For different tasks, there exist diverse patterns of attention masks. In response to the block sparsity of these masks, numerous implementations of attention operators based on FlashAttention have been developed, However, those methods are not well-suited to support arbitrary patterns of attention masks. XFormers (Lefaudeux et al., ) and DeepSpeed (Rasley et al., ) have no specific API for arbitrary custom mask. Recently, PyTorch (Paszke et al., ) introduces FlexAttention, which optimizes for arbitrary attention masks. However, to fully leverage its optimization, we must compile the kernel for different masks, which is not suitable for our target scenario of tree-based speculative decoding, where the tree attention mask changes with each iteration.

We have implemented a version of FlashAttention that supports custom masks, enabling the efficient handling of empty blocks in Triton (Tillet et al., ). Our experiments with a random tree attention mask demonstrate that DySpec Tree Reordering can reduce the number of attention mask blocks by up to 5.9$\times$, and the attention operation can run up to 2.1 $\times$ faster, as detailed in Table 5.

In the experiment, we set Q, K, V as shape (batch=1, head_num=64, seqlen, head_dim=128), where head_num=64 and head_dim=128 is the parameter used by Llama2-70B. The block size is 32, which is usually used in attention kernel according to limited shared memory size, and it can also provide considerable block sparsity. The seqlen is varies from 256 to 2048. We also compared our custom kernel with Manual Attention and Xformer, which demonstrates that our implementation kernel is on par with the on-shelf kernel in terms of performance. And the negligible performance improvement of this kernel demonstrates that the performance enhancement of our method is entirely attributable to the reduction in the number of blocks.

In our experiment, we configured Q, K, and V with the shape (batch=1, head_num=64, seqlen, head_dim=128), aligning with the parameters used by Llama2-70B, where head_num=64 and head_dim=128. The block size was set to 32, a common choice in attention kernels due to the constraints of shared memory size, which also facilitates significant block sparsity. The sequence length (seqlen) varied from 256 to 2048. We benchmarked our custom kernel against Manual Attention and Xformers, revealing that our implementation performs comparably to existing kernels. The marginal performance improvement observed in those kernels underscores that the enhanced performance of our method is entirely due to the reduction in the number of blocks.

**Table 5: Efficiency of Optimized Tree Attention with random tree structure.**
| Tree Size | Reorder | custom kernel | Manual Attn | Xformer | Block Count |
| --- | --- | --- | --- | --- | --- |
| 256 | False | 0.07548 | 0.14089 | 0.17559 | 36 |
| 256 | True | 0.05406 | 0.14124 | 0.16721 | 22.5 |
| 512 | False | 0.21317 | 0.56264 | 0.15985 | 135.5 |
| 512 | True | 0.11364 | 0.55965 | 0.17285 | 52.8 |
| 1024 | False | 0.63368 | 2.08612 | 0.49049 | 490.2 |
| 1024 | True | 0.31801 | 2.08142 | 0.48922 | 119.3 |
| 2048 | False | 2.27148 | 9.20739 | 1.87807 | 1654.5 |
| 2048 | True | 1.02645 | 9.13469 | 1.87753 | 278.7 |

Figure: Figure 8: Efficiency of Optimized Tree Attention with random tree structure.
Refer to caption: extracted/5913908/figures/fused-attention-batch1-head64-d128-fwd.png

However, this improvement is not significant in end-to-end situation. These are two problems:

1. The improvement is only significant with large context length, where extremely large sizes will result in diminishing marginal benefits of increasing size on the acceptance rate of speculative decoding.
Despite the decline in acceptance rate as tree size increases, the ratio of inference speeds between the target model and the draft model itself limits the size of the tree.

Using large model like Llama2-70B with CPU-offloading will the ratio of inference speeds between the target model and the draft model, however, there is a new problem that under this setting, the most time cost operation is moving weight between CPU and GPU, and the attention operation only contribute a little in end–to-end latency.

2. The prompt is included in attention mask. As the context becomes longer, the majority of the attention calculations involve interactions between the newly added tokens and the existing context tokens. Consequently, the influence of the tree structure diminishes.

Figure 9 illustrates the block count on a real workload tree attention mask with varying prefix lengths. Specifically, for a tree size of 768, the block count with reordering is 218.31, compared to 366.12 with the original order. Similarly, for a tree size of 1024, the block count with reordering is 295.59, while it is 580.07 with the original order.

Figure: (a) block count with tree size 768.
Refer to caption: extracted/5913908/figures/reorder768.png

Only when these two issues are resolved can reordering effectively accelerate the end-to-end latency of tree-based speculative decoding. The first issue requires a more advanced speculative decoding method capable of handling extremely large tree sizes. The second issue likely necessitates optimizing the attention computation between the prompt sequence and new tokens, thereby shifting the bottleneck to the tree attention mask itself.

## Appendix D prove

The goal is to maximize the expected total acceptance tokens, denoted as $T=\sum_{i}p_{i}$, where $p_{i}$
represents the expected acceptance rate of token
$t_{i}$
within the predicted token tree.

Given the assumptions that (1) the probability of a token appearing in the draft model outputs, denoted as
$draft_{i}$
, can approximate its acceptance rate, and (2) the acceptance rate of a token is independent of its preceding tokens, we can express the expected acceptance rate
$p_{i}$ as:

$$ $p_{i}\approx P[Path_{i}]draft_{i}$ (4) $$

Where $P[Path_{i}]$ represents the probability of accepting all the ancestor tokens of $t_{i}$ in the predicted token tree.

For multi-branch tokens under the same ancestor path, the acceptance of subsequent tokens is depends on the rejection of preceding sibling tokens.
Assuming all ancestor tokens along the path have been accepted, the probability of verifying token
$t_{k}$ can be expressed as:

$$ $P[verify_{i}|Path_{i}]=\prod_{j<k}(1-draft_{j})$ (5) $$

Where $t_{j<k}$ denote $t_{k}$’s previous sibling tokens.

Put all three component together, we have

$$ $p_{i}=P[Path_{i}]\times\prod_{j}{j<k}(1-draft_{j})\times draft_{k}$ (6) $$

Although we have a method to estimate the expected acceptance token number, there are still challenges in finding the optimal structure for speculative decoding. The expectation can only be known after we have completed the sampling process. After sampling, the predicted token tree must be updated, otherwise some tokens with low acceptance rates will be pre-pruned, leading to a slightly skewed output distribution that deviates from the sole target mode. An alternative solution is to only decide whether to perform the sampling, rather than whether to add it to the predicted tree.

Assuming that all single samplings have the same acceptance rate, the target can be modified as:

$$ $\begin{array}[]{r l}T=&\sum p_{i}=\sum s_{i}\rho\\ =&P[Path_{i}]\times\prod_{j}{j<k}(1-draft_{j})\times\rho\\ \end{array}$ (7) $$

where $s_{i}$ denotes the probability that we make this sampling, and $\rho$ denotes the acceptance rate of a single isolated sampling.

For multi-branch tokens under the same ancestor path, after we sample the first token $t_{1}$, the second token $t_{2}$ should never be $t_{1}$ because it will never pass the verification (The residual probability of target will be zero.). We should only sample the second one from the remaining tokens. Let $d_{i}$ denote the original output distribution of the draft model, then the probability of sampling the second token $t_{2}$ can be expressed as $draft_{2}=d_{t_{2}}/(1-d_{t_{1}})$.

More generally, for the $k$-th token $t_{k}$, the probability of sampling it can be calculated as:

$$ $draft_{k}=\frac{d_{t_{k}}}{1-(\sum_{j<k}d_{t_{j}})}$ (8) $$

Combining the previous formulations, the probability of verifying the $i$-th token given the ancestor $Path_{i}$, $P[verify_{i}|Path_{i}]$, can be expressed as:

$$ $\begin{array}[]{rl}&P[verify_{i}|Path_{i}]=\prod_{j<i}(1-draft_{j})\\ =&\prod{j<i}(1-\frac{d_{t_{j}}}{1-(\sum_{k<j}d_{t_{k}})})\\ =&\prod{j<i}\frac{1-(\sum_{k<j}d_{t_{k}})-d_{t_{j}}}{1-(\sum_{k<j}d_{t_{k}})} \\ =&1-\sum_{j<i}d_{t_{j}}\\ \end{array}$ (9) $$

For the probability of the path, $P[path_{i}]$, where $path_{i}=x_{1},...,x_{i-1}$, and under the independence assumption, we have:

$$ $\begin{array}[]{rl}&P[path_{i}]=\prod_{j<i}P[acceptx_{j}|path_{j}]\\ =&\prod_{j<i}P[verify_{j}|Path_{j}]\times draft_{j}\\ =&\prod_{j<i}(1-\sum_{k<j}d_{t_{k}})\frac{d_{t_{j}}}{1-\sum_{k<j}d_{t_{k}}}\\ =&\prod_{j<i}d_{t_{j}}\\ \end{array}$ (10) $$

Combining these, the final target expression becomes:

$$ $\begin{array}[]{rl}T=&\sum p_{i}\\ =&\sum_{i}P[path_{i}]P[verify_{i}|Path_{i}]\rho\\ =&\sum_{i}\prod_{j\in path_{i}}d_{t_{j}}\rho\\ &\times(1-\sum_{k\text{ is the sibling token before }i}d_{t_{k}})\\ \end{array}$ (11) $$

Note that for deeper tokens and sibling tokens after, the acceptance rate $p_{i}$ will monotonically decrease, which means we can construct the predicted tree greedily.

Our method ensures that at each step, we perform sampling with the maximum expected acceptance rate. To demonstrate this, assume that there exists an alternative method that can generate a better tree of the same size $n$. There must be at least one leaf node that differs between this alternative method and our method. Let’s denote the leaf nodes from the alternative method as $N_{c}$ and the corresponding leaf nodes from our method as $N_{our}$. Furthermore, let’s denote the first ancestor node of $N_{c}$ that is not present in our result as $M_{c}$, and assume that there are $k$ nodes in the sub-tree of $M_{c}$.

Denote the expected acceptance rate of this sample as $P[M_{c}]$. Then, the contribution of the entire sub-tree is at most $k\times P[M_{c}]$. The fact that our method did not choose this sub-tree implies that the last $k$ samples we made, which are not present in the alternative method, have an expected acceptance rate higher than $P[M_{c}]$. The contribution of these $k$ samples to the expectation of the total number is larger than $k\times P[M_{c}]$.

By eliminating these $k$ nodes and applying induction, we can show that $E_{n-k,ours}\geq E_{n-k,c}$, where $E_{n-k,ours}$ and $E_{n-k,c}$ represent the expected number of accepted tokens for our method and the alternative method, respectively. Additionally, we have $\sum^{k}P[M_{i,ours}]\geq k\times P[M_{c}]\geq\sum^{k}P[M_{i^{\prime},c}]$, where $M_{i,ours}$ and $M_{i^{\prime},c}$ are the corresponding ancestor nodes in our method and the alternative method, respectively. Combining these results, we can conclude that $E_{n,ours}\geq E_{n,c}$, proving that our method can maximize the expected number of accepted tokens.

### D.1 Greedy Optimal Proof

The search space for the responses form a hierarchical $k$-wise tree $S$, with $k$ being the number of tokens in the vocabulary. For a model $M$, it induce a set of weights on the search space. More specifically, for any node $u_{n}$, assume the unique path starting from the root that lead to $u_{n}$ is $u_{0},u_{1},...,u_{n}$, define the weight for node $u_{n}$ to be:

$$ $w_{u_{n}}=\Pi_{m=0}^{n-1}P_{M}(u_{m+1}|u_{0:m})$ (12) $$

Consider a subset $S^{\prime}$ of the space $S$, the weight of the set $w_{S^{\prime}}$ is defined as the summation of all the nodes’ weights in the subset, i.e.:

$$ $w_{S^{\prime}}=\sum_{v\in{S^{\prime}}}w_{v}$ (13) $$

Define $\mathcal{T}$ to be the collection of all connected sub-trees that contain the root. We are interested in finding sub-trees with the max weight with number of nodes less than $N$, i.e.

$$ $\mathcal{T}_{N}^{*}=\{T|w_{T}=\max_{T\in\mathcal{T}}w_{T}\}$ (14) $$

Algorithm (Greedy):
Suppose we start from the set that only contain the root $M_{1}=\{root\}$.

Define the candidate set $C(M_{i})=N(M_{i})\backslash M_{i}$

Pick the node $v^{*}=\arg\max_{v\in C(M_{i})}w_{v}$

$M_{i+1}=M_{i}\cup\{v^{*}\}$

Theorem:

(A) $M_{N}\in\mathcal{T}$

(B) $M_{N}\in\mathcal{T}^{*}_{N}$

###### Proof.

We will prove each part of the theorem separately.

We first prove (A), which is equivalent to verify $M_{N}$ forms a connected tree that contain the root. The latter fact is trivial since $root\in M_{1}\subset M_{N}$. It’s also straightforward to see the connectivity as at every step the new added node belongs to the neighbor. Finally, since a connected subset of a tree $S$ is also a tree, therefore we conclude (A).

For (B), we prove by induction. For $N=1$, this is trivial. Suppose for $N\leq k$, $M_{N}\in\mathcal{T}^{*}_{N}$, we prove this for $N=k+1$. For any $M_{k+1}^{\prime}\in\mathcal{T}_{k+1}$, and any $M_{k}\in\mathcal{T}^{*}_{k}$, we show $w_{M_{k}}+\max_{v\in C(M_{k})}w_{v}\geq w_{M_{k+1}^{\prime}}$.

To show this, note that $|M_{k+1}^{\prime}|=k+1>k=|M_{k}|$, there exist at least one leaf node $v\in M_{k+1}^{\prime}$ such that $v\notin M_{k}$. Consider the unique path that connect the root and $v$ as $u_{0},...,u_{p}=v$. Since $u_{0}\in M_{k}$ and $u_{p}\notin M_{k}$, there must be some $q\in\{1,...,p\}$ satisfy $u_{q-1}\in M_{k}$ and $u_{q}\notin M_{k}$. By definition, $u_{q}\in C(M_{k})$ since it’s the neighbor of $M_{k}$. And according to the definition of the weight, $w_{u_{q}}\geq w_{u_{p}}$. Now consider the fact that $M_{k+1}^{\prime}\backslash w_{u_{p}}$ is still a tree since $u_{p}$ is a leaf, so by induction, we have $w_{M_{k}}\geq w_{M_{k+1}^{\prime}\backslash w_{u_{p}}}$. Therefore, we have

$$ $\begin{array}[]{rl}&w_{M_{k}}+\max_{v\in C(M_{k})}w_{v}\\ \geq&w_{M_{k}}+w_{u_{q}}\\ \geq&w_{M_{k}}+w_{u_{p}}\\ \geq&w_{M_{k+1}^{\prime}\backslash w_{u_{p}}}+w_{u_{p}}\\ =&w_{M_{k+1}^{\prime}}\end{array}$ (15) $$

Because $M_{k+1}^{\prime}$ is chosen arbitrarily, we proved that $w_{M_{k}}+\max_{v\in C(M_{k})}w_{v}=w_{M_{k+1}^{\prime}}$, completing the proof of (B).
∎

###### Proof.

## Peer Reviews

confidence: 4
contribution: 3
initial_rating: 5
presentation: 2
questions: More convincing experimental results that compare with more relevant related work.
soundness: 4
strengths: 1.	The correlation of Hypothesis 1 with the proposed method is well elaborated and explained.
2.	The structure of the paper is clear and easy to follow.
summary: This work proposes a method to dynamically expand the token tree based on the draft distribution. A key difference between this work and existing approaches is that it introduces a smooth dynamic draft token tree construction method, which expands the tree along both width and depth without hyperparameter setup, within the given token budget. However, related works are missing, and the experimental setup should be properly improved.
weaknesses: 1.	Lack of related work. Context-aware dynamic draft token tree is not a new idea. I would like to draw your attention to a very related work: “EAGLE-2: Faster Inference of Language Models with Dynamic Draft Trees” (EMNLP'24). This paper also proposes adopting dynamic draft token trees and claims a strong positive correlation between the draft model confidence score and the acceptance rate of the token. Another relevant paper is “Dynamic Depth Decoding: Faster Speculative Decoding for LLMs,” which further improves performance by dynamic depth. The methodology of EAGLE-2 is quite similar to this paper but differs in the tree construction method. Including this work in your paper and providing necessary discussion is essential.
2.	Experimental setup and results are weak. First, the dataset is too limited. I recommend adding more datasets like MT-Bench (Zheng et al., 2023), HumanEval (Chen et al., 2021), and GSM8K (Cobbe et al., 2021). Second, the 9.1× speedup is compared with the autoregressive method, and when compared with static tree methods like Sequoia, the results are much less overwhelming. Considering that the experimental setup lacks comparison with state-of-the-art dynamic draft token tree methods, the experiment does not fully convince me of the merits of this methodology.
3.	Writing needs improvement. Section 4.2 is hard to follow. The presentation of Figure 3 should be improved. Additionally, Figure 4 is not clear; please increase the font size.

---

confidence: 2
contribution: 2
initial_rating: 6
presentation: 2
questions: None
soundness: 3
strengths: 1. Strong Theoretical Foundation
- Provides rigorous theoretical analysis linking draft distribution to acceptance rate
- Includes formal proofs of optimality under stated assumptions
- Clearly bridges theoretical insights with practical implementation

2. Novel Technical Contributions
- Introduces an innovative dynamic token tree construction approach
- Develops efficient algorithms for both fixed-size and threshold-based tree construction
- Proposes block-sparsity friendly token ordering for optimization

3. Comprehensive Empirical Evaluation
- Tests across multiple model scales (7B to 70B parameters)
- Evaluates on diverse datasets (C4, OpenWebText, CNN DailyMail)
- Compares against strong baselines (Specinfer, Sequoia)
- Examines performance under different temperature settings

4. Implementation Efficiency
- Addresses practical concerns about overhead
- Provides C++ implementation to minimize token tree construction costs
- Includes detailed analysis of computation complexity
summary: This paper introduces DySpec, a novel approach to speculative decoding that employs a dynamic token tree structure to improve inference speed for large language models. The authors present both theoretical and empirical evidence showing that higher draft probabilities correlate with higher acceptance rates. Based on this insight, they develop a greedy strategy for dynamically expanding the token tree at runtime. The method achieves impressive results, demonstrating up to 9.1× throughput improvement and 9.4× reduction in latency on Llama2-70B under low temperature settings, outperforming existing methods like Specinfer and Sequoia.
weaknesses: 1. Limited Discussion of Limitations
- Could elaborate more on scenarios where the method might not perform optimally
- More discussion of the trade-offs between fixed-size and threshold-based approaches would be valuable

2. Implementation Details
- Some implementation specifics about the C++ optimizations could be expanded
- Could provide more guidance on threshold selection for different scenarios

3. Experimental Validation
- Could include more ablation studies to isolate the impact of different components
- Additional experiments on more diverse model architectures would strengthen generalizability claims

---

confidence: 4
contribution: 3
initial_rating: 5
presentation: 2
questions: - See the summary section 

Please answer some of the question there. I am happy to bump up the score to 6.
soundness: 3
strengths: - The proposed idea is quite useful and can provide significant speedups for tree based speculative decoding methods. 

- The overheads reported our negligible.
summary: Summary:

The authors propose dyspec to generate an optimal tree. The core idea is based on the idea that the target distribution and draft distribution should match.

The authors based on the idea propose an algorithm to come up with optimal tree. They overcome several implementation challenges and achieve reasonable speedups compared to existing baselines.

“DYSPEC achieves a 9.1× throughput improvement and 9.4× reduction in latency.” ([“DySpec”, p. 2]-> Should compare to SpecInfr or Medusa

“Figure 2: Connection between acceptance rate/target distribution and draft distribution on CNN DailyMail.The density of each block is normalized by column.” ([“DySpec”, p. 3] -> Can you please explain this figure. I think it’s the main motivation for your method, however it is not clearly explained, what this figure is showing.

“Specinfer-Baseline” ([“DySpec”, p. 7] -> Specifinfer requires training the models. What have authors done here.

“DYSPEC leverages CUDA Graph to capture 129 different input lengths ranging from 128 to 258” ([“DySpec”, p. 7-> What is the significance of CUDA Graph here, my understanding is CUDA graph is a mechanism to launch multiple kernels at the same time on the GPU to minimize the overhead of kernel dispatch

“We selected Llama2-7B as the draft model” ([“DySpec”, p. 7] -> What happens when you use the 68M model ?

“Set the maximum draft token tree size to 64, DYSPEC achieves up to a 9.1x improvement in throughput and a 9.4x reduction in latency compared to auto-regressive generation” ([“DySpec”, p. 8]-> Unfair comparison, compare to baselines

Additional experiments -

I would really like to experimentally understand the optimality of your tree. Will it be possible to construct an optimal tree based on some post-hoc data and compare it with the tree generated by Dyspec.
weaknesses: - See the summary section please.

---

confidence: 5
contribution: 2
initial_rating: 3
presentation: 2
questions: 1. There are concurrent works using similar ideas. For instance, EAGLE 2 (https://arxiv.org/abs/2406.16858) attempts to maximize the acceptance rate based on a similar intuition (see Figure 6 in their paper). The authors should mention these works. What are the differences between your method and EAGLE 2?
1. Dynamic tree-based selection methods have appeared in prior literature. For example, Recurrent Drafter (https://arxiv.org/abs/2403.09919) proposes an RNN draft model and uses beam search for adaptive token selection. Did you modify the draft model architecture in your approach?
1. In practice, small draft models may be overconfident about incorrect answers in reasoning tasks. Have you studied your Hypothesis 1 across different tasks and analyzed the failure examples?
1. Does your method support batch inference? Have you experimented with large batch sizes to push your algorithm to its computational limits and test its throughput?
soundness: 2
strengths: The proposed token selection method demonstrates improvement over existing methods such as Sequoia and Specinfer.
summary: This paper proposes a draft token selection method in speculative decoding aimed at improving the token acceptance rate. The core idea is to use the draft model's prediction score as evidence to infer the token acceptance rate and use this information to select more promising tokens. The authors provide both theoretical and empirical analyses to support their approach.
weaknesses: 1. The paper lacks discussion on existing works that share very similar ideas (see Questions 1 and 2). 
1. The experimental results do not sufficiently validate the method's effectiveness from various perspectives (see Questions 3 and 4).

Meta-review: This paper provides a dynamic tree structure construction for multi-draft speculative decoding, and shows improvements over existing static tree construction techniques. However, during the rebuttal, the reviewers mentioned the existence of related work that also creates trees dynamically, specifically Eagle 2, which has significant overlap with the current proposal. The authors have responded with an explanation on the differences. However, the AC finds this to be insufficient and a more in-depth understanding of similarities and differences is warranted. In particular, the AC recommends that the authors replace the tree construction step in Eagle 2 with that proposed herein. This ablation is key to substantiating the claim of almost optimality of the tree construction in this work and can increase its impact further. We hope that the authors find the comments of the reviewers useful for a future iteration of their paper.

Decision: Reject