Abstract
ORPTQ (Optimal Range Post-Training Quantization) is a novel method designed to enhance the performance of large language models (LLMs) when compressed to ultra-low bitwidths (2-4 bits). By introducing tunable parameters to optimize the quantization range, ORPTQ addresses the mathematical breakdown observed in existing second-order methods like GPTQ, enabling higher accuracy for resource-constrained deployments.
Introduction
As large language models (LLMs) continue to scale, their deployment on consumer-grade hardware, such as personal computers and mobile devices, is hindered by substantial memory and computational requirements. Quantization—the process of mapping high-precision weights (e.g., 16-bit floating point) to low-precision integers (e.g., 4-bit or 2-bit)—has emerged as a critical technique for model compression.
The current state-of-the-art for weight-only quantization is GPTQ. This method utilizes second-order information via the Hessian matrix to compensate for quantization errors. However, GPTQ relies on a second-order Taylor expansion, which is only valid within a small neighborhood of the original weights. At ultra-low bitwidths (2-bit or 3-bit), the quantization error becomes large enough to violate this assumption, leading to a "performance cliff" where model capabilities degrade rapidly.
The ORPTQ Method
To address these limitations, we propose ORPTQ, which introduces two tunable parameters, $\alpha$ and $\beta$, to dynamically optimize the quantization range.
By scaling the original minimum and maximum weight values by $\beta$ and $\alpha$ respectively, the method effectively clips the weight distribution. This clipping creates a strategic trade-off: while extreme outliers are discarded, the available quantization levels (bins) are concentrated on the majority of the weight distribution, providing higher resolution where it is most needed.
The mathematical formulation for this adjusted range is defined as follows:
Finding the optimal values for $\alpha$ and $\beta$ is central to ORPTQ. The authors explored three distinct optimization strategies:
- AdamW-GPTQ: A gradient-based approach using the AdamW optimizer.
- PSO-GPTQ: Particle Swarm Optimization, a derivative-free evolutionary algorithm.
- GS-GPTQ: A Golden-Section linear search, efficient for unimodal function optimization.
Experimental Evaluation
The performance of ORPTQ was evaluated using the OPT-6.7B and Llama2-7B model families. Evaluation metrics included:
- Perplexity: Measured on WikiText2 and C4 datasets to assess language modeling quality.
- Zero-shot Accuracy: Tested across benchmarks including ARC-Easy, ARC-Challenge, PIQA, and WINOGRANDE.
- Calibration: 128 samples from the C4 dataset were used to calibrate the quantization parameters.
Key Results
The most significant gains were observed in the 2-bit and 3-bit regimes, where standard GPTQ typically fails.
- 2-Bit Performance: On the OPT-Wiki benchmark, standard GPTQ resulted in a perplexity of 2867.96. ORPTQ (using AdamW) reduced this to 105.88, making the model functional at this extreme compression level.
- 3-Bit Accuracy: For Llama2-7B, ORPTQ improved average zero-shot accuracy from 57.14% (GPTQ) to 59.54% (PSO-GPTQ).
- Overall Consistency: Across all tests, ORPTQ variants consistently outperformed the GPTQ baseline. On average, perplexity for 2-bit, 3-bit, and 4-bit models decreased by 95.18%, 13.36%, and 1.21%, respectively.
Discussion and Insights
The success of ORPTQ highlights several key insights:
- The "Neighborhood" Trap: Second-order methods are local approximations. Aggressive quantization steps can "jump" outside the region where these approximations are valid.
- Precision vs. Outliers: In ultra-low bit regimes, sacrificing outlier weights to gain better resolution for the bulk of the distribution is a superior strategy.
- Optimization Versatility: The effectiveness of derivative-free methods like PSO suggests that the loss landscape for quantization range optimization is complex and non-convex.
Conclusion and Future Work
ORPTQ provides a robust framework for ultra-low bitwidth quantization by optimizing the quantization range. While highly effective, future work could address potential overfitting to calibration data and explore dynamic range adjustment during the quantization process. Additionally, integrating this method with activation quantization remains a key step toward full hardware acceleration of quantized LLMs.
Summary updated