PolarQuant: Leveraging Polar Transformation for Efficient Key Cache Quantization and Decoding Acceleration
- URL: http://arxiv.org/abs/2502.00527v1
- Date: Sat, 01 Feb 2025 18:59:03 GMT
- Title: PolarQuant: Leveraging Polar Transformation for Efficient Key Cache Quantization and Decoding Acceleration
- Authors: Songhao Wu, Ang Lv, Xiao Feng, Yufei Zhang, Xun Zhang, Guojun Yin, Wei Lin, Rui Yan,
- Abstract summary: Quantizing the KV cache to lower bit widths is an effective way to reduce computational costs.
Previous methods struggle with quantizing key vectors due to outliers, resulting in excessive overhead.
We propose a novel quantization approach called PolarQuant, which efficiently addresses the outlier challenge.
- Score: 26.972039704548184
- License:
- Abstract: The KV cache in large language models is a dominant factor in memory usage, limiting their broader applicability. Quantizing the cache to lower bit widths is an effective way to reduce computational costs; however, previous methods struggle with quantizing key vectors due to outliers, resulting in excessive overhead. We propose a novel quantization approach called PolarQuant, which efficiently addresses the outlier challenge. We observe that outliers typically appear in only one of two dimensions, which are rotated together by a specific angle when rotary position embeddings are applied. When represented as two-dimensional vectors, these dimensions exhibit well-structured patterns, with radii and angles smoothly distributed in polar coordinates. This alleviates the challenge of outliers on per-channel quantization, making them well-suited for quantization. Thus, PolarQuant divides key vectors into groups of two-dimensional sub-vectors, encoding them as the corresponding quantized radius and the polar angle, rather than quantizing original key vectors directly. PolarQuant achieves the superior efficiency in KV cache quantization and accelerates the decoding process by turning the query-key inner product into a table lookup, all while maintaining the downstream performance of full-precision models.
Related papers
- PolarQuant: Quantizing KV Caches with Polar Transformation [46.38603611763045]
Large language models (LLMs) require significant memory to store Key-Value embeddings in their KV cache.
Quantization of these KV embeddings is a common technique to reduce memory consumption.
This work introduces PolarQuant, a novel quantization method employing random preconditioning and polar transformation.
arXiv Detail & Related papers (2025-02-04T08:52:13Z) - Memory-Efficient 4-bit Preconditioned Stochastic Optimization [53.422307389223626]
We introduce 4-bit quantization for Shampoo's preconditioners.
To our knowledge, this is the first quantization approach applied to Cholesky factors of preconditioners.
arXiv Detail & Related papers (2024-12-14T03:32:54Z) - Residual vector quantization for KV cache compression in large language model [2.3094645821058735]
KV cache compression methods have mainly relied on scalar quantization techniques to reduce the memory requirements during decoding.
In this work, we apply residual vector quantization, which has been widely used for high fidelity audio compression, to compress KV cache in large language models (LLM)
We learn the codebook using exponential moving average and there are no other learnable parameters including the input and output projections normally used in a vector quantization set up.
arXiv Detail & Related papers (2024-10-21T07:20:41Z) - DuQuant: Distributing Outliers via Dual Transformation Makes Stronger Quantized LLMs [40.48697728884967]
Quantization of large language models (LLMs) faces significant challenges, particularly due to the presence of outlier activations.
Traditional approaches predominantly address Normal Outliers, which are activations across all tokens with relatively large magnitudes.
We introduce DuQuant, a novel approach that utilizes rotation and permutation transformations to more effectively mitigate both massive and normal outliers.
arXiv Detail & Related papers (2024-06-03T18:27:44Z) - Unlocking Data-free Low-bit Quantization with Matrix Decomposition for KV Cache Compression [87.5604418100301]
Key-value( KV) caching is an important technique to accelerate the inference of large language models.
Existing methods often compromise precision or require extra data for calibration.
We introduce textbfDecoQuant, a novel data-free low-bit quantization technique based on tensor decomposition methods.
arXiv Detail & Related papers (2024-05-21T08:35:10Z) - Quantization of Large Language Models with an Overdetermined Basis [73.79368761182998]
We introduce an algorithm for data quantization based on the principles of Kashin representation.
Our findings demonstrate that Kashin Quantization achieves competitive or superior quality in model performance.
arXiv Detail & Related papers (2024-04-15T12:38:46Z) - An Efficient Algorithm for Clustered Multi-Task Compressive Sensing [60.70532293880842]
Clustered multi-task compressive sensing is a hierarchical model that solves multiple compressive sensing tasks.
The existing inference algorithm for this model is computationally expensive and does not scale well in high dimensions.
We propose a new algorithm that substantially accelerates model inference by avoiding the need to explicitly compute these covariance matrices.
arXiv Detail & Related papers (2023-09-30T15:57:14Z) - Sketching as a Tool for Understanding and Accelerating Self-attention
for Long Sequences [52.6022911513076]
Transformer-based models are not efficient in processing long sequences due to the quadratic space and time complexity of the self-attention modules.
We propose Linformer and Informer to reduce the quadratic complexity to linear (modulo logarithmic factors) via low-dimensional projection and row selection.
Based on the theoretical analysis, we propose Skeinformer to accelerate self-attention and further improve the accuracy of matrix approximation to self-attention.
arXiv Detail & Related papers (2021-12-10T06:58:05Z) - Efficient multi-qubit subspace rotations via topological quantum walks [1.0486921990935787]
The rotation of subspaces by a chosen angle is a fundamental quantum computing operation.
We propose a fast, high-fidelity way to implement such operations via topological quantum walks.
This procedure can be implemented in superconducting qubits, ion-traps and Rydberg atoms with star-type connectivity.
arXiv Detail & Related papers (2021-11-12T02:10:56Z) - Automatic virtual voltage extraction of a 2x2 array of quantum dots with machine learning [0.7852714805965528]
We develop a theoretical framework to mitigate the effect of cross-capacitances in 2x2 arrays of quantum dots and extend it to 2xN and NxN arrays.
Our method provides a completely automated tool to mitigate cross-capacitance effects in arrays of QDs.
arXiv Detail & Related papers (2020-12-07T13:37:09Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.