Hardware-Aware Parallel Prompt Decoding for Memory-Efficient Acceleration of LLM Inference

## Abstract

Abstract The auto-regressive decoding of Large Language Models (LLMs) results in significant overheads in their hardware performance.
While recent research has investigated various speculative decoding techniques for multi-token generation, these efforts have primarily focused on improving processing speed such as throughput.
Crucially, they often neglect other metrics essential for real-life deployments, such as memory consumption and training cost.
To overcome these limitations, we propose a novel parallel prompt decoding that requires only 0.0002 0.0002 0.0002 0.0002 % trainable parameters, enabling efficient training on a single A100-40GB GPU in just 16 hours.
Inspired by the human natural language generation process, PPD approximates outputs generated at future timesteps in parallel by using multiple prompt tokens. This approach partially recovers the missing conditional dependency information necessary for multi-token generation, resulting in up to a 28% higher acceptance rate for long-range predictions.
Furthermore, we present a hardware-aware dynamic sparse tree technique that adaptively optimizes this decoding scheme to fully leverage the computational capacities on different GPUs.
Through extensive experiments across LLMs ranging from MobileLlama to Vicuna-13B on a wide range of benchmarks, our approach demonstrates up to 2.49 × \times × speedup and maintains a minimal runtime memory overhead of just 0.0004 % percent 0.0004 0.0004\% 0.0004 % .
More importantly, our parallel prompt decoding can serve as an orthogonal optimization for synergistic integration with existing speculative decoding,
showing up to 1.22 × 1.22\times 1.22 × further speed improvement.
Our code is available at https://github.com/hmarkc/parallel-prompt-decoding .

### 1 Introduction

Figure: Figure 1: Comparison of memory, speedup, and training cost on MT-Bench with Vicuna-7B. Circle diameter shows training GPU hours.
Refer to caption: x1.png

The recent advances in large language models (LLMs) are increasingly gaining influence across various AI applications.
However, autoregressive generation, the de facto approach employed in LLM inference, suffers from inadequate hardware performance due to its inherent sequential nature [].
Speculative decoding [, , ], an emerging acceleration technique, employs a guess-and-verify framework for LLM inference, where a smaller draft model first predicts multiple tokens sequentially and then the original LLM verifies them in parallel.
Despite its potential, the effectiveness of speculative decoding is limited by the complexity and cost of training a draft model capable of consistently achieving high acceptance rates across diverse base models and datasets.
Additionally,
the extra runtime memory overhead for executing draft models poses a significant barrier to the broader adoption of speculative decoding, particularly in edge and mobile environments where memory capacity is limited.
Considering the growing need for user privacy and personalization, deploying LLMs on devices urges a more memory- and cost-efficient solution for accelerating LLM inference.
Recent efforts have explored the possibility of generating multiple tokens in parallel without relying on a separate transformer draft model [].
Approaches such as inserting additional decoding heads [] and retrieving frequently used tokens [] are employed to enhance performance.
However, these methods either aggressively assume conditional independence among the tokens generated in a single step [, ], or use placeholder tokens (e.g., [PAD] token) that do not convey enough contextual information [].
Therefore, they often suffer from low acceptance rates or degradation in output quality due to the lack of sufficient conditional information during inference.

To alleviate the complexity and overhead associated with the use of draft models while maintaining a high acceptance rate, we propose Parallel Prompt Decoding (PPD), a novel architecture-agnostic and memory-efficient framework that adopts prompt tuning for non-autoregressive LLM inference.
Inspired by the human natural language generation process where continuous words like common expressions and phrases are produced simultaneously,
PPD introduces the use of prompt tokens, the meticulously trained embeddings, for multi-token prediction.
Specifically, these trained prompt tokens are appended to the original input sequence in parallel,
enabling the concurrent generation of multiple output tokens in a single forward pass.
The key intuition of PPD lies in the observation that if trained properly, prompt tokens appended to the input can approximate tokens generated at future timesteps, thereby partially recovering the missing conditional dependency information for multi-token generation.
By strategically positioning trained prompt tokens, PPD achieves up to a 28% higher acceptance rate when predicting long-range tokens.
To further increase the token acceptance rate, we generate multiple candidate continuations with each prompt token and use them in combination with a customized tree attention mask to minimize the computation and memory overhead.
The capability of PPD to use low-cost prompt tokens for accurate multi-token prediction forms the foundation for accelerating LLM inference.
As shown in Figure 1, PPD achieves a comparable speedup to the state-of-the-art speculative decoding approaches with negligible memory overhead and reduced training cost.
Moreover, to facilitate the optimized implementation of PPD across different hardware platforms,
we propose a hardware-aware dynamic sparse tree technique that adaptively refines the prompt structure during runtime based on the computational resources available on the specific hardware.

Figure: Figure 2: Overview of PPD. The left section shows the location of trainable parameters and the middle section displays the combined guess-and-verify process during inference. The "prompt token" denotes the special token with separately trained embeddings to perform parallel prediction.
Refer to caption: x2.png

To demonstrate the effectiveness of our approach, we evaluate PPD on MobileLLaMA  [], Vicuna-7b and Vicuna-13b []. Running on a single GPU using the A100-40GB and RTX 4090, our method achieves a speedup ratio for inference from 2.12$\times$ to 2.49$\times$ across a diverse range of popular datasets including MT-Bench, HumanEval, and GSM8K. Our experiments demonstrate that PPD not only achieves comparable throughput to the state-of-the-art speculative decoding method, but it also manages this with significantly fewer trainable parameters—specifically, 0.0002% of trainable parameters—and incurs only a minimal memory overhead (0.0004%), showcasing that PPD is remarkably cost- and memory-efficient. The training of prompt tokens can be completed in 16 hours using one A100 GPU, 8 hours using four GeForce RTX 3090 GPUs, compared to the 1-2 days on four A100 GPUs required for Eagle []. Furthermore, since PPD does not require the modification of the original LLM or the addition of extra networks, it is highly adaptable and orthogonal to other decoding techniques. For instance, it can be effectively combined with a draft model to further reduce inference latency.

Our contributions are summarized as follows:

- •
A novel Parallel Prompt Decoding (PPD) that adopts cost-effective prompt tokens for non-autoregressive LLM inference, achieving a high acceptance rate for long-distance token prediction with preserved output quality.
- •
A hardware-aware dynamic sparse tree technique that adaptively optimizes the prompt structure of PPD at runtime based on the available compute and memory resources, facilitating its efficient deployment on various hardware platforms.
- •
An open-source implementation of PPD, accompanied by comprehensive evaluations on various models and benchmarks. Our experiments demonstrate that PPD achieves significant speed improvements with negligible memory overhead and reduced training cost.

### 2 Background and Related Work

To enhance the inference speed of LLM,
various approaches adopt an iterative guess-and-verify strategy to enable multi-token generation.
In the guessing phase, potential future tokens are proposed at a faster speed than in traditional autoregressive implementations. Subsequently, a parallelized verification process assesses which guessed tokens should be accepted.
Depending on how tokens are generated during the guess stage,
these approaches can generally be categorized as i) speculative decoding and ii) parallel decoding.

#### 2.1 Speculative Decoding

