Introduction
As Large Language Models (LLMs) scale to hundreds of billions of parameters, deploying them on edge devices like laptops and smartphones is hindered by immense memory requirements. Vector Quantization (VQ) has emerged as a promising solution, grouping weights into vectors and representing them via a codebook. However, traditional VQ methods often struggle at extremely low bit-widths, such as 2-bit compression. PCDVQ (Polar Coordinate Decoupled Vector Quantization) addresses this by decoupling weight vectors into their direction and magnitude components, allowing for more precise representation of the model's underlying signal.
The Sensitivity Gap and the Euclidean Trap
A fundamental flaw in current VQ approaches is the treatment of a vector's direction and magnitude as a coupled pair. Through empirical testing on models like LLaMA-2-7B, researchers identified a significant "sensitivity gap": LLM performance is incredibly sensitive to errors in direction but relatively robust to errors in magnitude. For instance, quantizing only the direction caused a 46.5% drop in accuracy, while quantizing only the magnitude resulted in a mere 2.3% drop.
Furthermore, the standard metric for quantization error—Mean Square Error (MSE)—mathematically prioritizes reducing magnitude error over direction error. In the MSE formula, magnitude error contributes quadratically, while direction error contributes linearly. This "Euclidean Trap" leads standard optimizers to ignore critical direction errors in favor of fixing small magnitude errors, causing significant accuracy loss at low bit-widths.
The PCDVQ Framework
To resolve the misalignment between quantization metrics and model sensitivity, the PCDVQ framework introduces two primary innovations:
- Polar Coordinate Decoupling (PCD): Instead of quantizing raw weights in Cartesian coordinates, PCDVQ transforms them into polar coordinates. This allows the system to quantize direction and magnitude independently, allocating more bits to the high-sensitivity direction and fewer bits to the low-sensitivity magnitude.
- Distribution Aligned Codebook Construction (DACC): Rather than using generic clustering, PCDVQ builds specialized codebooks based on the mathematical distribution of weights. For direction, which is spatially uniform for Gaussian variables, a greedy algorithm samples points from the $E_8$ lattice (the densest known sphere-packing in 8D) to ensure efficient coverage. For magnitude, which follows a root Chi-square distribution, the Lloyd-Max algorithm is used to create an optimal 1D codebook.
Experimental Results
PCDVQ was evaluated across a wide range of LLMs, including LLaMA-2, LLaMA-3, and Mistral-7B. At the 2-bit level, PCDVQ outperformed state-of-the-art baselines like QuIP# and AQLM by an average of 1.5% in zero-shot accuracy across tasks such as Arc-Challenge and HellaSwag.
Language modeling performance also saw significant gains. On LLaMA-3-8B, PCDVQ achieved a perplexity of 7.93, a marked improvement over previous methods like VPTQ (9.19). Beyond accuracy, the 2-bit compression reduces memory consumption by approximately 87.5%. On consumer-grade hardware like an NVIDIA RTX 4090, generation speed increased from 33.1 to 95.7 tokens per second, making real-time local LLM usage viable.
Conclusion and Future Work
PCDVQ demonstrates that decoupling direction and magnitude is key to achieving high-fidelity low-bit quantization for LLMs. While the current implementation focuses on weight-only quantization with a fixed vector dimension, future work could explore combining PCDVQ with KV cache quantization and investigating dynamic dimensionality to further push the boundaries of model compression.
Summary updated