WKVQuant: Quantizing Weight and Key/Value Cache for Large Language Models Gains More

Yuxuan Yue, Zhihang Yuan, Haojie Duanmu, Sifan Zhou, Jianlong Wu +1 more
2/19/2024
cs.LGcs.AIcs.CL

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

Large Language Models (LLMs) face significant deployment challenges due to their substantial memory requirements and the computational demands of auto-regressive text generation process. This paper addresses these challenges by focusing on the quantization of LLMs, a technique that reduces memory consumption by converting model parameters and activations into low-bit integers. We critically analyze the existing quantization approaches, identifying their limitations in balancing the accuracy and efficiency of the quantized LLMs. To advance beyond these limitations, we propose WKVQuant, a PTQ framework especially designed for quantizing weights and the key/value (KV) cache of LLMs. Specifically, we incorporates past-only quantization to improve the computation of attention. Additionally, we introduce two-dimensional quantization strategy to handle the distribution of KV cache, along with a cross-block reconstruction regularization for parameter optimization. Experiments show that WKVQuant achieves almost comparable memory savings to weight-activation quantization, while also approaching the performance of weight-only quantization.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 3 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{yue2024wkvquant,
  title  = {WKVQuant: Quantizing Weight and Key/Value Cache for Large Language Models Gains More},
  author = {Yuxuan Yue and Zhihang Yuan and Haojie Duanmu and Sifan Zhou and Jianlong Wu and Liqiang Nie},
  year   = {2024},
  eprint = {2402.12065},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.12065v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.12065.svg)](https://codeofpaper.com/paper/2402.12065)

Discussion