优化剪枝用的校准数据,能显著提升大模型压缩效果。
Beware of Calibration Data for Pruning Large Language Models
- 用相似于预训练数据的少量校准数据提升剪枝精度
- 在高稀疏度下,新策略使剪枝性能提升最高达2.68%
- 适用于主流开源大模型,尤其适合资源受限场景
随着大语言模型在各领域广泛应用,模型压缩对降低计算成本和提升推理效率至关重要。后训练剪枝无需耗时的迭代训练,仅需少量校准数据即可评估参数重要性。尽管已有研究从多个角度改进该方法,但对校准数据的影响缺乏系统探索。本文发现校准数据对高稀疏度剪枝尤为关键。通过控制实验,我们验证了小规模、与预训练数据越相似的校准数据表现越好。由于高级大模型的预训练数据通常不可获取,我们提出一种自生成校准数据合成策略。在DCLM和LLaMA-3等主流开源模型上的实验表明,该策略可使Wanda、DSnoT、OWL等强剪枝方法性能显著提升,最高达2.68%。代码已公开。
原文摘要 · Abstract (English)
As large language models (LLMs) are widely applied across various fields, model compression has become increasingly crucial for reducing costs and improving inference efficiency. Post-training pruning is a promising method that does not require resource-intensive iterative training and only needs a small amount of calibration data to assess the importance of parameters. Recent research has enhanced post-training pruning from different aspects but few of them systematically explore the effects of calibration data, and it is unclear if there exist better calibration data construction strategies. We fill this blank and surprisingly observe that calibration data is also crucial to post-training pruning, especially for high sparsity. Through controlled experiments on important influence factors of calibration data, including the pruning settings, the amount of data, and its similarity with pre-training data, we observe that a small size of data is adequate, and more similar data to its pre-training stage can yield better performance. As pre-training data is usually inaccessible for advanced LLMs, we further provide a self-generating calibration data synthesis strategy to construct feasible calibration data. Experimental results on recent strong open-source LLMs (e.g., DCLM, and LLaMA-3) show that the proposed strategy can enhance the performance of strong pruning methods (e.g., Wanda, DSnoT, OWL) by a large margin (up to $2.68\%$). Code is available at https://github.com/Dereck0602/calibration_data.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。