FFN Quantization Bottleneck: Spikes Degrade LLM Accuracy

Excessive activation magnitudes in GLU-based FFNs cause severe local quantization errors, significantly degrading quantized LLM performance and making these layers a primary accuracy bottleneck for low-bit inference.

The top 3

  1. FFN's Most Vulnerable Layers to Activation Spikes: Activation spikes, which cause significant quantization errors, predominantly occur in the Feed-Forward Network (FFN) layers, especially in the early and late stages of modern LLMs utilizing GLU variants. Within these FFNs, the 'down modules' (output linear layers) following the Hadamard Product within GLU exhibit the most noticeable input activation magnitudes, making them highly susceptible to these spikes.
  2. Top Solutions for Mitigating FFN Activation Spikes: To combat accuracy degradation from FFN activation spikes in GLU-based LLMs, leading empirical methods include Quantization-free Module (QFeM) and Quantization-free Prefix (QFeP). QFeM selectively omits quantization for entire linear layers prone to spikes, while QFeP isolates spikes specific to certain tokens. These techniques have shown to enhance existing methods like SmoothQuant and can improve quantized LLaMA-2 models by 7-16% accuracy.
  3. Quantifying FFN Spike Impact on LLM Accuracy: Severe local quantization errors from FFN activation spikes can significantly degrade quantized LLM performance. FFNs constitute roughly two-thirds of an LLM's parameters, making their efficient quantization critical. The challenge is compounded by a trade-off: using a full dynamic range for FFN outputs leads to coarse input quantization, while higher input precision can cause information loss through aggressive output clipping. New methods targeting these spikes have shown 7-16% accuracy improvements for quantized LLaMA-2 models over traditional approaches.

Sources

Open the full topic