arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.10714cs.LGcs.AI
收藏

SeedLM:将LLM权重压缩为伪随机生成器的种子

SeedLM: Compressing LLM Weights into Seeds of Pseudo-Random Generators

Meta;Apple(苹果公司)

Rasoul Shafipour, David Harrison, Maxwell Horton, Jeffrey Marker, Houman Bedayat, Sachin Mehta, Mohammad Rastegari, Mahyar Najibi, Saman Naderiparizi

AI总结:

本文提出SeedLM,一种无数据的训练后LLM压缩方法,利用伪随机生成器种子和LFSR重建权重块,在3/4位压缩下保持高准确率并实现近4倍推理加速。

摘要:

大型语言模型(LLMs)已经改变了自然语言处理,但由于其高昂的运行时成本,在广泛部署方面面临重大挑战。在本文中,我们介绍了SeedLM,这是一种新颖的训练后压缩方法,它使用伪随机生成器的种子来编码和压缩模型权重。具体而言,对于每个权重块,我们找到一个种子,在推理期间将其输入到线性反馈移位寄存器(LFSR)中以高效生成随机矩阵。然后,该矩阵与压缩系数线性组合以重建权重块。SeedLM减少了内存访问,并利用了推理期间的空闲计算周期,通过以计算换取更少的内存访问,有效地加速了内存受限任务。与依赖校准数据的最先进压缩方法不同,我们的方法是无数据的,并且在各种任务中具有良好的泛化能力。我们对Llama 3 70B(其特别难以压缩)的实验表明,SeedLM在4位和3位下的零样本准确率保留率显著优于最先进的技术,同时保持与FP16基线相当的性能。此外,基于FPGA的测试表明,随着模型规模增加到70B,4位SeedLM的加速比接近FP16 Llama 2/3基线的4倍。

英文摘要:

Large Language Models (LLMs) have transformed natural language processing, but face significant challenges in widespread deployment due to their high runtime cost. In this paper, we introduce SeedLM, a novel post-training compression method that uses seeds of pseudo-random generators to encode and compress model weights. Specifically, for each block of weights, we find a seed that is fed into a Linear Feedback Shift Register (LFSR) during inference to efficiently generate a random matrix. This matrix is then linearly combined with compressed coefficients to reconstruct the weight block. SeedLM reduces memory access and leverages idle compute cycles during inference, effectively speeding up memory-bound tasks by trading compute for fewer memory accesses. Unlike state-of-the-art compression methods that rely on calibration data, our approach is data-free and generalizes well across diverse tasks. Our experiments with Llama 3 70B, which is particularly challenging to compress, show that SeedLM achieves significantly better zero-shot accuracy retention at 4- and 3-bit than state-of-the-art techniques, while maintaining performance comparable to FP16 baselines. Additionally, FPGA-based tests demonstrate that 4-bit SeedLM, as model size increases to 70B, approaches a 4x speed-up over an FP16 Llama 2/3 baseline.

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

↑