Optimal Quantization for Matrix Multiplication

要約

機械学習コミュニティの最近の研究では、大きな行列の非可逆圧縮 (量子化) を実行するための複数の方法が提案されました。
この量子化は、行列の乗算 (大規模な言語モデルの主要コンポーネント) を高速化するために重要ですが、多くの場合、これらの行列をメモリからロードする速度がボトルネックとなります。
古典的なベクトル量子化やレート歪み理論とは異なり、これらの新しい圧縮アルゴリズムの目標は、行列そのものではなく、行列の積を近似できるようになることです。
具体的には、実行列 $A,B$ のペアが与えられると、エンコーダ (圧縮器) がそれらのそれぞれに個別に適用され、エントリごとに $R$ ビットの記述が生成されます。
これらの表現は、デコーダによって行列積 $A^\top B$ を推定するために使用されます。
この研究では、iid ガウス エントリを持つ行列 $A,B$ の場合に、この近似の平均二乗誤差 (レート $R$ の関数として) の非漸近下限を提供します。
アルゴリズム的には、フロベニウス ノルム $\|A\|_F, \ のみに関する任意の (非ランダム) 行列ペア $A$, $B$ に対する近似誤差を明示的に保証する入れ子格子に基づくユニバーサル量子化器を構築します。
|B\|_F$ と $\|A^\top B\|_F$。
iid ガウス行列の場合、量子化器は下限を達成するため、漸近的に最適になります。
量子化器の実用的な低複雑度バージョンは、最適に非常に近いパフォーマンスを実現します。
情報理論用語では、iid ガウス行列の行列乗算に対するレート歪み関数を導出します。

要約(オリジナル)

Recent work in machine learning community proposed multiple methods for performing lossy compression (quantization) of large matrices. This quantization is important for accelerating matrix multiplication (main component of large language models), which is often bottlenecked by the speed of loading these matrices from memory. Unlike classical vector quantization and rate-distortion theory, the goal of these new compression algorithms is to be able to approximate not the matrices themselves, but their matrix product. Specifically, given a pair of real matrices $A,B$ an encoder (compressor) is applied to each of them independently producing descriptions with $R$ bits per entry. These representations subsequently are used by the decoder to estimate matrix product $A^\top B$. In this work, we provide a non-asymptotic lower bound on the mean squared error of this approximation (as a function of rate $R$) for the case of matrices $A,B$ with iid Gaussian entries. Algorithmically, we construct a universal quantizer based on nested lattices with an explicit guarantee of approximation error for any (non-random) pair of matrices $A$, $B$ in terms of only Frobenius norms $\|A\|_F, \|B\|_F$ and $\|A^\top B\|_F$. For iid Gaussian matrices our quantizer achieves the lower bound and is, thus, asymptotically optimal. A practical low-complexity version of our quantizer achieves performance quite close to optimal. In information-theoretic terms we derive rate-distortion function for matrix multiplication of iid Gaussian matrices.

arxiv情報

著者 Or Ordentlich,Yury Polyanskiy
発行日 2024-10-17 17:19:48+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL, cs.IT, cs.LG, math.IT パーマリンク