The guessing phase of speculative decoding adopts a lightweight draft model to generate multiple tokens at an increased speed [].
During the verification stage, the original LLM subsequently determines the acceptance of the guessed tokens.
It is worth noting that both draft and original models still follow the auto-regressive inference scheme.
The speedup comes from two factors: i) the draft model runs much faster than the original model and more tokens can be generated within the same time unit; and ii) token verification is executed concurrently, either by batching or by incorporating multiple candidates into a single input using customized sparse attention masks [].
Therefore, the overall speedup depends on the acceptance rate and the inference latency of draft models.

Building on the speculative decoding scheme,
various studies have been conducted to further optimize its inference speed.
To improve the accuracy of the draft model and its token acceptance rate,
Eagle [] incorporates the hidden features into the draft model’s forward pass.
SpecInfer [] adopts a tree-based speculative inference and verification scheme, improving the diversity of speculation candidates.
Sequoia [] optimizes the sparse tree structure by considering the capability of the underlying hardware platforms.
However, most of these methods require the storage and maintenance of a separate draft model.
Moreover, there is extra complexity in designing an efficient draft model.

#### 2.2 Parallel Decoding

To overcome the inherent limitations of autoregressive inference and the memory overhead associated with using a separate draft model,
several attempts have been made to integrate both guessing and verification using one unified model.
Medusa(^1^11We categorize Medusa as parallel decoding because it only adopts LM heads instead of separate models.) [] introduces language model (LM) heads at the final layer of the original LLM, facilitating the generation of multiple tokens in a single forward pass. It also utilizes tree attention masks in its verification process to increase speed even further.
To enhance token drafting with retrieval-augmented generation [], Rest [] introduce retrieval-based decoding tailored for specific scenarios.
Inspired by Jacobi decoding [] that adopts multiple special tokens to accelerate machine translation,
Lookahead Decoding [] improves upon this method by generating parallel n-grams and employing a caching memory pool.
To capture more information while using multiple special tokens at distinct positions, PaSS [] trains additional tokens with embedding layers for parallel decoding.
Hierarchical parallel decoding [] introduces the use of $[Fork]$ and $[Join]$ tokens, enabling parallel execution of multiple structural subroutines.

Our approach can be categorized as parallel decoding, with three novel features to distinguish it from other approaches: 1) PPD trains the embeddings of parameterized ensemble prompt tokens, 2) it utilizes a dynamic sparse tree, adapting its structure at every inference step, and 3) we propose a hardware-aware algorithm for designing a dynamic sparse tree tailored to each hardware platform.

### 3 Parallel Prompt Decoding ( PPD )

PPD trains embeddings for prompt tokens rather than developing a separate model. Our method integrates three substeps into a single decoding step, following the guess-and-verify strategy: (1) candidate generation, where multiple candidate continuations(^2^22A candidate token, also referred to as a ”guess token”, is a draft token generated from a prompt token.) are predicted by strategically inserting the prompt tokens into the input sequence. Tree attention [] merges the processing of multiple candidates into a single forward pass; (2) candidate verification, where two verification schemes, exact matching [] and typical acceptance [], are implemented; (3) candidate acceptance, where validated candidates are integrated into the input and KV cache is updated accordingly.
The inference scheme in Figure 2 illustrates the generation and verification combined in a single forward pass.

#### 3.1 Prompt Tokens

The prompt tokens are the key component of PPD to realize multi-token generation.
Initially introduced in [] to adapt LLMs for specific tasks, prompt tokens are typically prepended to the input, with outputs generated in an autoregressive manner.
In this work, we propose a novel approach of utilizing prompt tokens by strategically positioning them at locations where tokens are anticipated to be generated in parallel.
For conventional parallel decoding techniques [, ] that presume complete conditional independence among tokens decoded in a single step, the exact conditional probability $p(y_{i+k+1}|x,y_{1:i+k})$ is approximated by $p_{\theta}(y_{i+k+1}|x,y_{1:i})$, where $x$ is the input, $y_{1:i+k}$ represents the generated outputs so far, $k>0$ indicates the token distance.(^3^33The token distance is the number of tokens between the last accepted token and the predicted token.) However, we observe that as $k$ increases, the gap between the actual probability and its approximation expands, primarily due to the absence of relevant conditional dependencies. We argue that prompt tokens can bridge this gap by more accurately modeling the conditional probability as $p_{\theta}(y_{i+k+1}|x,y_{1:i},t_{i+1:i+k})$ where $t_{i}$ is the prompt token with token distance $i$. Through this forward pass in the decoder layers, these causally linked prompt tokens facilitate the flow of information along the sequence of speculative tokens, thus restoring the conditional probability.

#### 3.2 Ensemble Prompt Tokens

Inspired by prompt ensembling [], which uses multiple prompts to generate diverse responses and aggregates these to derive a single answer, we introduce the concept of ensemble prompt token (EPT). This additional abstraction allows us to decouple each prompt token from the fixed embedding dimension. For every prompt token, there exist multiple corresponding EPTs, each with its distinct embedding. We modify the attention mask to ensure that each $n^{\text{th}}$ EPT only depends on the corresponding $n^{\text{th}}$ EPTs from preceding prompt tokens. This selective visibility is maintained for both training and inference, where the guess token for each prompt token is determined by averaging the logits of its EPTs. The use of EPTs not only enables direct and flexible control over the trainable parameters, but also leads to an increase in prediction accuracy. The probability is approximated as $\frac{1}{n}\sum_{j=1}^{n}p_{\theta}(y_{i+k+1}|x,y_{1:i},v_{i+1:i+k}^{j})$, where $v_{i+m}^{j}$ denotes the $j^{\text{th}}$ EPT at a token distance of $m$.
(^4^44Further details about EPTs can be found in Appendix B.)

#### 3.3 Training

During training, only the embeddings of prompt tokens are changed, with the parameters of the original LLM remaining frozen. We adopt the following two training techniques:

Random Insertion of Prompt Tokens: Randomly inserting prompt tokens throughout the input sequence reduces contextual bias from appending them only at the end. This approach broadens the predictive capacity of prompt tokens beyond a limited vocabulary such as <eos> and punctuation.

Knowledge Distillation: To align the predictive behavior of prompt tokens with the original LLM, we employ knowledge distillation. Instead of using hard labels, prompt tokens are trained against the logits produced by the original LLM. Following Medusa [], The loss function is formulated as:

$$ $L_{PD}=\frac{1}{N}\sum_{i=1}^{N}D_{KL}(P_{i}\parallel Q_{i})\cdot\alpha^{i-1},$ (1) $$

where $D_{KL}$ is the KL divergence, $P_{i}$ is the predicted distribution of the $i^{\text{th}}$ prompt token, $Q_{i}$ is the corresponding distribution from the original LLM, and $\alpha$ is the decay ratio.

### 4 Dynamic Sparse Tree

#### 4.1 Motivation

To achieve higher speedup, PPD utilizes a specialized tree attention [, ] to process multiple candidates within a single decoding step without expanding the batch size. Notably, PPD employs a sparse tree [, ], designed to prioritize candidates with higher prediction accuracy. One key distinction from the sparse tree used in previous works is the appending of a sequence of prompt tokens to each tree node as shown in Figure 3. To optimize the amortized acceptance length across decoding steps, it is crucial to carefully balance the number of candidate tokens and prompt tokens.
Instead of appending a uniform number of prompt tokens to every candidate token, we allocate them based on each candidate’s probability, causing the tree’s maximum depth and structure to vary at each decoding step.

Figure: Figure 3: Dynamic sparse tree.
Refer to caption: x3.png

#### 4.2 Construction Algorithm

