Abstract
Large Language Models (LLMs) face deployment challenges due to high computational costs, and while Post-Training Quantization (PTQ) offers a solution, existing rotation-based methods struggle at very low bit-widths like 2-bit. We introduce a novel, training-free approach to construct an improved rotation matrix, addressing the limitations of current methods. The key contributions include leveraging the Walsh-Hadamard transform with sequency ordering, which clusters similar frequency components to reduce quantization error compared to standard Hadamard matrices, significantly improving performance. Furthermore, we propose a Grouped Sequency-arranged Rotation (GSR) using block-diagonal matrices with smaller Walsh blocks, effectively isolating outlier impacts and achieving performance comparable to optimization-based methods without requiring any training. Our method demonstrates robust performance on reasoning tasks and Perplexity (PPL) score on WikiText-2. Our method also enhances results even when applied over existing learned rotation techniques.
Introduction
As Large Language Models (LLMs) continue to scale, the computational and memory requirements for deployment have become prohibitive. Post-Training Quantization (PTQ) has emerged as a critical technique to mitigate these costs by reducing weight and activation precision (e.g., from 16-bit to 4-bit or 2-bit). However, ultra-low bit-widths like 2-bit introduce significant quantization errors, primarily driven by "outliers"—high-magnitude values that skew the quantization range.
Existing rotation-based methods, such as QuaRot, utilize Hadamard transforms to diffuse these outliers across dimensions. While effective at 4-bit, these methods often fall short at 2-bit. Recent advancements have attempted to learn optimal rotations through expensive optimization processes, which undermines the "post-training" efficiency. This paper introduces Grouped Sequency-arranged Rotation (GSR), a training-free method that optimizes rotation matrices to achieve state-of-the-art performance at ultra-low precision.
Methodology
The GSR approach optimizes the rotation transformation through two primary innovations:
1. Sequency-arranged Walsh Matrices
Standard rotation methods often use Hadamard matrices in their "natural" order. GSR instead employs Walsh matrices, where rows are reordered by their sequency—the frequency of sign flips across a row. By sorting rows in ascending sequency, the matrix clusters similar frequency components. This arrangement acts as a proxy for smoothness, reducing the intra-group variance when weights are partitioned into quantization groups, thereby minimizing error.
2. Grouped (Local) Rotation
While traditional methods apply a single "global" rotation to the entire weight vector, GSR utilizes a block-diagonal matrix composed of smaller Walsh blocks. This "local" rotation strategy confines the influence of outliers to specific blocks, preventing a single extreme value from "polluting" the entire channel.
Experimental Evaluation
The effectiveness of GSR was evaluated using the Llama-2-7B model on two main benchmarks:
- Language Modeling: Perplexity (PPL) on the WikiText-2 dataset.
- Zero-shot Reasoning: A suite of tasks including ARC, HellaSwag, LAMBADA, PIQA, WinoGrande, BoolQ, OpenBookQA, and SIQA.
The experiments compared GSR against baseline global Hadamard (GH) rotations and learned methods like SpinQuant and OSTQuant.
Results and Discussion
The results demonstrate that GSR provides a substantial performance boost, particularly in the challenging W2A16 (2-bit weight, 16-bit activation) setting.
Key findings include:
- Significant PPL Reduction: On WikiText-2, applying GSR to the QuaRot baseline reduced perplexity from 20.29 to 11.59, a dramatic improvement achieved without any training.
- Competitive with Learned Methods: The training-free GSR (11.59 PPL) performs nearly as well as the optimization-heavy OSTQuant (10.97 PPL).
- Synergistic Effects: When GSR is used as an initialization or enhancement for learned methods, it further improves their performance. For instance, OSTQuant's PPL improved from 10.97 to 9.03 when combined with GSR.
- Reasoning Accuracy: Average zero-shot reasoning accuracy improved from 32.06% to 42.44% over the baseline.
Conclusion and Future Work
Grouped Sequency-arranged Rotation (GSR) offers a powerful, training-free solution for ultra-low bit LLM quantization. By leveraging the mathematical structure of sequency-ordered Walsh matrices and localized rotations, it effectively manages outliers and reduces quantization noise.
While GSR excels at 2-bit precision, its benefits are less pronounced at higher bit-widths (4-bit or 8-bit) where quantization error is naturally lower. Future work will address the engineering challenges of implementing block-diagonal rotations efficiently during inference and explore the generalizability of GSR to other architectures such as Mixture of Experts (MoE) and Vision Transformers.
Summary updated