Abstract: Post-Training Quantization (PTQ) is an effective technique for compressing Large Language Models (LLMs). While many studies focus on quantizing both weights and activations, it is still a challenge to maintain the accuracy of LLM after activating quantization. To investigate the primary cause, we extend the concept of kernel from linear algebra to quantization functions to define a new term, "quantization kernel", which refers to the set of elements in activations that are quantized to zero. Through quantitative analysis of the quantization kernel, we find that these elements are crucial for maintaining the accuracy of quantized LLMs. With the decrease of quantization kernel, the precision of quantized LLMs increases. If the quantization kernel proportion is kept below 19% for OPT models and below 1% for LLaMA models, the precision loss from quantizing activations to INT8 becomes negligible. Motivated by the goal of developing a quantization method with small quantization kernel, we propose CrossQuant: a simple yet effective method for quantizing activations. CrossQuant cross-quantizes elements using row and column-wise absolute maximum vectors, achieving a quantization kernel of approximately 16% for OPT models and less than 0.1% for LLaMA models. Experimental results on LLMs (LLaMA, OPT) ranging from 6.7B to 70B parameters demonstrate that CrossQuant improves or maintains perplexity and accuracy in language modeling, zero-shot, and few-shot tasks.
Introduction
Quantizing Large Language Models (LLMs) from 16-bit floating point (FP16) to 8-bit or 4-bit integers (INT8/INT4) is essential for deploying massive models on consumer hardware. However, while quantizing weights is relatively straightforward, quantizing activations often leads to significant accuracy drops. The primary culprit is the presence of "outliers"—activation values significantly larger than the rest. Standard per-token quantization scales entire rows based on these outliers, causing smaller but important values to be rounded to zero. This paper identifies this set of zeroed-out elements as the quantization kernel and argues that minimizing its size is critical for maintaining model intelligence.
The Quantization Kernel Concept
The authors extend the linear algebra concept of a "kernel" to quantization, defining it as the proportion of elements in an activation matrix that map to zero. They discovered that different architectures have specific sensitivity thresholds: if the kernel proportion exceeds ~19% for OPT models or ~1% for LLaMA models, accuracy plummets.
As shown in the figure above, standard per-token quantization can lead to a large kernel where many informative signals are lost (rounded to 0), whereas the proposed CrossQuant method preserves these values, maintaining accuracy close to the original FP16 levels.
The CrossQuant Method
To address the collateral damage caused by outliers, the authors propose CrossQuant, a Post-Training Quantization (PTQ) method that rethinks scaling factor calculation. Instead of scaling solely by the row-maximum ($t_i$), CrossQuant incorporates the column-maximum ($c_j$).
The scaling factor is calculated using a weighted geometric mean: $\Delta \propto t_i^\alpha \cdot c_j^{1-\alpha}$, where $\alpha$ is a hyperparameter (typically around 0.15). Because column maximums are generally smaller than the extreme outliers found in rows, this "cross" approach reduces the overall scaling factor for most elements, "rescuing" small values from being rounded to zero. The method is computationally efficient, adding negligible overhead with $O(TI)$ complexity.
Key Results and Insights
The researchers evaluated CrossQuant across standard benchmarks (WikiText2, C4, Lambada, MMLU) using the OPT and LLaMA model families.
- W8A8 (8-bit): CrossQuant maintains near-perfect FP16 accuracy. For LLaMA3-8B, it achieved a perplexity of 6.16 on WikiText2, nearly identical to the FP16 baseline of 6.13.
- W4A8 (4-bit weights): When combined with weight-only methods like AWQ, CrossQuant outperformed existing state-of-the-art methods like SmoothQuant and OmniQuant.
- Extreme Compression (W4A4): In 4-bit weight/activation settings where most methods fail, CrossQuant maintained significant functionality, such as 43.12% accuracy on Lambada for OPT-30B.
The benefits of CrossQuant become more pronounced as model size increases, as larger models tend to have more aggressive outliers. By achieving a quantization kernel of <0.1% for LLaMA models, CrossQuant effectively matches the precision of uncompressed models.
Limitations and Future Work
While the paper identifies empirical kernel thresholds, it does not fully explain why architectures like OPT and LLaMA have such different tolerances for zeroed-out activations. Additionally, very small models (e.g., OPT-2.3B) appear surprisingly resistant to high kernel proportions, a phenomenon slated for future investigation. The authors also suggest that weight matrices may possess similar "kernels," indicating that CrossQuant could potentially be adapted to improve weight compression in the future.
Summary updated