We aim to construct a dynamic sparse tree that maximizes the amortized number of tokens generated with limited candidate tokens and prompt tokens. We first define the tree construction algorithm as a constrained optimization problem.

###### Definition 4.1 .

Let $m$ be the maximal number of prompt tokens per tree node. The dynamic sparse tree $T$ can exist in $m$ states, each represented by $T_{k}$ corresponding to state $s_{k}$, where $1\leq k\leq m$. Let $\text{C}(T_{k})$ denote the subtree of $T_{k}$ composed solely of candidate tokens. The maximum depth of $\text{C}(T_{k})$ is $k$.

###### Proposition 4.1 .

For a dynamic sparse tree state $T_{k}$, where each candidate token $v$ follows a path $\text{Path}(v)$ from the root, and the acceptance probability $p_{k}$ at each path position $k$, the expected number of tokens $f(T_{k})$ generated is given by $f(T_{k})=\sum_{v\in\text{C}(T_{k})}\prod_{i\in\text{Path}(v)}p_{i}$, where $\prod_{i\in\text{Path}(v)}p_{i}$ represents the contribution of a token $v$ to the expected number of tokens.

We then propose an approximation of the amortized number of tokens generated, by considering the tokens generated at the current and the next decoding step.

###### Proposition 4.2 .

The expected total number of tokens $F(T_{k})$ generated for the dynamic sparse tree state $F(T_{k})$ at the current and the next decoding step is given by $F(T_{k})=f(T_{k})+\sum_{i=1}^{m}p(s_{i}|s_{k})f(T_{i})$, where $p(s_{i}|s_{k})$ represents the state transition probability from state $s_{k}$ to state $s_{i}$.

We are now ready to introduce Proposition 4.3, which we use in the pruning algorithm.

###### Proposition 4.3 .

For a dynamic sparse tree state $T_{k}$ with candidate subtree $c_{k}=\text{C}(T_{k})$, the change in expected total tokens $F(T_{k})$ due to the removal of a prompt token at candidate token $c$ is given by $\Delta F=p(c)\cdot(f(T_{i})-f(T_{i-1}))$, where $p(c)$ is the acceptance probability of candidate $c$, $i$ denotes the number of prompt tokens prior to removal. We assume that $i>1$.

To construct an approximately optimal dynamic sparse tree with specified numbers of candidate and prompt tokens, the process includes: (1) Optimal Candidate Trees: Constructing trees using only candidate tokens at varying depths, employing the algorithm from Medusa [] and Sequoia [] to maximize $f(T_{k})$ as stated in Proposition 4.1; (2) Appending Prompt Tokens: Attaching the maximum allowable prompt tokens to each candidate token from the first step; (3) Greedy Prompt Token Removal: Removing prompt tokens greedily to minimize $\Delta F$ (Proposition 4.3), continuing until the desired prompt token count is reached.

We now introduce the formulation of the real amortized number of tokens generated.

###### Proposition 4.4 .

The amortized number of tokens $R(T_{k})$ generated for the dynamic sparse tree state $F(T_{k})$ is given by $R(T)=\sum_{i=1}^{m}p(s_{i})f(T_{i})$, where $p(s_{i})$ is the steady-state probability of state $s_{i}$, and $f$ is the function defined in Proposition 4.1.

Hardware-awareness. All the probabilities used above can be approximated on a validation dataset. The dynamic sparse tree construction algorithm can now be formulated as finding the dynamic sparse tree $T$ with $n_{c}$ candidate tokens and $n_{p}$ prompt tokens to maximize $R(T)$:

$$ $c(n_{c},n_{p})=\max_{T,|C(T)|=n_{c},|T|=n_{c}+n_{p}}R(T).$ $$

For a fixed tree size $n$, we explore all combinations of $n_{c}$ and $n_{p}$ where $n=n_{c}+n_{p}$, to identify the dynamic sparse tree that maximizes $R(T_{k})$. To determine the optimal tree size $n$, we define two key functions:
1. Acceptance length $\tau(n)$ (hardware-independent) and
2. Forward pass latency $L_{fp}(n)$ (hardware-dependent).
The speedup ratio, $\text{Speedup}(n)=\frac{\tau(n)}{L_{fp}(n)}$, is estimated using a validation dataset, with $\tau(n)$ evaluated once and $L_{fp}(n)$ tested on different hardware types. We aim to find the value of $n$ that maximizes $\text{Speedup}(n)$.

###### Definition 4.1 .

###### Proposition 4.1 .

###### Proposition 4.2 .

###### Proposition 4.3 .

###### Proposition 4.4 .

### 5 Experiments

Models and testbeds. We conducted all the experiments using MobileLLaMA-1.4B [], Vicuna-7B and Vicuna-13B []. We used 3 prompt tokens and 1 EPT per prompt token for all inference experiments. The inference throughputs of the models are evaluated on a single NVIDIA A100 GPU with 40GB of memory and a GeForce RTX 4090 using a batch size of 1 and FP16 precision. Further details about the experimental setup can be found in Appendix C.

Training. We froze all trainable parameters of the original LLM. Prompt token embeddings were trained using distillation logits generated from the ShareGPT dataset [], with a maximum context length of 1024, a cosine learning rate scheduler starting at 0.01, and no warmup. Prompt token embeddings are initialized with normal text token embeddings.

Datasets. We assess the throughput performance of PPD across various tasks and datasets. Specifically, we evaluated PPD using the MT-Bench dataset [], which contains multi-turn questions with a range of topics, in both non-greedy (temperature follows the default configuration) and greedy settings (temperature=0). We used the GSM8K [] and HumanEval [] datasets only in the greedy setting. The GSM8K dataset consists of grade school math problems and we used the first 500 questions of the test split for our evaluations. HumanEval includes coding tasks, for which we set a maximum new token limit of 512 to control the length of the generated sequences. We used the Alpaca [] dataset as the validation dataset to produce the latencies and acceptance lengths used for dynamic sparse tree construction.

#### 5.1 Speedup Comparison with Parallel Decoding Methods

Figure: Figure 4: Comparative evaluation of latency speedup between PPD and other parallel decoding methods. The experiments were conducted using the MT-Bench dataset, with the temperature set to MT-Bench’s default configuration for Medusa and PPD.
Refer to caption: x4.png

We compare the speedup ratios of PPD with state-of-the-art parallel decoding methods on MT-Bench in non-greedy settings in Figure 4. PPD achieves speedups up to 13.8% higher than Medusa and between 2 times and 3 times higher than other parallel decoding methods.
We examine the factors contributing to the enhanced speedup ratios and other performance metrics, as presented in Table 1.
The reasons for the increase in speedup ratios are two-fold. Firstly, PPD produces candidate tokens with a higher acceptance rate than Medusa when utilizing a sparse tree of the same size. Notably, PPD continues to achieve a comparable or slightly better acceptance rate even when employing a much smaller sparse tree – ranging from one-third to half the size. Secondly, PPD benefits from lower forward pass latency due to its ability to use smaller sparse tree sizes and hence shorter input lengths. PPD also eliminates the computational overhead associated with separate decoding heads. PPD maintains the same output quality, achieving about the same score on MT-Bench while using significantly fewer trainable parameters.

