Skip to main content
QUICK REVIEW

[Paper Review] SkipDecode: Autoregressive Skip Decoding with Batching and Caching for Efficient LLM Inference

Luciano Del Corro, Allie Del Giorno|arXiv (Cornell University)|Jul 5, 2023
Topic ModelingComputer Science7 citations
TL;DR

SkipDecode is a novel token-level early exit method for autoregressive LLM inference that enables efficient batching and KV caching by using monotonically decreasing exit points across sequence positions. It achieves 2x–5x speedups with negligible performance drop by bypassing lower layers and concentrating compute on upper layers, ensuring compatibility with practical deployment pipelines.

ABSTRACT

Autoregressive large language models (LLMs) have made remarkable progress in various natural language generation tasks. However, they incur high computation cost and latency resulting from the autoregressive token-by-token generation. To address this issue, several approaches have been proposed to reduce computational cost using early-exit strategies. These strategies enable faster text generation using reduced computation without applying the full computation graph to each token. While existing token-level early exit methods show promising results for online inference, they cannot be readily applied for batch inferencing and Key-Value caching. This is because they have to wait until the last token in a batch exits before they can stop computing. This severely limits the practical application of such techniques. In this paper, we propose a simple and effective token-level early exit method, SkipDecode, designed to work seamlessly with batch inferencing and KV caching. It overcomes prior constraints by setting up a singular exit point for every token in a batch at each sequence position. It also guarantees a monotonic decrease in exit points, thereby eliminating the need to recompute KV Caches for preceding tokens. Rather than terminating computation prematurely as in prior works, our approach bypasses lower to middle layers, devoting most of the computational resources to upper layers, allowing later tokens to benefit from the compute expenditure by earlier tokens. Our experimental results show that SkipDecode can obtain 2x to 5x inference speedups with negligible regression across a variety of tasks. This is achieved using OPT models of 1.3 billion and 6.7 billion parameters, all the while being directly compatible with batching and KV caching optimization techniques.

Motivation & Objective

  • Address the incompatibility of existing token-level early exit strategies with batching and KV caching in autoregressive LLM inference.
  • Overcome the bottleneck where inference must wait for the last token in a batch to exit, limiting speedup potential.
  • Enable predictable and controlled computational budgets by establishing a unified exit point per sequence position across all tokens in a batch.
  • Leverage the observation that later tokens in a sequence are more predictable, allowing reduced computation for downstream tokens.
  • Maintain high generation quality while significantly reducing inference latency through strategic compute allocation to upper transformer layers.

Proposed method

  • Introduce a monotonically decreasing exit policy across sequence positions, where earlier tokens use more layers and later tokens use fewer, based on decreasing uncertainty (measured by loss).
  • Define a single, shared exit point per sequence position for all tokens in a batch, eliminating the need to recompute KV caches when later tokens exit.
  • Bypass lower and middle transformer layers for later tokens, redirecting computational resources to upper layers to benefit from earlier token computation.
  • Use a linear decay function for exit positions across the sequence, ensuring monotonicity and avoiding recomputation of cached key-value states.
  • Integrate seamlessly with standard batching and KV caching optimizations, enabling practical deployment in real-world systems.
  • Ensure computational budget control by setting a maximum exit layer per sequence position, avoiding unpredictable full-network computation.
(a) OPT-350m on OpenWebText . Average loss per token position shows a strong monotonically-decreasing trend for general text.
(a) OPT-350m on OpenWebText . Average loss per token position shows a strong monotonically-decreasing trend for general text.

Experimental results

Research questions

  • RQ1Can token-level early exit strategies be made compatible with batching and KV caching in autoregressive LLM inference?
  • RQ2Does a monotonically decreasing exit policy across sequence positions reduce computational cost while maintaining generation quality?
  • RQ3Can early exit be applied without requiring re-computation of KV caches when later tokens exit after earlier ones?
  • RQ4How does the speedup-performance trade-off of SkipDecode compare to existing methods under controlled computational budgets?
  • RQ5Can the method support practical deployment pipelines that rely on batching and KV caching without sacrificing inference efficiency?

Key findings

  • SkipDecode achieves 2x to 5x speedup over full inference on OPT-1.3B and OPT-6.7B models across multiple generation benchmarks.
  • The method maintains near-identical generation quality to full models, with negligible performance degradation even at high speedup factors.
  • By enforcing a monotonic decrease in exit points, SkipDecode eliminates the need to recompute KV caches for earlier tokens, enabling efficient batching.
  • The approach supports full compatibility with batching and KV caching, overcoming a major limitation of prior early-exit methods.
  • The linear decay policy for exit positions is effective and robust, outperforming alternative functions like power law in preliminary experiments.
  • Oracle experiments confirm that the observed loss trend (decreasing per token position) supports the design choice of earlier, deeper computation.
(b) OPT-350m (finetuned) on Reddit-TLDR . Average loss per token position. Decreasing trend but with a different function.
(b) OPT-350m (finetuned) on Reddit-TLDR . Average loss per token position. Decreasing trend but with a different function.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.