arXiv:2409.13199cs.CL2024-09被引 12

提出一种高效结构化剪枝框架,用粗细粒度激活信息指导剪枝。

CFSP: An Efficient Structured Pruning Framework for LLMs with Coarse-to-Fine Activation Information

  • 利用块间与块内激活信息评估重要性,仅需一次前向传播计算。
  • 在高稀疏率下仍保持模型性能,优于现有方法。
  • 适合资源受限设备部署,无需专用硬件支持。

大型语言模型(LLMs)的庞大参数量和计算开销制约了其实际应用。网络剪枝通过移除冗余参数实现结构化或非结构化稀疏,近年来被用于加速LLM。现有工作多聚焦于非结构化剪枝,通常需要特殊硬件才能获得实际加速。相比之下,结构化剪枝可在通用设备上降低延迟,但高效执行且维持性能仍具挑战,尤其在高稀疏率下。为此,我们提出一种名为CFSP的高效结构化剪枝框架,利用粗粒度(块间)与细粒度(块内)激活信息作为重要性准则指导剪枝。剪枝过程极为高效,仅需一次前向传播即可计算特征激活。具体而言,先根据块的重要性分配稀疏预算,再保留每个块内的关键权重。此外,引入一种自适应恢复微调策略,基于粗粒度重要性动态分配训练开销,进一步提升性能。实验表明,CFSP在多种模型和不同稀疏率下均优于现有方法。代码将开源至 https://github.com/wyxscir/CFSP。

原文摘要 · Abstract (English)

The colossal parameters and computational overhead of Large Language Models (LLMs) challenge their real-world applications. Network pruning, which targets unstructured or structured sparsity by removing redundant parameters, has recently been explored for LLM acceleration. Existing LLM pruning works focus on unstructured pruning, which typically requires special hardware support for a practical speed-up. In contrast, structured pruning can reduce latency on general devices. However, it remains a challenge to perform structured pruning efficiently and maintain performance, especially at high sparsity ratios. To this end, we introduce an efficient structured pruning framework named CFSP, which leverages both Coarse (interblock) and Fine-grained (intrablock) activation information as an importance criterion to guide pruning. The pruning is highly efficient, as it only requires one forward pass to compute feature activations. Specifically, we first allocate the sparsity budget across blocks based on their importance and then retain important weights within each block. In addition, we introduce a recovery fine-tuning strategy that adaptively allocates training overhead based on coarse-grained importance to further improve performance. Experimental results demonstrate that CFSP outperforms existing methods on diverse models across various sparsity budgets. Our code will be available at https://github.com/wyxscir/CFSP.

结构化剪枝大模型压缩高效推理

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