**Table 1: Comparative performance metrics of MobileLLaMA (M) for greedy setting, Vicuna-7B (V-7B) and Vicuna-13B (V-13B) for non-greedy setting using different decoding methods. The table details throughput ($T$ in tokens/s), average accept lengths ($\tau$ in tokens), forward pass latency ($L_{\text{fp}}$ in seconds), quality scores on MT-benchmark, percentages of additional trainable parameters ($P_{\text{tr}}$) and input lengths ($S_{\text{input}}$) after the prefilling phase. PPD employs a dynamic sparse tree with variable tree sizes ($S_{\text{tr}}$), represented as tuples. Same means the output matches with that of the original LLM.**
| Model | Method | $T$ | $\tau$ | $L_{\text{fp}}$ (s) | Quality | $P_{\text{tr}}$ (%) | $S_{\text{tr}}$ | $S_{\text{input}}$ |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| M | Vanilla | 50.2 | 1.00 | 0.020 | - | NA | NA | 1 |
| PPD | 108.7 | 2.43 | 0.022 | Same | 4.50$e^{-4}$ | (10,84,89) | (40,285,285) |  |
| V-7B | Vanilla | 39.2 | 1.00 | 0.026 | 5.99 | NA | NA | 1 |
| Medusa | 82.0 | 2.51 | 0.0307 | 5.98 | 8.07 | 63 | 63 |  |
| PPD | 88.0 | 2.54 | 0.029 | 5.93 | 1.82$e^{-4}$ | (10,33,34) | (40,105,105) |  |
| V-13B | Vanilla | 30.4 | 1.00 | 0.0330 | 6.38 | NA | NA | 1 |
| Medusa | 63.4 | 2.59 | 0.0408 | - | 5.52 | 63 | 63 |  |
| PPD | 66.1 | 2.44 | 0.0379 | 6.32 | 7.87$e^{-5}$ | (10,20,20) | (40,60,60) |  |

Figure 5 displays the throughput of PPD on MT-Bench, HumanEval, and GSM8K with temperature equal to 0. PPD achieves consistent walltime speedup ratios from 2.12$\times$ to 2.49$\times$ on different GPUs. In general, PPD performs better in coding and math reasoning tasks, achieving speedups between 2.21$\times$ and 2.49$\times$. This can be attributed to the fact that both code and math equations often contain fixed patterns and repetitive symbols, which narrows the range of plausible candidates and simplifies the prediction. We also found that with typical acceptance, the speedup increases with temperature. Another notable trend is that smaller models, such as Vicuna-7B, generally achieve more significant speedup ratios as compared to larger models, like Vicuna-13B.
PPD aims to generate more tokens per step, which comes with increased computational demands. For larger models that already require substantial computational resources, it is necessary to limit the size of the sparse tree to avoid exceeding the GPU’s utilization cap and causing increased latency. As a result, the number of tokens accepted per step is reduced, leading to lower speedups.
However, this can be amortized when using more powerful GPUs than the NVIDIA A100 and the RTX 4090, such as NVIDIA H100.

Figure: Figure 5: Throughput of PPD and vanilla models across different tasks. The temperature for experiments are set to 0 and the generated output of PPD exactly matches that of the original LLM. We do not show results of Vicuna-13B on RTX 4090 as it does not fit into the GPU memory.
Refer to caption: x5.png

#### 5.2 Long-range Token Prediction

Figure: (a) PD vs. Medusa
Refer to caption: x11.png

For a specific sparse tree, the accumulative accuracy provides a theoretical upper bound for the number of generated tokens per step and the maximum possible speedup ratio. Hence, maximizing accumulative accuracy is crucial for the effectiveness of PPD. Figure 6 demonstrates the accumulative accuracy of the tokens predicted at various positions. We summarize the following three key insights from the results.

PPD excels at predicting more distant tokens. As depicted in Figure 6(a), PPD consistently outperforms Medusa in accuracy across all token positions. The accuracy gap between PPD and Medusa widens with the increased token distance (e.g., the top-10 accuracy difference is 0.03 for the ‘next next’ word versus 0.12 for the ‘next next next next’ word). This improvement can be attributed to PPD’s ability to partially recover conditional dependency information through causally connected prompt tokens.

PPD performs well at generating a broader array of plausible token candidates. For example, in predicting the token at a token distance of 3, the top-10 candidates exhibit an accuracy improvement of 0.1 over Medusa, compared to only 0.02 for the top-1 candidate. This demonstrates the value of using tree attention and the largest viable tree size during inference, as multiple candidate continuations further boost accuracy improvement.

Multiple EPTs per prompt token and larger model sizes yield modest improvements in prediction accuracy. Figure 6(b) shows that using 100 EPTs per prompt token leads to accuracy improvement, ranging from 0.018 to 0.045.
Figure 6(c) displays that PPD with Vicuna-13B outperforms Vicuna-7B with an accuracy gain of 0.011$\thicksim$0.038. This increase is due to Vicuna-13B’s greater embedding dimensions and deeper layers, which enhance the expressive power of prompt tokens. However, these gains are modest and can be offset by the increased computational burden of larger models.

#### 5.3 Memory Efficiency and Synergistic Integrations with Speculative Decoding

Figure: Figure 7: Model memory usage.
Refer to caption: x14.png

Memory efficiency. As shown in Figure 7, we compare the memory overhead of PPD with the leading parallel decoding (Medusa) and speculative decoding approaches (Eagle). The memory overhead of PPD is just 0.004% of Medusa’s and 0.007% of Eagle’s. This efficiency stems from the efficient use of embeddings in PPD, which are significantly smaller than decoding heads and draft models, both of which scale with vocabulary size.

PPD + Speculative Decoding. As an orthogonal optimization in accelerating LLMs, PPD can be easily integrated with speculative decoding []. To demonstrate this, we applied PPD to Vicuna-68M [] and used it as the draft model for Vicuna-7B. This combination resulted in a speedup of up to 1.22$\times$ for speculative decoding on Vicuna-7B compared to using speculative decoding alone.

#### 5.4 Ablation Study

Dynamic Sparse Tree. Figure 8(a) shows that dynamic sparse trees consistently achieve longer acceptance lengths compared to static and random ones across varying sizes. The acceptance length for dynamic sparse trees shows a steady increase as the tree size extends, suggesting its good scalability. The convergence of dynamic and static sparse trees at larger sizes suggests a structural similarity emerging from constraints in tree depth and tree node count.

Hardware-aware Tree Size. Figure 8(b) presents the theoretical speedup across different GPUs. Figure 8(c) validates that the optimal sparse tree size, derived from theoretical speedup models, indeed results in the greatest actual speedup observed.

Figure: (a)
Refer to caption: x15.png

### 6 Conclusion

We introduced PPD, a memory-efficient, cost-effective, and powerful parallel decoding method that incorporates a hardware-aware dynamic sparse tree. Utilizing specially trained prompt tokens to predict long-range tokens accurately, PPD achieves a speedup of up to 2.49$\times$ in inference while employing only 0.0002% additional trainable parameters and without incorporating new models or architectural components. We believe that PPD offers a novel perspective on the capabilities of parallel decoding. In future work, it could be synergized with other speculative or parallel decoding techniques to expedite inference even further.

## 

### Appendix A Training Loss

Figure: (a) 3 prompt tokens, 1 EPTs
Refer to caption: x18.png

