arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2501.15255cs.LGcs.AI
收藏

面向端侧大型语言模型的轻量级训练后结构化剪枝

Lightweight and Post-Training Structured Pruning for On-Device Large Lanaguage Models

School of Computer Science and Technology, University of Science and Technology of China(中国科学技术大学计算机科学与技术学院);Suzhou Institute for Advanced Research, University of Science and Technology of China(中国科学技术大学苏州高等研究院)

Zihuai Xu, Yang Xu, Hongli Xu, Yunming Liao, Zhiwei Yao, Zuan Xie

AI总结:

提出轻量级训练后结构化剪枝方法COMP,采用混合粒度策略和矩阵条件度量,通过掩码调整恢复准确率,在LLaMA-2-7B上实现性能提升并大幅降低内存开销。

摘要:

考虑到硬件友好的特性和广泛的适用性,结构化剪枝已成为降低大型语言模型(LLMs)在资源受限设备上资源需求的有效解决方案。传统的结构化剪枝方法通常需要微调来恢复性能损失,这会带来高内存开销和大量数据需求,使其不适用于端侧应用。此外,训练后结构化剪枝技术通常需要特定的激活函数或架构修改,从而限制了其应用范围。在此,我们提出了COMP,一种采用混合粒度剪枝策略的轻量级训练后结构化剪枝方法。COMP首先基于重要性以粗粒度剪枝选定的模型层,随后在每个剩余模型层的密集层内进行细粒度的神经元剪枝。为了更准确地评估神经元重要性,COMP引入了一种新的基于矩阵条件的度量标准。随后,COMP利用掩码调整来恢复准确率而无需微调,显著降低了内存消耗。实验结果表明,在LLaMA-2-7B模型上,与LLM-Pruner相比,COMP在20%的剪枝率下将性能提升了6.13%,同时将内存开销减少了80%。

英文摘要:

Considering the hardware-friendly characteristics and broad applicability, structured pruning has emerged as an efficient solution to reduce the resource demands of large language models (LLMs) on resource-constrained devices. Traditional structured pruning methods often need fine-tuning to recover performance loss, which incurs high memory overhead and substantial data requirements, rendering them unsuitable for on-device applications. Additionally, post-training structured pruning techniques typically necessitate specific activation functions or architectural modifications, thereby limiting their scope of applications. Herein, we introduce COMP, a lightweight post-training structured pruning method that employs a hybrid-granularity pruning strategy. COMP initially prunes selected model layers based on their importance at a coarse granularity, followed by fine-grained neuron pruning within the dense layers of each remaining model layer. To more accurately evaluate neuron importance, COMP introduces a new matrix condition-based metric. Subsequently, COMP utilizes mask tuning to recover accuracy without the need for fine-tuning, significantly reducing memory consumption. Experimental results demonstrate that COMP improves performance by 6.13\% on the LLaMA-2-7B model with a 20\% pruning ratio compared to LLM-Pruner, while simultaneously reducing memory overhead by 80\%.

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

↑