不计算海森矩阵,几秒完成大模型压缩,速度提升超12倍。
SwiftPrune: Hessian-Free Weight Pruning for Large Language Models
- 用贡献度指标替代海森矩阵,避免高耗时二阶导计算。
- 结合指数加权平均,跳过排序直接选关键权重,提速显著。
- 支持结构化稀疏,适合部署在现代硬件加速器上。
训练后剪枝是压缩大语言模型的关键技术,对轻量化部署和模型稀疏化至关重要。然而,现有主流方法依赖海森矩阵,因二阶导数计算代价高,导致剪枝速度慢且实际效果受限。本文提出 SwiftPrune,一种新型无海森矩阵的权重剪枝方法,通过两项核心创新实现高效硬件压缩:1)引入基于贡献度的权重评估指标,无需二阶导数即可衡量权重重要性;2)采用指数加权移动平均(EWMA)技术,跳过权重排序步骤,直接选取对模型精度贡献最大的权重,进一步降低时间复杂度。该方法扩展支持结构化稀疏剪枝,便于在现代硬件加速器上高效执行。在 LLaMA2、LLaMA3 与 Pythia 三个大模型上的实验表明,SwiftPrune 能在数秒内完成剪枝,相比当前最先进方法平均提速 12.29 倍(最高达 56.02 倍)。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。