Outlier Weighed Layerwise Sparsity (OWL): A Missing Secret Sauce for Pruning LLMs to High Sparsity

📄 arXiv: 2310.05175v4 📥 PDF

作者: Lu Yin, You Wu, Zhenyu Zhang, Cheng-Yu Hsieh, Yaqing Wang, Yiling Jia, Gen Li, Ajay Jaiswal, Mykola Pechenizkiy, Yi Liang, Michael Bendersky, Zhangyang Wang, Shiwei Liu

分类: cs.LG

发布日期: 2023-10-08 (更新: 2025-06-30)

备注: Published at ICML 2024

🔗 代码/项目: GITHUB


💡 一句话要点

提出OWL方法以解决LLMs高稀疏性修剪问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 网络修剪 稀疏性 异常值 深度学习

📋 核心要点

  1. 现有的LLMs修剪方法普遍采用均匀稀疏性,未能充分利用层间的差异性,导致性能提升有限。
  2. 本文提出的OWL方法通过引入非均匀层稀疏性,依据每层的异常值比率调整稀疏性,从而提高修剪效果。
  3. 实验证明,OWL在LLaMA-V1和OPT模型上表现优异,分别在70%稀疏性下超越Wanda和SparseGPT,且推理速度提升2.6倍。

📝 摘要(中文)

大型语言模型(LLMs)因其卓越的性能而广受关注,但在实际部署中面临巨大的模型规模挑战。为此,研究者们尝试将传统网络修剪技术应用于LLMs,发现可以在不影响性能的情况下进行大量参数的修剪。现有的修剪策略通常采用均匀稀疏性,但与视觉模型的非均匀层稀疏性趋势相悖。为了解释这一差异,本文研究发现LLMs中的激活异常值与层稀疏性之间存在强相关性。基于此,提出了一种新的修剪方法——异常值加权层稀疏性(OWL),其稀疏性比率与每层的异常值比率成正比,从而实现了更有效的层稀疏性与异常值比率的对齐。实验证明,OWL在多个基准测试中优于现有方法,尤其在70%高稀疏性下,性能提升显著。

🔬 方法详解

问题定义:本文旨在解决大型语言模型(LLMs)在高稀疏性修剪中的性能损失问题。现有方法通常采用均匀稀疏性,未能充分考虑不同层的特性,导致修剪效果不佳。

核心思路:提出的OWL方法通过分析LLMs中的激活异常值,设计出与异常值比率成正比的非均匀层稀疏性比率,从而实现更有效的修剪。

技术框架:OWL方法的整体框架包括数据预处理、异常值检测、稀疏性比率计算和模型修剪四个主要模块。首先对模型进行激活值分析,识别出异常值,然后根据这些异常值计算每层的稀疏性比率,最后进行模型的修剪与评估。

关键创新:OWL的核心创新在于引入了异常值加权的非均匀层稀疏性设计,这与传统的均匀稀疏性方法形成鲜明对比,使得修剪过程更加灵活且有效。

关键设计:在OWL中,稀疏性比率的计算依赖于每层的激活异常值比率,采用了特定的损失函数来优化模型性能,同时在网络结构上保持了原有模型的完整性。通过这种设计,OWL能够在高稀疏性下保持较好的性能。

🖼️ 关键图片

fig_0

📊 实验亮点

在多个基准测试中,OWL方法在70%稀疏性下,性能超越了当前最先进的Wanda和SparseGPT,分别提升了61.22和6.80的困惑度,同时在DeepSparse推理引擎中实现了2.6倍的推理速度提升,显示出显著的优势。

🎯 应用场景

该研究的OWL方法在大型语言模型的修剪中具有广泛的应用潜力,能够有效降低模型的计算资源需求,提升推理速度,适用于实时应用场景,如智能助手、对话系统等。未来,该方法还可能推动更高效的模型设计和优化策略,促进LLMs在边缘设备上的部署。

📄 摘要(原文)

Large Language Models (LLMs), renowned for their remarkable performance across diverse domains, present a challenge when it comes to practical deployment due to their colossal model size. In response to this challenge, efforts have been directed toward the application of traditional network pruning techniques to LLMs, uncovering a massive number of parameters that can be pruned in one-shot without hurting performance. Prevailing LLM pruning strategies have consistently adhered to the practice of uniformly pruning all layers at equivalent sparsity, resulting in robust performance. However, this observation stands in contrast to the prevailing trends observed in the field of vision models, where non-uniform layerwise sparsity typically yields stronger results. To understand the underlying reasons for this disparity, we conduct a comprehensive study and discover a strong correlation with the emergence of activation outliers in LLMs. Inspired by this finding, we introduce a novel LLM pruning methodology that incorporates a tailored set of non-uniform layerwise sparsity ratios, termed as Outlier Weighed Layerwise sparsity (OWL). The sparsity ratio of OWL is proportional to the outlier ratio observed within each layer, facilitating a more effective alignment between layerwise weight sparsity and outlier ratios. Our empirical evaluation, conducted across the LLaMA-V1 family and OPT, spanning various benchmarks, demonstrates the distinct advantages offered by OWL over previous methods. For instance, OWL exhibits a remarkable performance gain, surpassing the state-of-the-art Wanda and SparseGPT by 61.22 and 6.80 perplexity at a high sparsity level of 70%, respectively, while delivering 2.6x end-to-end inference speed-up in the DeepSparse inference engine. Codes are available at https://github.com/luuyin/OWL.