[Paper Review] Hardware-Aware Parallel Prompt Decoding for Memory-Efficient Acceleration of LLM Inference
This paper proposes Parallel Prompt Decoding (PPD), a memory-efficient, hardware-aware method for accelerating LLM inference by using a small number of trainable prompt tokens to generate multiple output tokens in parallel. PPD achieves up to 2.49× speedup with only 0.0002% additional trainable parameters and 0.0004% runtime memory overhead, while enabling synergistic integration with speculative decoding for further gains.
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$% 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$ imes$ speedup and maintains a minimal runtime memory overhead of just $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 imes$ further speed improvement. Our code is available at https://github.com/hmarkc/parallel-prompt-decoding.
Motivation & Objective
- Address the high memory and training cost of speculative decoding in LLM inference, especially for edge and mobile deployment.
- Overcome the limitations of existing non-autoregressive decoding methods that rely on conditional independence or placeholder tokens, leading to low accuracy.
- Develop a lightweight, architecture-agnostic solution that enables parallel multi-token generation without introducing new models or structural changes.
- Minimize both training cost and runtime memory overhead while maximizing acceptance rate for long-range predictions.
- Enable hardware-aware optimization of the decoding process to adapt to diverse GPU platforms and maximize performance.
Proposed method
- Introduce trainable prompt tokens that are appended to the input sequence in parallel to enable concurrent generation of multiple output tokens in a single forward pass.
- Use a dynamic sparse tree mechanism with a customized tree attention mask to generate multiple candidate continuations per prompt token, minimizing computation and memory overhead.
- Leverage causally connected prompt tokens to partially recover missing conditional dependency information, improving prediction accuracy for long-range tokens.
- Implement a hardware-aware dynamic sparse tree that adaptively refines the prompt structure during inference based on available computational resources.
- Train the prompt tokens using a lightweight tuning strategy requiring only 0.0002% of the base model's parameters, enabling training on a single A100-40GB GPU in 16 hours.
- Integrate PPD as an orthogonal optimization with existing speculative decoding, enhancing speedup without increasing model complexity.
Experimental results
Research questions
- RQ1Can a lightweight, prompt-based method achieve high-accuracy, parallel multi-token generation in LLM inference without relying on a separate draft model?
- RQ2To what extent can trained prompt tokens recover conditional dependency information for long-range sequence prediction?
- RQ3How does the dynamic sparse tree structure improve acceptance rates and reduce memory and computation overhead compared to static or random tree structures?
- RQ4What is the optimal trade-off between model size, number of prompt tokens, and prediction accuracy in the PPD framework?
- RQ5Can PPD be effectively combined with speculative decoding to achieve further speedup with minimal additional cost?
Key findings
- PPD achieves up to 2.49× speedup in LLM inference across models including MobileLlama, Vicuna-7B, and Vicuna-13B, with minimal hardware overhead.
- The method incurs only 0.0004% runtime memory overhead and requires just 0.0002% of the base model’s trainable parameters, enabling training on a single A100-40GB GPU in 16 hours.
- PPD improves acceptance rate by up to 28% for long-range predictions compared to baseline methods, especially for distant tokens (e.g., 0.12 higher top-10 accuracy at distance 4).
- The dynamic sparse tree technique consistently outperforms static and random tree structures, with acceptance length increasing steadily as tree size grows.
- When integrated with speculative decoding, PPD provides an additional 1.22× speedup on Vicuna-7B, demonstrating strong synergistic potential.
- Memory efficiency is significantly higher than Medusa and Eagle, with PPD’s memory overhead at just 0.004% of Medusa’s and 0.007% of Eagle’s.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.