arXiv:2410.09615cs.LGcs.AI2024-10ICML被引 14

一拍即合的压缩方案:4比特量化+稀疏+低秩,不重训也能高精度。

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

  • 统一流程融合量化、稀疏与低秩近似,无需重训练。
  • 在LLaMA-2-7B上实现2:4稀疏+4比特量化,准确率提升5.66%。
  • 适合部署在消费级显卡和数据中心,内存节省达23%。

大模型压缩常需耗时重训练以保精度,而一次性压缩方法难以达到密集模型水平。本文提出SLiM,将硬件友好的量化、稀疏与低秩近似整合进统一流程。首先采用概率化量化(SLIM-Quant)实现均匀量化;再在量化权重上应用半结构化稀疏;最后引入新型可逆加性显著性函数,数学计算低秩适配器值,补偿累积误差。实验表明,该方法在LLaMA-2-7B上实现2:4稀疏与4比特权重量化,准确率提升最高达5.66%,优于现有方法。在Nvidia RTX3060与A100 GPU上分别实现4.3倍与3.8倍加速,端到端内存减少最高达0.23倍。另提供可选的PEFT微调方案,使LLaMA-2-13B准确率再提升1.66%。

原文摘要 · Abstract (English)

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.

模型压缩量化稀疏低秩

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。