让大模型自己决定怎么剪枝,高效压缩还能少丢性能。
Towards Efficient Automatic Self-Pruning of Large Language Models
- 用大模型自动搜索每层最佳剪枝率,无需人工干预。
- 剪到490亿参数仅降0.8%准确率,提速1.39倍。
- 适合想压缩大模型又怕性能下降的部署开发者。
尽管大语言模型(LLMs)能力卓越,但其巨大规模仍带来部署挑战。训练后结构化剪枝是一种无需重训练即可降低计算开销且硬件友好的解决方案。然而,无训练特性导致显著性能下降。本文认为,缓解此问题的关键在于准确确定每层的剪枝率。同时发现,大模型自身可能具备冗余先验知识。基于此,提出端到端的自动自剪枝框架Self-Pruner,高效搜索逐层剪枝率。具体而言,利用大模型自主执行整个进化搜索过程:生成种群、选择父代、进行交叉与变异以产生子代。通过这种方式,大模型自动生成并评估大量候选方案,有效收敛至最优剪枝配置,几乎无需人工参与。大量实验表明,Self-Pruner优于现有最先进方法。特别地,在七项常识推理任务上,将LLaMA-2-70B剪至490亿参数仅损失0.80%准确率,于NVIDIA A100 80GB GPU上实现1.39×加速;进一步剪至350亿参数仅导致3.80%准确率下降,获得1.70×加速。
原文摘要 · Abstract (English)
Despite exceptional capabilities, Large Language Models (LLMs) still face deployment challenges due to their enormous size. Post-training structured pruning is a promising solution that prunes LLMs without the need for retraining, reducing computational overhead, and it is hardware-deployment friendly. However, the training-free nature of post-training structured pruning leads to significant performance degradation. We argue that the key to mitigating this issue lies in accurately determining the pruning rate for each layer. Meanwhile, we find that LLMs may have prior knowledge about their own redundancy. Based on this insight, we introduce $\textbf{Self-Pruner}$ an end-to-end automatic self-pruning framework for LLMs, which efficiently search layer-wise pruning rates. Specifically, $\textbf{Self-Pruner}$ leverages LLMs to autonomously execute the entire evolutionary search process to search for pruning rate configurations. In this process, LLMs are used to generate populations, select parent solutions from the current population, and perform crossover and mutation operations to produce offspring solutions. In this way, LLMs automatically generate and evaluate a large number of candidate solutions, effectively converging to find the pruning rate configurations with minimal human intervention. Extensive experiments demonstrate $\textbf{Self-Pruner}$'s better performance compared to existing state-of-the-art methods. Notably, $\textbf{Self-Pruner}$ prunes LLaMA-2-70B to 49B level with only 0.80$\%$ drop in accuracy across seven commonsense reasoning tasks, achieving a 1.39$\times$ speedup on NVIDIA A100 80GB GPU. Further pruning to 35B level resulted in only a 3.80$\%$ decrease in accuracy while obtaining a 1.70$\times$ speedup.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。