Abstract
Quantizing Large Language Models (LLMs) to 4-bit weights and activations (W4A4) is critical for efficient deployment but often results in substantial accuracy loss due to activation outliers. We introduce Low-Rank Correction (LRC), a post-training quantization (PTQ) method that supplements quantized layers with small, full-precision "sidecar" matrices. By jointly optimizing these low-rank terms alongside quantized weights, LRC recovers significant performance, closing the accuracy gap by over 50% with a 10% parameter overhead and achieving near-lossless performance at higher ranks.
Introduction
Deploying LLMs on consumer-grade hardware necessitates aggressive quantization. While weight-only quantization (e.g., W4A16) is relatively mature, quantizing activations to 4 bits (W4A4) remains a significant challenge. Activations often contain high-magnitude outliers that introduce substantial noise when compressed, leading to a "quantization gap" that degrades reasoning and linguistic capabilities. Current state-of-the-art methods often struggle to maintain performance at the W4A4 level without expensive retraining.
Methodology: The LRC Framework
The core of our approach is the addition of a supplementary low-rank matrix ($U_\ell V_\ell^\top$) in FP16 precision to each quantized layer. This "sidecar" structure allows the model to correct errors introduced by aggressive activation quantization.
Joint Optimization
LRC employs a joint optimization framework to determine the optimal weights and correction terms:
- Weight Update: A solver (such as GPTQ) identifies the best 4-bit weights given the current low-rank correction.
- Low-Rank Update: A closed-form solution, utilizing SVD or Eigen-decomposition, finds the optimal low-rank matrices to minimize the residual error.
- Integration: LRC is built upon QuaRot, which utilizes Hadamard transforms to smooth activation outliers, making them more amenable to quantization.
Experimental Setup
We validated LRC across several prominent model families, including Phi-3 (mini), Llama-2 (7B & 13B), Llama-3 (8B), and Mixtral (8x7B).
- Calibration: Statistics were calculated using 128 sequences from the Wikitext-2 dataset.
- Evaluation: Performance was measured using the LM-Eval suite across tasks such as PIQA, HellaSwag, and ARC.
Results and Analysis
Our experiments demonstrate that LRC effectively bridges the accuracy gap in W4A4 settings.
Key Findings
- The 30% Rule: While a rank equivalent to 10% of the original matrix size recovers more than half of the lost accuracy, increasing the rank to 30% effectively closes the accuracy gap completely, matching the performance of the original FP16 model.
- Activation Error Mitigation: LRC is specifically effective at correcting errors from activation quantization. In weight-only (W4A16) settings, where accuracy is already high, LRC provides negligible additional benefit.
- Efficiency: Despite the additional computation, the system remains faster than the FP16 baseline. On an A100 GPU, a layer with 512-rank correction achieved speedups of 1.29x to 1.62x.
Discussion and Future Work
While LRC significantly improves accuracy, the full-precision sidecar matrices introduce a memory overhead (approximately 13% for a 10% rank correction). Future work will focus on developing fused CUDA kernels to further optimize the speed benefits by handling the 4-bit GEMM and low-rank addition in a single pass. Additionally, exploring parallel execution of low-bitwidth and low-rank computations offers a promising path for hardware acceleration.
Summary updated