We study the training loss of PPD with different EPTs. Figure 9(a) shows that, with 3 prompt tokens and 1 EPT, the initial loss is quite high, starting above 5. There is a sharp decrease in loss within the first epoch, dropping below 2. After this initial drop, the loss stabilizes and oscillates around a value slightly below 2 for the remainder of the training epochs (up to epoch 12). The loss oscillations remain within a narrow range, indicating consistent performance. The fluctuation can be attributed to the insertion of prompt tokens at random positions.
On the other hand, Figure 9(b), with 3 prompt tokens and 100 EPTs, shows the initial loss starting below 3, significantly lower than PPD with 1 EPT. Similarly, there is a sharp decrease within the first epoch, with the loss dropping to around 2.5. However, unlike PPD with 1 EPT, the loss continues to decrease gradually over the epochs, showing a downward trend. This suggests that increasing the number of EPTs improves the model’s learning capacity and reduce training loss more effectively over time.

### Appendix B Extended Ablation Study

#### B.1 Effect of EPTs on Prediction Accuracy

**Table 2: Prediction Accuracy of PPD with different EPTs. ’@i’ denotes a token distance of i. ’Top-k’ denotes the top-k prediction accuracy. The results are obtained on Alpaca dataset with 20 steps.**
| EPT | @1 Top-1 | @1 Top-5 | @2 Top-1 | @2 Top-5 |
| --- | --- | --- | --- | --- |
| 100 | 0.506 | 0.794 | 0.276 | 0.602 |
| 50 | 0.502 | 0.791 | 0.281 | 0.604 |
| 20 | 0.501 | 0.791 | 0.276 | 0.607 |
| 10 | 0.494 | 0.786 | 0.273 | 0.600 |
| 5 | 0.499 | 0.787 | 0.265 | 0.596 |
| 2 | 0.486 | 0.777 | 0.259 | 0.583 |
| 1 | 0.472 | 0.771 | 0.248 | 0.576 |

Table 2 presents the prediction accuracy of PPD using different EPTs.
The results indicate that increasing the number of EPTs generally enhances the prediction accuracy of PPD, particularly for long-range token predictions. Higher EPT numbers (e.g., 100 and 50) consistently produce better prediction accuracy compared to lower EPT numbers.

#### B.2 Impact of Knowledge Distillation (KD), Epochs, and Batch Size on Prediction Accuracy

**Table 3: Prediction Accuracy for PPD with and without knowledge distillation (KD) for different EPTs, epochs, and batch sizes.**
| EPT | KD | Epoch | Batch | @1 Top-1 | @1 Top-5 | @2 Top-1 | @2 Top-5 |
| --- | --- | --- | --- | --- | --- | --- | --- |
| 100 | Yes | 1 | 4 | 0.504 | 0.793 | 0.273 | 0.598 |
| 100 | Yes | 2 | 4 | 0.512 | 0.797 | 0.288 | 0.611 |
| 100 | Yes | 6 | 4 | 0.520 | 0.802 | 0.302 | 0.620 |
| 100 | Yes | 8 | 4 | 0.524 | 0.804 | 0.307 | 0.619 |
| 100 | Yes | 10 | 4 | 0.523 | 0.804 | 0.305 | 0.623 |
| 100 | Yes | 12 | 4 | 0.525 | 0.805 | 0.308 | 0.625 |
| 100 | No | 12 | 4 | 0.506 | 0.794 | 0.276 | 0.602 |
| 100 | Yes | 12 | 1 | 0.530 | 0.809 | 0.309 | 0.626 |
| 1 | Yes | 12 | 1 | 0.484 | 0.775 | 0.259 | 0.581 |
| 1 | Yes | 2 | 4 | 0.474 | 0.773 | 0.247 | 0.574 |
| 1 | Yes | 6 | 4 | 0.480 | 0.773 | 0.250 | 0.580 |
| 1 | Yes | 8 | 4 | 0.484 | 0.778 | 0.257 | 0.583 |
| 1 | Yes | 10 | 4 | 0.482 | 0.777 | 0.257 | 0.584 |
| 1 | Yes | 12 | 4 | 0.485 | 0.779 | 0.261 | 0.586 |
| 1 | No | 12 | 4 | 0.472 | 0.771 | 0.248 | 0.576 |

Table 3 summarizes our results with different settings. We analyze the effect of each factor on the prediction accuracy in the following discussion.

##### B.2.1 Training Epochs

We first investigate the effect of the number of training epochs on prediction accuracy. For models using 100 EPTs with KD enabled and a batch size of 4, we observe a steady improvement in prediction accuracy as the number of epochs increases. Specifically, the Top-1 accuracy at a 1-token distance increases from 0.504 at 1 epoch to 0.525 at 12 epochs, while the Top-5 accuracy at a 1-token distance improves from 0.793 to 0.805. Similarly, Top-1 accuracy at a 2-token distance increases from 0.273 to 0.308, and Top-5 accuracy at a 2-token distance improves from 0.598 to 0.625 over the same range of epochs. This trend demonstrates the positive impact of prolonged training on the performance of PPD when KD is applied.

##### B.2.2 Knowledge Distillation

When KD is not applied, as shown for 100 EPTs at 12 epochs with a batch size of 4, the performance metrics are generally lower. The improvement in prediction accuracy with KD is up to 12%. This suggests that KD contributes significantly to prediction accuracy for PPD.

##### B.2.3 Effect of Batch Size

We also examine the impact of batch size on the prediction accuracy. For the model trained with 100 EPTs, KD enabled, and 12 epochs, reducing the batch size from 4 to 1 results in a slight improvement in prediction accuracy up to 1%.

#### B.3 Prefix Tuning + Prompt Token

Prefix tuning [], similar to prompt tuning, provides a parameter-efficient approach to fine-tune a pre-trained model. Unlike prompt tuning, it modifies the KV cache of every attention layer by prepending trained vectors. We hypothesize that the combination of prefix tuning and prompt tokens can lead to greater learning capacity and higher prediction accuracy. This hypothesis is based on the intuition that prompt tokens should see a different context than the input tokens when predicting long-range tokens. For example, if the input sequence is "Once upon a time", then enhancing the input with a prompt template might provide more suitable semantic context for long-range prediction. An enhanced input like "Predict the next-next token. Once upon a time" might empower the prompt token to predict the correct next-next token. Prefix tuning serves as the prompt template to enhance the hidden states visible to the prompt tokens.

Figure: Figure 10: ’P1’ is the prefix token for the prompt token ’S1’ and ’P2’ for ’S2’. ’C’ is the input token. The green tick means visibility during attention calculation. For instance, ’S1’ can see ’P1’ but cannot see ’P2’. ’C’ does not see any prefix tokens so the generated output corresponding to ’C’ is not altered by the use of prefix tuning.
Refer to caption: x20.png

To retain the original model’s distribution, we modify the attention mask so that prefix tokens are only visible to prompt tokens. This ensures that we can generate outputs that preserve the original model’s distribution. We posit that prompt tokens at different positions should see different contexts so we allow a prompt token at a specific position to see a distinct set of prefix tokens, as shown in Figure 10.

**Table 4: Prediction Accuracy of PPD with and without prefix tuning. 1 EPT is used for all models and 1 prefix token is used for prefix tuning.**
| Prefix Tuning | @1 Top-1 | @1 Top-5 | @2 Top-1 | @2 Top-5 |
| --- | --- | --- | --- | --- |
| No | 0.485 | 0.779 | 0.261 | 0.586 |
| Yes | 0.412 | 0.738 | 0.204 | 0.541 |

