How GLU Spikes Wreck Low-Bit Quantization Accuracy

GLU variants' activation spikes lead to severe local quantization errors, particularly in the early and late layers of the Feed-Forward Network (FFN) and for specific tokens. These excessive magnitudes exhaust the limited dynamic range of low-precision formats like INT8 or FP8, significantly degrading the performance of quantized LLMs.

The top 3

  1. Top GLU Variants Causing Quantization Spikes in Modern LLMs: SwiGLU is the most common GLU variant causing severe activation spikes in FFNs of leading LLMs, including LLaMA-2/3, Mistral, Mixtral, and SOLAR. Gemma uses both SwiGLU and GeGLU, all of which systematically generate excessive activation values that degrade quantization performance.
  2. GLU Spikes: Where and When They Wreck Accuracy: Activation spikes from GLU variants predominantly occur in the Feed-Forward Network (FFN) of early and late layers within LLMs. These spikes are localized to specific tokens, such as the Beginning-of-Sentence (BOS) token, newline characters (\n), and apostrophes, rather than being distributed across an entire sequence.
  3. New Methods Boost Low-Bit LLM Accuracy by 7-16%: To combat GLU spikes, new methods like Quantization-free Module (QFeM) and Quantization-free Prefix (QFeP) enhance quantized LLaMA-2 models by approximately 7-16% in accuracy. These techniques isolate activation spikes by selectively omitting quantization for specific modules or prefixed tokens, outperforming existing solutions like SmoothQuant.

Sources

Open the full topic