要約
行列の量子化では、行列要素をよりスペース効率の高い形式で表現してストレージの使用量を削減し、逆量子化によって元の行列を復元して使用できるようにします。
量子化誤差最小化 (QEM) 問題は、量子化された行列が同じメモリ空間を占有するという条件の下で、量子化前後の行列間の距離を最小化するものとして定式化されます。
行列量子化は、大規模言語モデル (LLM) の重み量子化、ベクトル データベース、KV キャッシュ量子化、グラフ圧縮、画像圧縮などのさまざまなアプリケーションで重要です。
GPT-4 や BERT などの LLM の最近の進歩により、行列として保存されるパラメータと KV キャッシュのサイズが大きいため、行列圧縮の重要性が強調されています。
我々は、行列要素の局所的な秩序性を利用して QEM 問題に対処するための量子もつれ木 (QET) を提案します。これには、局所的に順序付けされた行列を形成するための反復的な要素の交換が含まれます。
次に、この行列は列ごとにグループ化され、量子化されます。
QET を強化するために、2 つの最適化を導入します。1 つは残差をさらに量子化して MSE を削減する方法、もう 1 つはマスキングとバッチ処理を使用してアルゴリズムを高速化する方法です。
実験結果は、QET が MSE を、LLM データセット、K キャッシュ、および V キャッシュに対する現在の最良の方法のそれぞれ 5.05%、13.33%、および 11.89% に効果的に削減できることを示しています。
私たちの貢献には、QEM 問題の抽象化、QET アルゴリズムの設計、精度と速度を向上させるための 2 つの最適化の提案が含まれます。
要約(オリジナル)
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.
arxiv情報
| 著者 | Yanshu Wang,Wang Li,Zhaoqian Yao,Tong Yang |
| 発行日 | 2024-09-06 08:28:01+00:00 |
| arxivサイト | arxiv_id(pdf) |
提供元, 利用サービス
arxiv.jp, Google