Table 4 compares the prediction accuracy of PPD with and without the use of prefix tuning. The results show that the models without prefix tuning outperform those with prefix tuning up to 28%, which suggests that, in this setup, prefix tuning does not enhance the prediction accuracy of PPD. Instead, it appears to degrade performance, potentially due to the complexity introduced by modifying the KV cache of attention layers with the prefix token. Unlike prompt tokens, prefix tokens do not interact with input tokens, meaning they do not change dynamically through the transformer layers based on the input context. This lack of interaction and dynamic adjustment could be a factor contributing to the decreased prediction accuracy observed with prefix tuning.

#### B.4 Custom Decoding Heads + Prompt Token

It has been demonstrated that a fine-tuned decoding head alone can effectively predict long-range tokens [, ]. Thus, we hypothesize that combining a separately fine-tuned decoding head with prompt tokens might further enhance the potential of PPD. As shown in Figure 11, we trained a separate decoding head to transform only the hidden states of prompt tokens into logits. A key distinction from Medusa is that this decoding head is responsible for generating tokens at multiple positions, rather than just one.

Figure: Figure 11: Custom decoding head with PPD. The feature extractor refers to the LLMs without the decoding heads. ’H1’ is the generated hidden state for the input token ’C’. ’H2’ is the hidden state for the prompt token ’S1’ and ’H3’ for ’S2’. ’LM1’ is the original LLM’s decoding head and it takes in the hidden states of input tokens. ’LM2’ is the custom decoding heads for PPD and only takes in the hidden states of prompt tokens.
Refer to caption: x21.png

We propose two training methods. In the first method, the custom decoding head and prompt tokens are trained together from scratch in a single stage. In the second method, the prompt tokens are initially trained for 2 epochs, followed by training both the prompt tokens and the decoding head with a smaller learning rate in a two-stage process.

**Table 5: Prediction Accuracy of PPD with and without custom decoding head. 1 EPT is used for all models. 1-stage and 2-stage refer to the training strategies of custom decoding head.**
| Method Name | @1 Top-1 | @1 Top-5 | @2 Top-1 | @2 Top-5 |
| --- | --- | --- | --- | --- |
| PPD without custom decoding head | 0.485 | 0.779 | 0.261 | 0.586 |
| PPD with custom decoding head (1-stage) | 0.385 | 0.614 | 0.229 | 0.482 |
| PPD with custom decoding head (2-stage) | 0.506 | 0.795 | 0.276 | 0.602 |

Table 5 presents the prediction accuracy of PPD with and without a custom decoding head. When trained using the single-stage method, PPD with the custom decoding head shows a 12%-21% decrease in prediction accuracy compared to the baseline PPD without the custom decoding head. This suggests that the single-stage approach does not result in stable or effective training.

In contrast, the two-stage training method results in a limited improvement of 2.1%-4.3% in prediction accuracy compared to the baseline. This suggests that adding a custom decoding head may not be necessary, given the additional trainable parameters and the limited improvement in prediction accuracy.

#### B.5 Attention Masking for EPTs

In this paper, we proposed a specialized attention mask for EPTs to achieve the effect of prompt ensemble. However, there are alternative masking strategies available. Here, we describe and compare three types of attention masks that we implemented and experimented with.

Figure: (a) Ensemble Attention Mask
Refer to caption: x22.png

##### B.5.1 Ensemble Attention Masking

The ensemble attention masking is the masking strategy we previously described. In this approach, EPTs are divided into $n$ disjoint groups, where $n$ is the number of EPTs per prompt token. All $k^{th}$ EPTs across prompt tokens are placed in the same group. An EPT $v$ in group $i$ can only attend to EPTs that meet the following two criteria: 1) they must belong to group $i$, and 2) their position indices must be smaller than the position index of $v$. Since this masking strategy effectively averages the results of disjoint groups of EPTs, we refer to it as the "ensemble attention masking". Figure 12(a) provides an example of the ensemble attention masking.

##### B.5.2 Decoder-like Attention Masking

Decoder-like attention masking is a simple strategy where EPTs can only attend to EPTs with smaller position indices. This results in a triangular-shaped attention mask, similar to the one used in decoder layers, hence the name "decoder-like attention masking".
Figure 12(b) provides an example of this masking strategy.

##### B.5.3 Encoder-like Attention Masking

In encoder-like attention masking, an EPT corresponding to a prompt token $P$ can attend to all EPTs with smaller position indices as well as all EPTs associated with $P$. This allows EPTs to see both preceding and succeeding EPTs, similar to the token visibility in an encoder layer, hence the name "encoder-like attention masking". Figure 12(c) illustrates this masking strategy.

##### B.5.4 Results

**Table 6: Prediction Accuracy of PPD with different attention masking strategies for EPTs. 100 EPT is used for all models.**
| Method Name | @1 Top-1 | @1 Top-5 | @2 Top-1 | @2 Top-5 |
| --- | --- | --- | --- | --- |
| PPD with ensemble attention mask | 0.506 | 0.794 | 0.276 | 0.602 |
| PPD with decoder attention mask | 0.465 | 0.755 | 0.262 | 0.572 |
| PPD with encoder attention mask | 0.473 | 0.765 | 0.256 | 0.573 |

The results in Table 6 indicate that the ensemble attention mask outperforms the other masking strategies. In comparison, the PPD with decoder attention mask shows 4.9%-8.0% lower prediction accuracy. The PPD with encoder attention mask also underperforms in prediction accuracy relative to the ensemble attention mask by 3.7%-7.2%.

These results suggest that the ensemble attention mask is the most effective strategy among the three, likely due to its ability to effectively average the votes of disjoint groups of EPTs, thereby improving prediction accuracy. The decoder-like and encoder-like attention masks, while simpler, do not provide the same level of performance, indicating that the structure and specificity of the ensemble attention mask better facilitate accurate long-range token prediction. Additionally, ensemble attention masking is more sparse, which offers greater potential for optimization.

#### B.6 Aggregation Method for EPTs

In addition to simply averaging the logits from EPTs, we explored more advanced aggregation methods. For instance, we applied learned weights to aggregate the logits. The final logit $p$ can be expressed as:

$$ $p=\sum_{i=1}^{n}w_{i}\cdot p_{i},$ $$

where $n$ is the number of EPTs and $w_{i}$ is the learned scalar weight for the $i^{th}$ EPT.

**Table 7: Prediction Accuracy of PPD with different aggregation methods for EPTs. 100 EPT is used for all models.**
| Aggregation Method | @1 Top-1 | @1 Top-5 | @2 Top-1 | @2 Top-5 |
| --- | --- | --- | --- | --- |
| Average | 0.506 | 0.794 | 0.276 | 0.602 |
| Learned Weight | 0.503 | 0.779 | 0.250 | 0.576 |

The results in Table 7 show the prediction accuracy of PPD with two different aggregation methods for EPTs: simple averaging and learned weights.
When using learned weights to aggregate logits, the model shows a slight decrease of 0.6%-9.4% in prediction accuracy.

These results suggest that while learned weights provide a more flexible aggregation method, they do not necessarily lead to improved prediction accuracy in this context. The simplicity and stability of the averaging method appear to offer better performance, possibly due to the additional complexity and potential overfitting introduced by learning the weights.

#### B.7 Multi-exit Ensemble

While using EPTs for prompt ensemble improves prediction accuracy, it also increases input length, resulting in higher computational overhead and forward pass latency. To address this, we propose the use of a multi-exit ensemble method. In multi-exit ensemble, the hidden states of a prompt token from the last $k$ decoder layers are extracted and averaged to produce the final hidden state, which is then decoded by the decoding head into a guess token, as illustrated in Figure 13. This approach achieves prompt ensemble without the associated computational costs.

