arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.04342cs.CL
收藏

大语言模型的剪枝规律

Pruning Laws for Large Language Models

IIT Delhi(印度理工学院德里分校)

Ayan Sengupta, Siddhant Chaudhary, Tanmoy Chakraborty

AI总结:

本研究提出剪枝规律这一可解释缩放关系,可预测剪枝后大语言模型的性能,能跨不同模型、剪枝方法和任务迁移,为高效部署LLMs提供原则性框架。

摘要:

扩大模型参数规模和训练数据量通常能持续提升大语言模型(LLMs)的性能,但代价是内存和计算需求快速增长,导致在资源有限的硬件上部署不可行。模型剪枝是一种广泛使用的压缩技术,通过移除冗余参数降低推理成本,但其对下游性能的影响仍不可预测,通常只能通过成本高昂的经验搜索来评估。为解决这一差距,我们提出了剪枝规律,这是一种简单且可解释的缩放关系,将剪枝后LLM的性能与其未剪枝时的性能和剪枝率关联起来。在10个LLM(参数规模为13亿至300亿)、1个200亿参数的混合专家模型、3种剪枝策略(非结构化、宽度和深度)以及8个不同任务上,我们表明剪枝规律实现了较强的预测准确率(平均外推误差小于7%),可可靠量化性能下降,并确定无法恢复的关键剪枝阈值。此外,我们证明该函数形式可在密集模型和混合专家模型架构、剪枝方法以及零样本和单样本设置下的未见模型之间迁移,其任务和方法特定系数以可解释的方式变化。这些结果为研究人员和从业者提供了一个原则性框架,用于选择剪枝策略、在无需详尽调优的情况下估计安全剪枝率,并在现实世界的计算和延迟约束下高效部署LLMs。

英文摘要:

Scaling up model parameters and training data consistently improves the performance of large language models (LLMs), but at the cost of rapidly growing memory and compute requirements, which makes deployment on resource-limited hardware infeasible. Model pruning, a widely used compression technique, reduces inference costs by removing redundant parameters. However, its impact on downstream performance remains unpredictable and is typically assessed only through costly empirical sweeps. To address this gap, we introduce pruning laws, simple and interpretable scaling relations that connect a pruned LLM's post-pruning performance to its unpruned performance and pruning ratio. Across ten LLMs (1.3B-30B parameters), a 20B mixture-of-experts model, three pruning strategies (unstructured, width, and depth), and eight diverse tasks, we show that pruning laws achieve strong predictive accuracy (average extrapolation error less than 7%), reliably quantify performance degradation, and identify critical pruning thresholds beyond which recovery is infeasible. Moreover, we demonstrate that the functional form transfers across dense and mixture-of-experts architectures, pruning methods, and unseen models in zero-shot and one-shot setups, with task- and method-specific coefficients that vary in interpretable ways. These results provide both researchers and practitioners with a principled framework to select pruning strategies, estimate safe pruning ratios without exhaustive tuning, and deploy LLMs efficiently under real-world compute and latency constraints.

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

↑