Saved in:
Bibliographic Details
Main Authors: Liu, Peiyu, Gao, Ze-Feng, Zhao, Wayne Xin, Ma, Yipeng, Wang, Tao, Wen, Ji-Rong
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2405.12591
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910454256762880
author Liu, Peiyu
Gao, Ze-Feng
Zhao, Wayne Xin
Ma, Yipeng
Wang, Tao
Wen, Ji-Rong
author_facet Liu, Peiyu
Gao, Ze-Feng
Zhao, Wayne Xin
Ma, Yipeng
Wang, Tao
Wen, Ji-Rong
contents Key-value~(KV) caching is an important technique to accelerate the inference of large language models~(LLMs), but incurs significant memory overhead. To compress the size of KV cache, existing methods often compromise precision or require extra data for calibration, limiting their practicality in LLM deployment. In this paper, we introduce \textbf{DecoQuant}, a novel data-free low-bit quantization technique based on tensor decomposition methods, to effectively compress KV cache. Our core idea is to adjust the outlier distribution of the original matrix by performing tensor decomposition, so that the quantization difficulties are migrated from the matrix to decomposed local tensors. Specially, we find that outliers mainly concentrate on small local tensors, while large tensors tend to have a narrower value range. Based on this finding, we propose to apply low-bit quantization to the large tensor, while maintaining high-precision representation for the small tensor. Furthermore, we utilize the proposed quantization method to compress the KV cache of LLMs to accelerate the inference and develop an efficient dequantization kernel tailored specifically for DecoQuant. Through extensive experiments, DecoQuant demonstrates remarkable efficiency gains, showcasing up to a $\sim$75\% reduction in memory footprint while maintaining comparable generation quality.
format Preprint
id arxiv_https___arxiv_org_abs_2405_12591
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Unlocking Data-free Low-bit Quantization with Matrix Decomposition for KV Cache Compression
Liu, Peiyu
Gao, Ze-Feng
Zhao, Wayne Xin
Ma, Yipeng
Wang, Tao
Wen, Ji-Rong
Computation and Language
Key-value~(KV) caching is an important technique to accelerate the inference of large language models~(LLMs), but incurs significant memory overhead. To compress the size of KV cache, existing methods often compromise precision or require extra data for calibration, limiting their practicality in LLM deployment. In this paper, we introduce \textbf{DecoQuant}, a novel data-free low-bit quantization technique based on tensor decomposition methods, to effectively compress KV cache. Our core idea is to adjust the outlier distribution of the original matrix by performing tensor decomposition, so that the quantization difficulties are migrated from the matrix to decomposed local tensors. Specially, we find that outliers mainly concentrate on small local tensors, while large tensors tend to have a narrower value range. Based on this finding, we propose to apply low-bit quantization to the large tensor, while maintaining high-precision representation for the small tensor. Furthermore, we utilize the proposed quantization method to compress the KV cache of LLMs to accelerate the inference and develop an efficient dequantization kernel tailored specifically for DecoQuant. Through extensive experiments, DecoQuant demonstrates remarkable efficiency gains, showcasing up to a $\sim$75\% reduction in memory footprint while maintaining comparable generation quality.
title Unlocking Data-free Low-bit Quantization with Matrix Decomposition for KV Cache Compression
topic Computation and Language
url https://arxiv.org/abs/2405.12591