Figure: Figure 13: Mult-exit ensemble. ’D1’, ’D10’, ’D11’, and ’D12’ are the decoder layers in order. ’S1’ is a prompt token and ’H1’, ’H2’, ’H3’ are the corresponding hidden states from the last 3 decoder layers. ’H4’ is obtained from averaging these 3 hidden states. The decoding head ’LM’ translates ’H4’ into a token ’E’.
Refer to caption: x25.png

The hypothesis is that taking the hidden states from the last few decoder layers for ensemble might work because these layers capture increasingly abstract and high-level representations of the input sequence. By averaging the hidden states from multiple layers, we can combine diverse but complementary information, leading to a more robust and accurate final hidden state. Additionally, since the final layers are closest to the output, they are more likely to contain refined and contextually relevant information, making the ensemble more effective.

**Table 8: Prediction Accuracy of PPD with and without multi-exit ensemble. 1 EPT is used for all models. $k$ exits refer to the number of exits used.**
| Method Name | @1 Top-1 | @1 Top-5 | @2 Top-1 | @2 Top-5 |
| --- | --- | --- | --- | --- |
| PPD without multi-exit | 0.485 | 0.779 | 0.261 | 0.586 |
| PPD with 3 exits | 0.422 | 0.723 | 0.214 | 0.517 |
| PPD with 2 exits | 0.420 | 0.723 | 0.213 | 0.518 |

Table 8 shows the comparison of prediction accuracy of PPD with and without mult-exit ensemble. The results indicate that the introduction of multi-exit ensemble with both 2 and 3 exits results in a 7%-18% decrease in prediction accuracy compared to the baseline model without multi-exit.

These findings suggest that the multi-exit ensemble approach, as implemented, does not enhance prediction accuracy and instead leads to a notable decrease in performance. This may be due to the averaging of hidden states from multiple layers introducing noise or reducing the specificity of the representations needed for accurate prediction. Further refinement of the multi-exit ensemble may be necessary to achieve the desired improvements in accuracy.

### Appendix C Experiment Details

For the throughput experiments, each result is obtained by averaging three separate runs. The standard deviations of these runs are reported as error bars in the bar charts. To ensure a fair comparison in our comparative experiments, we maintained consistent hardware settings and software versions.

We selected 3 prompt tokens because adding more would not further increase the expected acceptance length due to the tree size limit. The number of EPTs per prompt token was optimized to maximize throughput.

In Fig. 2, the temperature settings for PPD, Eagle [], and Medusa [] follow the default configuration, while the other models use a greedy setting (temperature=0). This choice is based on findings that retrieval-based methods perform significantly worse in non-greedy settings. Similarly, LOOKAHEAD DECODING [], REST [], and PLD [] in Fig. 4 also use a temperature setting of 0 for the same reasons.

### Appendix D Limitations

Despite its efficiency, we have identified the following limitations of PPD:

- 1.
Low prediction accuracy for very small models. We found that for very small models like Vicuna-68M [], which only has 2 decoder layers and an embedding dimension of less than 1000, PPD suffers from low prediction accuracy. This is because the embedding dimension determines the expressive power of a prompt token, and the transformer architecture’s depth is crucial for efficient information flow to the prompt tokens.
- 2.
GPU compute resource constraint. Since PPD trades additional compute resources for increased throughput, its effectiveness depends on the availability of idle GPU compute resources. On a GPU with limited compute resources, the speedup ratios achieved by PPD are expected to decrease.
- 3.
Extended input length. The improvement in acceptance length with PPD is not as significant as the gain in prediction accuracy compared to Medusa. This is because PPD must reserve a substantial portion of the input for prompt tokens, which limits the size of the sparse tree that can be used.

### Appendix E Societal Impact

In this paper, we proposed PPD to accelerate LLMs easily and cheaply. Since PPD reduces the time required for handling a single inference request, it could bring down the cost of deploying LLMs for both the companies and the public. This might lead to increased accessibility of LLM services. Moreover, latency-sensitive applications like chatbots will benefit greatly from the usage of PPD as it reduces the inference latency greatly, thereby enhancing the user experience.

While PPD aims to make AI more accessible, there may still be a digital divide where certain communities lack the necessary infrastructure, such as stable internet connections or modern hardware, to fully benefit from these advancements. This could further widen the gap between technology-privileged and underserved populations. On the other hand, PPD might be misused by malicious parties to manipulate the output of the original LLM, resulting in the generation of unreliable information and fake data.

## Peer Reviews

confidence: 3
contribution: 3
initial_rating: 6
presentation: 3
questions: None (The methodology and evaluation was very clear)
soundness: 3
strengths: - They present a prompt token-based method to adapt the model to perform parallel tree decoding. These tokens are appended to the end of the sequence and tuned to allow for predicting multiple tokens into the future by approximating tokens generated at future timesteps in order to recover missing conditional dependency information.
- Their hardware-aware sparse algorithm dynamically allocates more or fewer tokens to particular branches depending on their probability, and also incorporates hardware constraints when mapping out the tree
- They show significantly lower training time (and number of trainable parameters) relative to existing approaches like Medusa
- They present clear and comprehensive evaluation of their approach in terms of latency as well as memory usage (including inference efficiency as well as training time and memory considerations)
  - This evaluation also includes ablation of different components of their approach (eg. justifying the benefits of tree attention, as well as of their hardware-aware decoding algorithm)
- They also demonstrate that their approach is complementary with existing speculative decoding methods.
summary: This paper proposes a parallel decoding algorithm which approximates future outputs in parallel during generation. They leverage multiple prompt tokens which allow for generating outputs at future timesteps. This approach is similar to prefix tuning, where they append trainable prompt tokens to to predict multiple timesteps in advance (although the future prompt tokens are appended at the end of the prompt). They also leverage a dynamic sparse tree search method that allocates a greater number of prompt tokens to more promising candidate sequences. Their method yields comparable results with other parallel decoding methods with fewer trainable parameters / shorter training time. They also outline how their method can be combined with speculative decoding to increase the efficiency gains from this approach.
weaknesses: - The inference-time speedups relative to other prior decoding approaches like Medusa are relatively minor
- Their approach requires fine-tuning, which may make it harder to adapt for different end use cases depending on training availability  (relative to speculative decoding methods)
- The memory savings at inference time of their approach relative to Medusa is smaller for larger models

---

confidence: 4
contribution: 1
initial_rating: 3
presentation: 4
questions: Unlike some other submission, this one has no implementation code.  I wonder if a private code repository could be provided for review purposes?

The paper is not making a complete comparison with SoTA methods like Eagle. Eagle is mentioned in related work and compared in Table 2 on training duration metric. However, for practitioners, the key metric would be the speedup. Extra RAM and training time may often not be the limited factors. Moreover, pretrained Eagle weights could be downloaded for popular models in seconds. See https://github.com/SafeAILab/EAGLE for the download links.

Could you provide results of your method for more modern models, like Qwen and Llama-3? While Vicuna has been a popular testing base for speculative decoding in the past papers, modern practitioners would be more interested in performance of the method with open source models which are in the top of popular benchmarks.
soundness: 2
strengths: Some secondary contributions are deserving positive mention, namely hardware-aware optimisation.

Analysis of accuracy across token positions is helpful in determining the method's performance drivers
summary: This paper looks well written and nicely presented. 

