Abstract
Large Language Models (LLMs) face significant inference latency due to token-by-token autoregressive decoding. While layer-skipping techniques offer potential speedups, they often disrupt the Key-Value (KV) cache, leading to performance degradation and hallucinations. We present FFN-SkipLLM, an inference-time strategy that selectively skips Feed-Forward Network (FFN) blocks while preserving Attention blocks. By maintaining KV cache integrity, FFN-SkipLLM achieves a 25-30% reduction in computation with minimal impact on accuracy across diverse benchmarks.
Introduction
As LLMs grow in size, the sequential nature of autoregressive decoding becomes a major bottleneck. Researchers have explored early-exit or layer-skipping strategies to bypass computation for "easy" tokens. However, these methods frequently break the KV cache. In autoregressive decoding, each layer's Attention block stores "Keys" and "Values" for every token to facilitate future generation. Skipping an entire layer results in missing cache entries for subsequent tokens, often leading to "token collapse" (repetitive output) or "hallucinations." FFN-SkipLLM proposes a solution that avoids this bottleneck entirely by focusing on FFN redundancy.
Methodology
FFN-SkipLLM shifts the focus from skipping entire layers to skipping only the Feed-Forward Network (FFN) blocks, which account for roughly two-thirds of an LLM's parameter budget (e.g., ~135M out of ~200M parameters in a Llama-7B layer).
1. Input-Adaptive Triggering
The method utilizes a cosine similarity metric to determine redundancy. It measures the similarity between the tensor entering an FFN and the one exiting it. The authors observed a "monotonically increasing cosine similarity" in the middle layers, indicating that FFNs perform increasingly redundant computations as a token progresses through the network. If similarity exceeds a threshold (e.g., >0.9), the model greedily skips FFN blocks for the next k layers.
2. Cold Regions and Warm-up
To maintain stability, the first and last few layers are designated as "cold regions" and are never skipped. Additionally, a "warm-up" period is implemented where the first 25-30 tokens of a sequence are processed by the full model. This anchors the KV cache, leveraging the "attention sink" phenomenon to allow for more aggressive skipping later in the sequence without losing coherence.
Experimental Results
FFN-SkipLLM was evaluated on Llama-2 7B and 13B across benchmarks including Factoid-QA (FreebaseQA), MT-Bench, and CNN/DailyMail.
- Performance Retention: On Factoid-QA, FFN-SkipLLM retained ~78% accuracy at a 25% skip ratio, significantly outperforming ShortGPT (~70%) and SkipDecode (~73%).
- Efficiency Gains: The method achieved a 25-30% reduction in FFN blocks with marginal performance impact. On an NVIDIA RTX A6000, throughput improved from 9.08 tokens/sec to 12.45 tokens/sec at a 50% skip ratio.
- Qualitative Superiority: Unlike prior methods that hallucinated factual errors under high skip ratios, FFN-SkipLLM maintained factual integrity, correctly identifying complex entities while skipping significant computation.
Conclusion and Limitations
FFN-SkipLLM demonstrates that FFN blocks are often redundant in the middle layers of LLMs. By preserving Attention blocks, it ensures KV cache stability, providing a robust path for inference acceleration. Current limitations include a performance drop-off beyond a 35% skip ratio, which may be addressed in future work through parameter-efficient fine-tuning (PEFT) or application to larger 70B+ models.
Summary updated