Saved in:
Bibliographic Details
Main Authors: Wang, Yanshu, Li, Wang, Yao, Zhaoqian, Yang, Tong
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2407.03637
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913492607434752
author Wang, Yanshu
Li, Wang
Yao, Zhaoqian
Yang, Tong
author_facet Wang, Yanshu
Li, Wang
Yao, Zhaoqian
Yang, Tong
contents The matrix quantization entails representing matrix elements in a more space-efficient form to reduce storage usage, with dequantization restoring the original matrix for use. We formulate the Quantization Error Minimization (QEM) problem as minimizing the distance between a matrix before and after quantization, under the condition that the quantized matrix occupies the same memory space. Matrix quantization is crucial in various applications, including Large Language Models (LLMs) weight quantization, vector databases, KV cache quantization, graph compression, and image compression. Recent advancements in LLMs, such as GPT-4 and BERT, have highlighted the importance of matrix compression due to the large size of parameters and KV cache, which are stored as matrices. We propose Quantum Entanglement Trees (QET) to address the QEM problem by leveraging the local orderliness of matrix elements, involving iterative element swapping to form a locally ordered matrix. This matrix is then grouped and quantized by columns. To enhance QET, we introduce two optimizations: further quantizing residuals to reduce MSE, and using masking and batch processing to accelerate the algorithm. Experimental results demonstrate that QET can effectively reduce MSE to 5.05%, 13.33%, and 11.89% of the current best method on the LLM dataset, K cache, and V cache, respectively. Our contributions include the abstraction of the QEM problem, the design of the QET algorithm, and the proposal of two optimizations to improve accuracy and speed.
format Preprint
id arxiv_https___arxiv_org_abs_2407_03637
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle QET: Enhancing Quantized LLM Parameters and KV cache Compression through Element Substitution and Residual Clustering
Wang, Yanshu
Li, Wang
Yao, Zhaoqian
Yang, Tong
Machine Learning
Computation and Language
The matrix quantization entails representing matrix elements in a more space-efficient form to reduce storage usage, with dequantization restoring the original matrix for use. We formulate the Quantization Error Minimization (QEM) problem as minimizing the distance between a matrix before and after quantization, under the condition that the quantized matrix occupies the same memory space. Matrix quantization is crucial in various applications, including Large Language Models (LLMs) weight quantization, vector databases, KV cache quantization, graph compression, and image compression. Recent advancements in LLMs, such as GPT-4 and BERT, have highlighted the importance of matrix compression due to the large size of parameters and KV cache, which are stored as matrices. We propose Quantum Entanglement Trees (QET) to address the QEM problem by leveraging the local orderliness of matrix elements, involving iterative element swapping to form a locally ordered matrix. This matrix is then grouped and quantized by columns. To enhance QET, we introduce two optimizations: further quantizing residuals to reduce MSE, and using masking and batch processing to accelerate the algorithm. Experimental results demonstrate that QET can effectively reduce MSE to 5.05%, 13.33%, and 11.89% of the current best method on the LLM dataset, K cache, and V cache, respectively. Our contributions include the abstraction of the QEM problem, the design of the QET algorithm, and the proposal of two optimizations to improve accuracy and speed.
title QET: Enhancing Quantized LLM Parameters and KV cache Compression through Element Substitution and Residual Clustering
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2407.03637