Unfortunately its claim for novelty may be challenged, since the main idea of Parallel Prompt Decoding practically overlaps with one in BiTA paper (https://arxiv.org/html/2401.12522v2), published early this year. It uses the same core idea of learnable tokens fed to transformer model to generate speculative continuation. Below is a quote from BiTA paper method description:
"Thanks to the transformer architectures of LLMs, we leverage multiple learnable placeholder tokens known as mask tokens, empowering language models to generate subsequent consecutive future tokens beyond the last input token. During training and inference, the mask tokens are tasked with producing the probability of their next token in corresponding positions."

Now both papers have somewhat different optimisations applied to the core idea. To name a few: BiTA has learnable prefixes, and tree-based decoding. This paper has hardware-aware optimisation.  The speedup range is comparable, with BiTA claiming 2.54x for Vicuna 13B and this paper claiming 2.49x for the same model, though the measurement methodologies differ.
weaknesses: The paper's claim for novelty may be challenged, since the main idea of Parallel Prompt Decoding practically overlaps with one in BiTA paper (https://arxiv.org/html/2401.12522v2), published early this year. It uses the same core idea of learnable tokens fed to transformer model to generate speculative continuation. Below is a quote from BiTA paper method description:
"Thanks to the transformer architectures of LLMs, we leverage multiple learnable placeholder tokens known as mask tokens, empowering language models to generate subsequent consecutive future tokens beyond the last input token. During training and inference, the mask tokens are tasked with producing the probability of their next token in corresponding positions."

Besides an number of weaknesses are probed in the Questions section, namely:
- Lack of proper comparison with Eagle - see Questions section
- Absence of source code (UPD - code found)

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 2
questions: 1. Could you provide more details on how multi-EPT is trained and used?
2. Could you clarify the x-axis of Fig. 8(a)? It is explained as tree size in 5.4, but decoding 500 branches with just 2.6 average acceptance looks weird.
3. How to combine PDD with speculative decoding and get 1.22x speedup? Did you run draft model on the same GPU? Did you split the verify and next guess into two phases?
soundness: 2
strengths: 1. PPD effectively uses pre-trained prompt tokens as placeholders, allowing LLM to generate multiple tokens in parallel and significantly boosting throughput.
2. By using prompt tokens instead of changing the model, PPD achieves a state-of-the-art acceptance rate with minimal training overheads.
3. By merging the "Verify" and "Next Guess" steps into a single model execution, PPD improves processing speed and maximizes inference efficiency.
4. PPD incorporates both online and offline decoding tree optimizations, which help maximize performance across various hardware setups.
summary: This paper presents Hardware-Aware Parallel Prompt Decoding (PPD), a framework designed to accelerate large language model (LLM) inference by leveraging a guess-and-verify process inspired by speculative decoding. PPD introduces a sequence of trained placeholder embeddings, known as prompt tokens, enabling the LLM to generate multiple tokens in parallel within a single forward pass, improving resource utilization and benefiting throughput. These tokens are then verified simultaneously. Compared with changing the model, using pre-trained embeddings incorporates minimal memory and computation costs in both training and inference while achieving a high acceptance rate. 

To optimize performance across different hardware, the authors also implement both offline and online tree pruning strategies, ensuring efficient parallel processing on varied platforms. Evaluations on 1.4B, 7B and 13B models demonstrate that PPD delivers up to a 2.49x speedup over standard autoregressive models and a 1.07x improvement over the state-of-the-art Medusa framework, with only half of Medusa's training time requirements.
weaknesses: 1. ***Modest Improvement over SOTA***: While PPD achieves a notable 2.49x speedup over autoregressive models, its 1.07x advantage over Medusa is less impressive. Given that training Medusa is a one-time effort, the slight difference in training time (1.24 vs. 0.52 hours) may not justify the switch for all use cases. Consider the guessing of Medusa only happens on the last stage, **LMHeads**, PDD introduces more decoding workload as each guess is generated through the entire model. This approach may not sustain speedup benefits on larger models or when handling multiple concurrent requests on hardware with high utilization.
2. ***Accuracy on Larger Models is Unclear***: The acceptance length of PPD decreases when moving from Vicuna-7B to Vicuna-13B, and accuracy lags behind Medusa’s. The paper also only presents cumulative accuracy compared with Medusa on 7B model. Further evaluation on larger models (>30B) would help determine if prompt tokens remain effective at greater scales. 
3. ***Limited Hardware-Awareness***: While PPD includes hardware-aware tree pruning, the optimization is based solely on forward latency for a single request (batch_size=1). The framework’s effectiveness in more congested or multi-request dynamic environments is unclear and warrants further testing.
4. ***Possibly More Incorrect Guesses***: Though merging "Verify" and "Next Guess" improves hardware utilization, it also means the next guess is based on a set of unverified tokens (guessed in the last cycle). It will increase the distance between an accepted token and next token to guess, and cause additional unnecessary computations as only one of those branches is accepted in the end but PDD has decoded on all the branches.

---

confidence: 3
contribution: 3
initial_rating: 5
presentation: 3
questions: My concerns are listed above.
soundness: 3
strengths: PPD demonstrates substantial speed improvements, achieving up to 2.49× speedup with a minimal runtime memory overhead of just 0.0004%. It also shows potential for synergistic integration with existing speculative decoding methods, leading to further speed enhancements.
summary: The main contributions of the proposed Parallel Prompt Decoding (PPD) method are as follows:

1. PPD introduces prompt tokens that are inserted during the decoding process and achieves a high acceptance rate for long-distance token predictions while preserving output quality. This approach was demonstrated to be parameter-efficient, only requiring tuning a fraction of the parameters.

2. PPD introduces a Hardware-Aware Two-Stage Tree Pruning algorithm, which incorporates a hardware-aware two-stage tree pruning technique that adaptively optimizes the prompt structure of PPD at runtime based on the available compute and memory resources. This allows for efficient deployment across various hardware platforms.

The initial stage is performed offline before the model is deployed. The goal is to reduce the number of prompt tokens in the tree to achieve an optimal tree size. Then the pruning consists of two phases:

1. Candidate Trees Construction: Building trees using only candidate tokens at varying depths, employing algorithms from previous works (e.g., Medusa and Sequoia) to maximize a specific function related to the tree structure.
2. Prompt Tokens Appending: Attaching the maximum allowable prompt tokens to each candidate token from the first step, thereby optimizing the tree structure for better performance.
weaknesses: 1. As shown in Figure 7b, most of the speedup is from the tree attention technique introduced in Miao 2024. The speedup without it seems to be very moderate.

2. Since the speedup mainly relies on the tree attention part, this casts doubt on the effectiveness of using prompt tokens instead of a more direct approach such as Medusa. While the author claims the method to be hardware-aware, there are no detailed studies on how hardware changes affect the workload and thus affect the results presented in the experiments.

Meta-review: This paper presents Hardware-Aware Parallel Prompt Decoding (PPD). PPD introduces prompt tokens, enabling the LLM to generate multiple tokens in parallel within a single forward pass. PPD also adopts the idea of tree-structured verification, in which proposed tokens are verified simultaneously, with hardware awareness.

However, 3 out of 4 reviewers raise concerns in:
1. the novelty of this paper is somehow limited. Reviewers find key components of this paper,  e.g.,the use of prompt tokens and parallel verification, sharing ideas with existing papers,
2. 2 reviewers find the evaluation of this paper weak, and the results are not substantial. Baseline methods (published 6 months - 12 months ago) achieved a similar speedup. The models and datasets evaluated in this paper were not quite up-to-date.

Decision: Reject