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

基于两阶段正则化的结构剪枝用于大语言模型

Two-Stage Regularization-Based Structured Pruning for LLMs

Tsinghua University(清华大学);Peking University(北京大学);Beijing National Research Center for Information Science and Technology(北京信息科学研究院)

Mingkuan Feng, Jinyang Wu, Siyuan Liu, Shuai Zhang, Hongjian Fang, Ruihan Jin, Feihu Che, Pengpeng Shao, Zhengqi Wen, Jianhua Tao

AI总结:

本文提出TRSP方法,通过两阶段正则化提升大语言模型结构剪枝效果,减少知识损失并无需重新训练,实验显示其优于现有方法,实现高效部署。

摘要:

大语言模型(LLMs)的部署受到参数数量的限制。结构剪枝成为有前景的解决方案。先前的结构剪枝方法直接根据某些指标删除不重要参数,常导致知识损失并需要大量重新训练。为解决此问题,我们引入了新的剪枝方法TRSP:基于两阶段正则化的结构剪枝用于LLMs。具体而言,我们乘以每个Transformer层的输出乘以一个初始可学习权重,并通过将它们的ℓ1范数作为正则化项添加到损失函数中来迭代学习这些权重,作为第一阶段正则化。随后,我们对具有较小权重的层的输出与输入的差异应用额外正则化,鼓励知识转移到保留的层。这作为第二阶段正则化。TRSP比直接参数消除保留更多知识并更好地保持模型性能。通过广泛实验,我们显示TRSP在不需重新训练的情况下优于强大的逐层结构剪枝方法。作为逐层剪枝方法,它提供了显著的端到端加速,使其成为高效LLM部署的有前景的解决方案。代码可在https://github.com/fmk345/TRSP获取。

英文摘要:

The deployment of large language models (LLMs) is largely hindered by their large number of parameters. Structural pruning has emerged as a promising solution. Prior structured pruning methods directly remove unimportant parameters based on certain metrics, which often causes knowledge loss and necessitates extensive retraining. To overcome this, we introduce a novel pruning method TRSP: Two-Stage Regularization-Based Structured Pruning for LLMs. Specifically, we multiply the output of each transformer layer by an initial learnable weight and iteratively learn these weights by adding their $\ell_1$-norm as a regularization term to the loss function, serving as the first-stage regularization. Subsequently, we apply additional regularization to the difference between the output and input of layers with smaller weights, encouraging the shift of knowledge to the preserved layers. This serves as the second-stage regularization. TRSP retains more knowledge and better preserves model performance than direct parameter elimination. Through extensive experimentation we show that TRSP outperforms strong layer-wise structured pruning methods without requiring retraining. As a layer-wise pruning method, it delivers notable end-to-end acceleration, making it a promising solution for efficient LLM deployment.Code is available at https://github.com/fmk345/TRSP.

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

↑