arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2306.03078cs.CLcs.LG
收藏

SpQR:一种用于近无损 LLM 权重压缩的稀疏量化表示

SpQR: A Sparse-Quantized Representation for Near-Lossless LLM Weight Compression

University of Washington(华盛顿大学);HSE University(高等经济大学);Yandex(扬德克斯);Skoltech(斯科尔科沃科学技术研究院);IST Austria(奥地利科学技术研究所);ETH Zurich(苏黎世联邦理工学院);NeuralMagic(神经魔法公司)

Tim Dettmers, Ruslan Svirschevski, Vage Egiazarian, Denis Kuznedelev, Elias Frantar, Saleh Ashkboos, Alexander Borzunov, Torsten Hoefler, Dan Alistarh

AI总结:

本文提出 SpQR 稀疏量化格式,通过隔离高精度异常权重并将其余权重量化至 3–4 比特,实现跨规模 LLM 近无损压缩与超过 4 倍内存节省。

摘要:

大语言模型(LLM)预训练的最新进展催生了具有出色能力的高质量 LLM。通过将这类 LLM 以每参数 3–4 比特进行量化压缩,它们可以被装入笔记本电脑和移动电话等内存受限设备,从而实现个性化使用。然而,量化到每参数 3–4 比特通常会造成中到高的精度损失,尤其是对于参数量在 1–10B 范围内、非常适合边缘部署的较小模型。为解决这一精度问题,我们提出 Sparse-Quantized Representation(SpQR,稀疏量化表示),这是一种新的压缩格式和量化技术,首次实现了跨模型规模的 LLM 近无损压缩,同时达到与以往方法相近的压缩水平。SpQR 的工作方式是识别并隔离会导致特别大量化误差的异常权重,以更高精度存储它们,同时将所有其他权重压缩到 3–4 比特;对于高精度的 LLaMA 和 Falcon LLM,其在困惑度上的相对精度损失不到 1%。这使得在单张 24 GB 消费级 GPU 上运行 33B 参数 LLM 成为可能,且没有任何性能下降,并实现 15% 的加速,从而让消费者可以使用强大的 LLM 而没有任何弊端。SpQR 提供了用于将权重编码为其格式以及在运行时高效解码这些权重的高效算法。具体而言,我们为 SpQR 提供了一种高效的 GPU 推理算法,该算法在相近精度下产生比 16 位基线更快的推理,同时实现超过 4 倍的内存压缩收益。

英文摘要:

Recent advances in large language model (LLM) pretraining have led to high-quality LLMs with impressive abilities. By compressing such LLMs via quantization to 3-4 bits per parameter, they can fit into memory-limited devices such as laptops and mobile phones, enabling personalized use. However, quantization down to 3-4 bits per parameter usually leads to moderate-to-high accuracy losses, especially for smaller models in the 1-10B parameter range, which are well-suited for edge deployments. To address this accuracy issue, we introduce the Sparse-Quantized Representation (SpQR), a new compressed format and quantization technique which enables for the first time near-lossless compression of LLMs across model scales, while reaching similar compression levels to previous methods. SpQR works by identifying and isolating outlier weights, which cause particularly-large quantization errors, and storing them in higher precision, while compressing all other weights to 3-4 bits, and achieves relative accuracy losses of less than 1% in perplexity for highly-accurate LLaMA and Falcon LLMs. This makes it possible to run 33B parameter LLM on a single 24 GB consumer GPU without any performance degradation at 15% speedup thus making powerful LLMs available to consumer without any downsides. SpQR comes with efficient algorithms for both encoding weights into its format, as well as decoding them efficiently at runtime. Specifically, we provide an efficient GPU inference algorithm for SpQR which yields faster inference than 16-bit baselines at similar accuracy, while enabling memory compression gains of more than 4x.

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

↑