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 $\|\bar{A}\|_F, \|\bar{B}\|_F$ and $\|\bar{A}^\top \bar{B}\|_F$, where $\bar{A},\bar{B}$ are versions of $A,B$ with zero-centered columns, respectively. 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 addition, we derive rate-distortion function for matrix multiplication of iid Gaussian matrices, which exhibits an interesting phase-transition at $R\approx 0.906$ bit/entry, showing necessity of Johnson-Lindestrauss dimensionality reduction (sketching) in the low-rate regime.


翻译:机器学习领域的最新研究提出了多种对大矩阵进行有损压缩(量化)的方法。这种量化对于加速矩阵乘法(大语言模型的主要计算组件)至关重要,因为该运算常受限于从内存加载这些矩阵的速度。与经典的矢量量化和率失真理论不同,这些新型压缩算法的目标并非逼近矩阵本身,而是逼近其矩阵乘积。具体而言,给定一对实矩阵$A,B$,对每个矩阵独立应用编码器(压缩器)生成每元素$R$比特的描述。这些表示随后被解码器用于估计矩阵乘积$A^\top B$。在本工作中,我们针对矩阵$A,B$具有独立同分布高斯条目的情形,给出了该近似均方误差(作为速率$R$的函数)的非渐近下界。在算法层面,我们构建了一种基于嵌套格点的通用量化器,该量化器对任意(非随机)矩阵对$A$、$B$的近似误差给出了显式保证,其误差界仅取决于弗罗贝尼乌斯范数$\|\bar{A}\|_F, \|\bar{B}\|_F$和$\|\bar{A}^\top \bar{B}\|_F$,其中$\bar{A},\bar{B}$分别为$A,B$的列中心化版本。对于独立同分布高斯矩阵,我们的量化器达到了该下界,因而是渐近最优的。一种实用的低复杂度版本量化器性能亦十分接近最优。此外,我们推导了独立同分布高斯矩阵乘法的率失真函数,该函数在$R\approx 0.906$比特/元素处呈现出有趣的相变现象,揭示了低速率区域必须采用Johnson-Lindenstrauss降维(草图)技术。

0
下载
关闭预览

相关内容

FlowQA: Grasping Flow in History for Conversational Machine Comprehension
专知会员服务
34+阅读 · 2019年10月18日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
60+阅读 · 2019年10月17日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
STRCF for Visual Object Tracking
统计学习与视觉计算组
15+阅读 · 2018年5月29日
Focal Loss for Dense Object Detection
统计学习与视觉计算组
12+阅读 · 2018年3月15日
国家自然科学基金
2+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
23+阅读 · 2022年2月24日
Arxiv
12+阅读 · 2021年7月26日
Arxiv
31+阅读 · 2021年6月30日
Learning Implicit Fields for Generative Shape Modeling
Arxiv
11+阅读 · 2018年12月6日
VIP会员
相关资讯
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
STRCF for Visual Object Tracking
统计学习与视觉计算组
15+阅读 · 2018年5月29日
Focal Loss for Dense Object Detection
统计学习与视觉计算组
12+阅读 · 2018年3月15日
相关论文
Arxiv
23+阅读 · 2022年2月24日
Arxiv
12+阅读 · 2021年7月26日
Arxiv
31+阅读 · 2021年6月30日
Learning Implicit Fields for Generative Shape Modeling
Arxiv
11+阅读 · 2018年12月6日
相关基金
国家自然科学基金
2+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员