Introduction
Large Language Models (LLMs) have revolutionized natural language processing, but their autoregressive nature—generating text token-by-token—makes them computationally expensive and slow for real-time applications. While "early exit" strategies have been proposed to mitigate this by stopping computation once a token's representation is deemed sufficient, they often fail in production environments. SkipDecode addresses the critical gap between theoretical early-exit speedups and actual wall-clock time savings by introducing a policy compatible with batching and Key-Value (KV) caching.
The Bottlenecks of Early Exit
Existing dynamic early-exit methods, such as CALM, encounter two primary obstacles in high-throughput serving:
- Batching Incompatibility: Standard early-exit models allow each sequence in a batch to exit at different layers. However, hardware accelerators (GPUs/TPUs) process batches synchronously; the entire batch must wait for the slowest sequence to finish all required layers, nullifying the benefits of skipping compute for "easier" tokens.
- KV Caching Inconsistency: Efficient inference relies on KV caches to store previous token representations. If a subsequent token exits at a deeper layer than its predecessors, the attention mechanism lacks the necessary historical context at that depth, breaking the autoregressive chain.
SkipDecode: A Structured Exit Policy
SkipDecode overcomes these issues by replacing dynamic, per-token classifiers with a structured, predictable exit policy.
Unified and Monotonic Exit Points
To ensure batching compatibility, SkipDecode enforces a single exit point for all sequences within a batch at any given position. Furthermore, it employs a monotonically decreasing exit function. By ensuring that a token never exits at a higher layer than the one preceding it, the KV cache remains consistent across the sequence.
Skipping vs. Early Termination
Unlike traditional methods that terminate computation at lower layers, SkipDecode utilizes a "skipping" approach. It performs an initial "warmup" (typically the first layer), skips intermediate layers, and then executes the final top layers of the model. This allows the model to produce hidden states in the same high-level representational space as the full model, bridging the "representation gap" that often degrades the performance of early-exit systems.
Empirical Foundation: The Entropy Decay Intuition
The design of SkipDecode is rooted in the observation of "entropy decay" in autoregressive generation. As a sequence progresses, the model gains more context, making subsequent tokens easier to predict. Empirical evidence shows that per-token loss generally decreases as the token position increases.
By leveraging this intuition, SkipDecode applies a linear decay function to the exit points: it allocates more compute to the context-poor early tokens and progressively less to the context-rich later tokens.
Experimental Results
The researchers evaluated SkipDecode using OPT-1.3B and OPT-6.7B models across benchmarks including E2E (structured-to-text), Reddit-TLDR (summarization), and CNN-DM (news summarization).
Key findings include:
- Significant Speedups: SkipDecode achieved 2x to 5x wall-clock speedups compared to standard batched inference with KV caching.
- Performance Stability: On the E2E dataset, the model maintained its Rouge-L score even at a 3x speedup. On more complex tasks like CNN-DM, performance remained stable up to a 2x speedup before a gradual decline.
- Superiority over Adaptations: SkipDecode significantly outperformed naive adaptations of existing methods (like CALM-DEC), proving that its skipping mechanism is better suited for decoder-only architectures.
Discussion and Future Work
SkipDecode provides a predictable computational budget, which is essential for meeting Service Level Agreements (SLAs) in production. However, some limitations remain. The current linear decay policy is tied to absolute sequence position, which may not support "infinite" generation or account for varying prompt difficulty. Future research may explore alternative decay functions or hybrid policies that combine the predictability of SkipDecode with the flexibility of dynamic methods.
Summary updated