Abstract
Modern Large Language Model (LLM) inference is primarily constrained by the sequential nature of autoregressive decoding, where tokens are generated one by one. Existing acceleration techniques, such as speculative decoding or layer skipping, often introduce significant memory overhead or sacrifice output quality. This paper introduces AdaDecode, a novel decoding strategy that achieves up to 1.73× speedup while maintaining bit-for-bit output parity with the original model. By utilizing lightweight intermediate heads and a unique vertical parallelization scheme, AdaDecode overlaps the computation of subsequent tokens with the remaining layers of current tokens, maximizing hardware utilization without the need for auxiliary drafter models.
1. Introduction
The primary bottleneck in deploying Large Language Models (LLMs) is the autoregressive decoding process. Because each new token depends on the hidden states of all previous tokens, hardware resources often remain underutilized while waiting for sequential computations to complete.
To address this, researchers have previously proposed two main categories of solutions:
- Speculative Decoding: This involves using a smaller "drafter" model to predict a sequence of tokens, which the larger "target" model then verifies. However, finding an appropriate drafter is difficult, and maintaining two models in memory increases operational complexity.
- Layer Skipping: This approach skips certain layers to reduce latency. While faster, it often degrades the quality of the output and fails to maintain the Key-Value (KV) cache consistency required to match the original model's performance.
AdaDecode bridges this gap by providing the speed benefits of layer skipping with the rigorous accuracy of speculative decoding, all within a single-model framework.
2. Methodology
AdaDecode introduces Adaptive Layer Parallelism, a framework built on three core technical pillars:
2.1 Lightweight Intermediate Heads
AdaDecode identifies that many tokens (e.g., common stop words or suffixes) can be accurately predicted well before the final layer of a deep LLM. To exploit this, the authors insert tiny "heads" at intermediate layers. Rather than training a full vocabulary head for each exit point, AdaDecode uses a learnable transformation matrix that maps intermediate hidden states to the existing final-layer head. This approach is highly parameter-efficient, requiring 31× fewer parameters than a standard head and adding only about 0.6% total parameters to an 8B model.
2.2 Vertical Acceleration
Unlike traditional speculative decoding which attempts to predict a horizontal sequence of future tokens, AdaDecode employs vertical acceleration. When an intermediate head predicts a token with high confidence (exceeding a threshold $\gamma$), the system triggers an "early exit."
Crucially, the computation for the current token does not stop. Instead, the remaining layers for the current token are deferred and executed in parallel with the initial layers of the next token. This overlapping of depth-wise computation ensures that the GPU remains saturated and the KV cache for all layers is eventually populated, preserving the model's internal state.
2.3 Modified Rejection Sampling
To guarantee that the accelerated output is identical to standard decoding, AdaDecode incorporates a verification step. The predictions made by intermediate heads are checked against the logic of the final layer. If a discrepancy is detected, a modified rejection sampling scheme corrects the prediction, ensuring the final output follows the original model's probability distribution exactly.
3. Experimental Evaluation
3.1 Setup
The authors evaluated AdaDecode using instruction-tuned models including Llama-3.1-8B, CodeLlama-13B, and CodeLlama-34B. The benchmarks covered three distinct domains:
- XSum: Extreme summarization of news articles.
- HumanEval: Python code generation (fine-tuned on MBPP).
- GSM8K: Multi-step grade-school math reasoning.
3.2 Key Results
- Throughput Gains: AdaDecode achieved a peak speedup of 1.73× on CodeLlama-34B during code generation tasks.
- Output Parity: The system maintained a 100% consistency ratio, meaning the generated text is bit-for-bit identical to vanilla autoregressive decoding.
- Prediction Accuracy: Using a confidence threshold of 0.85, the system successfully accepted approximately 94% of early predictions, demonstrating that intermediate layers are highly reliable indicators of final token selection.
- Deployment Efficiency: Because it does not require a separate drafter model, AdaDecode is significantly easier to deploy in memory-constrained environments compared to standard speculative decoding.
4. Discussion and Future Work
AdaDecode represents a significant step forward in making LLM inference more efficient without compromising the integrity of the model's output. By focusing on vertical parallelism, it avoids the "lucky guess" dependency of horizontal speculative decoding.
While AdaDecode is an acceleration-only method and does not improve the underlying reasoning capabilities of the model, its minimal parameter overhead (approx. 48M parameters for an 8B model) makes it a practical addition to existing pipelines. Future research directions include combining AdaDecode with weight quantization and model pruning, as well as exploring tree-based verification to further enhance the speedup potential.
5. Conclusion
AdaDecode effectively mitigates the autoregressive bottleneck by adaptively overlapping computations across the model's depth. By ensuring output parity and achieving substantial speedups without the complexity of auxiliary models, it provides a robust and scalable solution for high-performance LLM inference.
Summary updated