PolarQuant: Leveraging Polar Transformation for Efficient Key Cache Quantization and Decoding Acceleration

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wu, Songhao, Lv, Ang, Feng, Xiao, Zhang, Yufei, Zhang, Xun, Yin, Guojun, Lin, Wei, Yan, Rui
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913673960751104
author Wu, Songhao
Lv, Ang
Feng, Xiao
Zhang, Yufei
Zhang, Xun
Yin, Guojun
Lin, Wei
Yan, Rui
author_facet Wu, Songhao
Lv, Ang
Feng, Xiao
Zhang, Yufei
Zhang, Xun
Yin, Guojun
Lin, Wei
Yan, Rui
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2502_00527
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle PolarQuant: Leveraging Polar Transformation for Efficient Key Cache Quantization and Decoding Acceleration
Wu, Songhao
Lv, Ang
Feng, Xiao
Zhang, Yufei
Zhang, Xun
Yin, Guojun
Lin, Wei
Yan, Rui
Machine Learning
Computation and Language
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.
title PolarQuant: Leveraging Polar Transformation for Efficient Key Cache Quantization and Decoding Acceleration
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2502.00527