Abstract
Quantizing decoder-only models like GPT-2 is challenging due to activation outliers and the tendency of standard Quantization-Aware Training (QAT) to overfit. We present Quadapter, a lightweight scaling module that mitigates outliers while keeping original model weights frozen. This approach maintains general-purpose performance across diverse tasks without requiring the original training data.
Introduction
Deploying Large Language Models (LLMs) on edge devices necessitates quantization to reduce memory and power consumption. However, architectures like GPT-2 exhibit "channel-dependent outliers"—specific channels with values significantly larger than the rest. Post-Training Quantization (PTQ) often fails as these outliers inflate the quantization range, causing precision loss for smaller values. While standard QAT can learn to handle these outliers, it often leads to "catastrophic forgetting" if the original training data is unavailable and the model is fine-tuned on a smaller, specific dataset. Quadapter addresses these issues by providing a robust, data-efficient alternative that preserves the model's general-purpose capabilities.
The Quadapter Method
Quadapter introduces a small set of learnable parameters ($\alpha$) for channel-wise scaling. The module scales input channels before quantization and applies inverse scaling afterward, maintaining an identity relation in the absence of quantization error.
To ensure zero inference latency, these scaling factors are "folded" into the weights and biases of adjacent layers during deployment. Training occurs in two phases:
- Block-wise Calibration: Each block is trained independently to minimize the $L_2$ distance between original and quantized outputs using a small calibration set.
- End-to-End Fine-Tuning: The entire model is fine-tuned using a task loss, but only the Quadapter parameters and quantization step sizes are updated. The original GPT-2 weights remain frozen, preventing the model from drifting away from its pretrained knowledge.
Results and Analysis
Quadapter demonstrates superior generalization compared to standard QAT. When fine-tuned on WikiText-2, standard QAT performance on out-of-distribution (OOD) datasets like PTB degrades significantly, with perplexity skyrocketing to ~100. In contrast, Quadapter maintains low perplexity across both in-distribution (ID) and OOD tasks, keeping PTB perplexity at ~47, much closer to the full-precision baseline of 41.
Experiments show that Quadapter is highly data-efficient, maintaining stable performance even with very few training samples. It consistently outperforms advanced PTQ methods like AdaRound and Cross-Layer Equalization (CLE). For example, on the LAMBADA dataset, Quadapter achieved a perplexity of 57.28, whereas standard PTQ resulted in a massive 827.06.
Conclusion
Quadapter provides an effective mechanism for 8-bit quantization of GPT-2 models by managing activation outliers without altering pretrained weights. By acting as a buffer for quantization noise, it allows models to retain their fundamental language understanding while operating in lower precision. While currently limited by specific structural requirements for parameter folding, it represents a significant step toward efficient, general-purpose LLM deployment on resource-constrained devices.
Summary updated