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

LoRAPrune:结构化剪枝遇上低秩参数高效微调

LoRAPrune: Structured Pruning Meets Low-Rank Parameter-Efficient Fine-Tuning

Zhejiang University(浙江大学);Zhejiang University of Technology(浙江工业大学);Ant Group(蚂蚁集团)

Mingyang Zhang, Hao Chen, Chunhua Shen, Zhen Yang, Linlin Ou, Xinyi Yu, Bohan Zhuang

AI总结:

本文提出LoRAPrune框架,利用LoRA权重与梯度设计剪枝准则,以内存高效方式对LLMs进行结构化剪枝,在LLaMA系列上优于现有方法并显著降低内存占用。

摘要:

大型语言模型(LLMs),如LLaMA和T5,通过微调在各种任务上展现了卓越的性能。尽管低秩适配(LoRA)已经出现,能够以低成本在下游任务上微调这些LLMs,但其部署仍然受到庞大模型规模和计算成本的阻碍。训练后模型剪枝提供了一种压缩LLMs的方法。然而,当前为LLMs设计的剪枝方法与LoRA不兼容。这是因为它们在LLMs上采用非结构化剪枝,阻碍了LoRA权重的合并,或者依赖预训练权重的梯度来指导剪枝,这会带来显著的内存开销。为此,我们提出了LoRAPrune,这是一个新框架,能够以高度内存高效的方式提供精确的结构化剪枝模型。具体来说,我们首先设计了一种LoRA引导的剪枝准则,该准则使用LoRA的权重和梯度,而不是预训练权重的梯度来进行重要性估计。随后,我们将该准则集成到迭代剪枝过程中,有效移除冗余的通道和头。大量实验结果表明,我们的LoRAPrune在LLaMA系列模型上优于现有方法。在50%压缩率下,LoRAPrune展现出优于LLM-Pruner的性能,在WikiText2上困惑度降低了4.81,在PTB上降低了3.46,同时内存使用量减少了52.6%。此外,LoRAPrune在多个LLMs上也能与半结构化剪枝相媲美,证明了其广泛的适用性。代码可在https://github.com/aim-uofa/LoRAPrune获取。

英文摘要:

Large Language Models (LLMs), such as LLaMA and T5, have shown exceptional performance across various tasks through fine-tuning. Although low-rank adaption (LoRA) has emerged to cheaply fine-tune these LLMs on downstream tasks, their deployment is still hindered by the vast model scale and computational costs. Post-training model pruning offers a way to compress LLMs. However, the current pruning methods designed for LLMs are not compatible with LoRA. This is due to their utilization of unstructured pruning on LLMs, impeding the merging of LoRA weights, or their dependence on the gradients of pre-trained weights to guide pruning, which can impose significant memory overhead. To this end, we propose LoRAPrune, a new framework that delivers an accurate structured pruned model in a highly memory-efficient manner. Specifically, we first design a LoRA-guided pruning criterion, which uses the weights and gradients of LoRA, rather than the gradients of pre-trained weights for importance estimation. We subsequently integrate this criterion into an iterative pruning process, effectively removing redundant channels and heads. Extensive experimental results demonstrate the superior performance of our LoRAPrune over existing approaches on the LLaMA series models. At a 50\% compression rate, LoRAPrune demonstrates superior performance over LLM-Pruner, achieving a reduction in perplexity by 4.81 on WikiText2 and 3.46 on PTB, while also decreasing memory usage by 52.6%. Besides, LoRAPrune also matches semi-structural pruning across multiple LLMs, proving its wide applicability. The code is available at https://github.com/aim-uofa/LoRAPrune.

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

↑