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

SwiftPrune:面向大语言模型的无Hessian权重剪枝方法

SwiftPrune: Hessian-Free Weight Pruning for Large Language Models

National University of Defense Technology(国防科技大学)

Yuhan Kang, Yang Shi, Mei We, Jun He, Jianchao Yang, Zeyu Xue, Jing Feng, Xinwang Liu

AI总结:

针对现有依赖Hessian矩阵的大语言模型剪枝方法计算成本高、速度慢的问题,提出无Hessian的SwiftPrune剪枝方法,通过贡献度权重度量与EWMA技术实现高效剪枝,支持结构化稀疏,在多个LLM上实现最高56.02倍的剪枝加速。

摘要:

训练后剪枝作为大语言模型压缩的核心技术之一,在模型轻量化部署与模型稀疏化中发挥着关键作用。然而,当前主流的依赖Hessian矩阵的剪枝方法,由于二阶导数计算的计算密集特性,在剪枝速度与实际效果两方面都存在显著局限。\n本文提出SwiftPrune,一种全新的无Hessian权重剪枝方法,通过两项核心创新实现硬件友好的模型压缩:1)SwiftPrune引入基于贡献度的权重度量指标,无需依赖二阶导数即可评估权重的重要性,从而省去了计算密集的Hessian矩阵运算。2)我们采用指数加权移动平均(Exponentially Weighted Moving Average, EWMA)技术绕开权重排序步骤,能够选出对大语言模型精度贡献最大的权重,进一步降低了时间复杂度。我们的方法还扩展支持结构化稀疏剪枝,便于在现代硬件加速器上高效执行。\n我们在三个大语言模型(即LLaMA2、LLaMA3和Pythia)上验证了SwiftPrune的效果,结果表明该方法显著提升了压缩性能。实验结果显示,SwiftPrune可在数秒内完成剪枝过程,相比现有最优(SOTA)方法实现了12.29倍的平均加速比(最高可达56.02倍)。

英文摘要:

Post-training pruning, as one of the key techniques for compressing large language models, plays a vital role in lightweight model deployment and model sparsity. However, current mainstream pruning methods dependent on the Hessian matrix face significant limitations in both pruning speed and practical effectiveness due to the computationally intensive nature of second-order derivative calculations. This paper presents SwiftPrune, a novel Hessian-free weight pruning method that achieves hardware-efficient model compression through two key innovations: 1) SwiftPrune eliminates the need for computationally intensive Hessian matrix calculations by introducing a contribution-based weight metric, which evaluates the importance of weights without relying on second-order derivatives. 2) we employ the Exponentially Weighted Moving Average (EWMA) technique to bypass weight sorting, enabling the selection of weights that contribute most to LLM accuracy and further reducing time complexity. Our approach is extended to support structured sparsity pruning, facilitating efficient execution on modern hardware accelerators. We validate the SwiftPrune on three LLMs (namely LLaMA2, LLaMA3, and Pythia), demonstrating that it significantly enhances compression performance. The experimental findings reveal that SwiftPrune completes the pruning process within seconds, achieving an average speedup of 12.29x (up to 56.02x) over existing SOTA approaches.

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

↑