BESA:通过块级参数高效稀疏性分配剪枝大型语言模型
BESA: Pruning Large Language Models with Blockwise Parameter-Efficient Sparsity Allocation
AI总结:
本文提出BESA,一种基于块级重构损失和可微分稀疏分配的LLM剪枝方法,在单GPU上五小时内高效剪枝7B至70B模型,实现最先进性能。
摘要:
大型语言模型(LLM)在文本摘要、文本问答等各类任务中展现出卓越的性能。尽管其性能令人印象深刻,但因其庞大的参数量所带来的计算开销可能令人望而却步。现有的解决方案如SparseGPT和Wanda试图通过权重剪枝来缓解这一问题。然而,它们逐层(layer-wise)的方法会显著扰动模型输出,并且需要精细的超参数调整(如剪枝率),这可能对整体模型性能产生不利影响。为解决这一问题,本文提出了一种新颖的LLM剪枝技术,称为块级参数高效稀疏性分配(BESA),通过应用块级重构损失来实现。与典型的逐层剪枝技术不同,BESA具有两个显著特征:i) 它针对单个Transformer块的整体剪枝误差进行优化;ii) 它以可微分的方式分配各层特定的稀疏性,这两者共同确保了剪枝后性能下降的减少。我们的实验表明,BESA实现了最先进的性能,在单个A100 GPU上仅需五小时即可高效剪枝如LLaMA1和LLaMA2等具有7B到70B参数的LLM。代码可在https://github.com/OpenGVLab/LLMPrune-BESA获取。
英文摘要:
Large language models (LLMs) have demonstrated outstanding performance in various tasks, such as text summarization, text question-answering, and etc. While their performance is impressive, the computational footprint due to their vast number of parameters can be prohibitive. Existing solutions such as SparseGPT and Wanda attempt to alleviate this issue through weight pruning. However, their layer-wise approach results in significant perturbation to the model's output and requires meticulous hyperparameter tuning, such as the pruning rate, which can adversely affect overall model performance. To address this, this paper introduces a novel LLM pruning technique dubbed blockwise parameter-efficient sparsity allocation (BESA) by applying a blockwise reconstruction loss. In contrast to the typical layer-wise pruning techniques, BESA is characterized by two distinctive attributes: i) it targets the overall pruning error with respect to individual transformer blocks, and ii) it allocates layer-specific sparsity in a differentiable manner, both of which ensure reduced performance degradation after pruning. Our experiments show that BESA achieves state-of-the-art performance, efficiently pruning LLMs like LLaMA1, and LLaMA2 with 7B to 70B parameters on a single A100 GPU in just five hours. Code is available at https://github.com/OpenGVLab/LLMPrune-BESA.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。