arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2310.11028cs.LGcs.ITmath.ITstat.ML
收藏

矩阵压缩:基于随机低秩与低精度分解

Matrix Compression via Randomized Low Rank and Low Precision Factorization

Stanford University(斯坦福大学)

Rajarshi Saha, Varun Srivastava, Mert Pilanci

AI总结:

提出一种随机低秩与低精度分解算法,通过随机草图化和量化实现矩阵压缩,在保持性能的同时达到每坐标一比特的压缩比。

摘要:

矩阵在各个研究领域中极为有用,因为它们提供了一种便捷的框架,以结构化的方式组织和操作数据。然而,现代矩阵可能包含数十亿个元素,使得其存储和处理在计算资源和内存使用方面相当苛刻。尽管规模过大,此类矩阵通常近似低秩。我们提出了一种利用该结构的算法,以获得任意矩阵 $\mathbf{A}$ 的低秩分解,形式为 $\mathbf{A} \approx \mathbf{L}\mathbf{R}$,其中 $\mathbf{L}$ 和 $mathbf{R}$ 是低秩因子。$\mathbf{L}$ 和 $\mathbf{R}$ 中的元素总数可以显著少于 $\mathbf{A}$ 中的元素数。此外,$\mathbf{L}$ 和 $mathbf{R}$ 的条目被量化到低精度格式,通过给出低秩和低精度分解来压缩 $\mathbf{A}$。我们的算法首先通过随机草图化其列来计算 $\mathbf{A}$ 值域空间的近似基,然后对构成该基的向量进行量化。接着,它计算 $\mathbf{A}$ 的列在该量化基上的近似投影。我们推导了算法近似误差的上界,并分析了目标秩和量化比特预算的影响。压缩比与近似精度之间的权衡允许根据具体应用需求灵活选择这些参数。我们通过实验证明了算法在图像压缩、图像和文本嵌入的最近邻分类以及压缩 LlaMa-$7$b 层方面的有效性。我们的结果表明,我们可以实现每矩阵坐标一比特的激进压缩比,同时超越或保持传统压缩技术的性能。

英文摘要:

Matrices are exceptionally useful in various fields of study as they provide a convenient framework to organize and manipulate data in a structured manner. However, modern matrices can involve billions of elements, making their storage and processing quite demanding in terms of computational resources and memory usage. Although prohibitively large, such matrices are often approximately low rank. We propose an algorithm that exploits this structure to obtain a low rank decomposition of any matrix $\mathbf{A}$ as $\mathbf{A} \approx \mathbf{L}\mathbf{R}$, where $\mathbf{L}$ and $\mathbf{R}$ are the low rank factors. The total number of elements in $\mathbf{L}$ and $\mathbf{R}$ can be significantly less than that in $\mathbf{A}$. Furthermore, the entries of $\mathbf{L}$ and $\mathbf{R}$ are quantized to low precision formats $--$ compressing $\mathbf{A}$ by giving us a low rank and low precision factorization. Our algorithm first computes an approximate basis of the range space of $\mathbf{A}$ by randomly sketching its columns, followed by a quantization of the vectors constituting this basis. It then computes approximate projections of the columns of $\mathbf{A}$ onto this quantized basis. We derive upper bounds on the approximation error of our algorithm, and analyze the impact of target rank and quantization bit-budget. The tradeoff between compression ratio and approximation accuracy allows for flexibility in choosing these parameters based on specific application requirements. We empirically demonstrate the efficacy of our algorithm in image compression, nearest neighbor classification of image and text embeddings, and compressing the layers of LlaMa-$7$b. Our results illustrate that we can achieve compression ratios as aggressive as one bit per matrix coordinate, all while surpassing or maintaining the performance of traditional compression techniques.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