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

SLiM:面向LLM权重压缩的基于低秩近似的一次性量化与稀疏化方法

SLiM: One-shot Quantization and Sparsity with Low-rank Approximation for LLM Weight Compression

University of Toronto(多伦多大学);Google DeepMind(谷歌DeepMind);NVIDIA Research(NVIDIA研究)

Mohammad Mozaffari, Amir Yazdanbakhsh, Maryam Mehri Dehnavi

AI总结:

本文提出一次性压缩框架SLIM,将硬件友好的量化、半结构化稀疏性与低秩近似相集成,通过概率量化、剪枝及新颖显著性函数补偿误差,显著提升了模型精度并降低了内存和推理开销。

摘要:

针对LLM的常规模型压缩技术解决了高内存消耗和推理缓慢的挑战,但通常需要计算成本昂贵的重训练来保持精度。相比之下,一次性压缩方法消除了重训练成本,但难以达到与稠密模型相当的精度。本文提出了SLIM,这是一种新的一次性压缩框架,它将硬件友好的量化、稀疏性和低秩近似整体集成到一个统一的过程中。首先,我们使用概率方法(SLIM-Quant)来表述量化过程,使我们能够应用均匀量化。然后,我们使用现有的一次性剪枝方法在量化权重之上应用半结构化稀疏性。最后,为了补偿引入的聚合量化和稀疏误差,我们使用一种具有独特可逆和可加特性的新颖显著性函数,使我们能够在数学上计算低秩适配器的值。在2:4稀疏性和4位权重量化下,SLIM将模型精度提高了高达5.66%(LLaMA-2-7B),优于先前的方法。使用SLIM压缩的模型在Nvidia RTX3060和A100 GPU上分别实现了高达4.3倍和3.8倍的加速。此外,与稠密对应模型相比,它们实现了高达0.23倍的端到端内存减少。我们还提出了一种可选的PEFT方案,与无需微调的SLIM相比,进一步将精度提高了高达1.66%(LLaMA-2-13B)。

英文摘要:

Conventional model compression techniques for LLMs address high memory consumption and slow inference challenges but typically require computationally expensive retraining to preserve accuracy. In contrast, one-shot compression methods eliminate retraining cost, but struggle to achieve accuracy comparable to dense models. This paper presents SLIM, a new one-shot compression framework that holistically integrates hardware-friendly quantization, sparsity, and low-rank approximation into a unified process. First, we formulate the quantization process using a probabilistic approach (SLIM-Quant) that enables us to apply uniform quantization. Then, we use an existing one-shot pruning method to apply semi-structured sparsity on top of the quantized weights. Finally, to compensate for the introduced aggregated quantization and sparsity error, we use a novel saliency function with unique invertible and additive features that enables us to mathematically compute the value of low-rank adapters. SLIM improves model accuracy by up to 5.66% (LLaMA-2-7B) for 2:4 sparsity with 4-bit weight quantization, outperforming prior methods. Models compressed with SLIM achieve up to 4.3x and 3.8x on Nvidia RTX3060 and A100 GPUs, respectively. Additionally, they achieve up to 0.23x end-to-end memory reduction in comparison to their dense counterparts. We also propose an optional PEFT recipe that further improves accuracy by up to 1.66% (LLaMA-2-13B) compared to SLIM without fine-tuning.

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

↑