AlphaPruning: Using Heavy-Tailed Self Regularization Theory for Improved Layer-wise Pruning of Large Language Models

📄 arXiv: 2410.10912v1 📥 PDF

作者: Haiquan Lu, Yefan Zhou, Shiwei Liu, Zhangyang Wang, Michael W. Mahoney, Yaoqing Yang

分类: cs.LG, stat.ML

发布日期: 2024-10-14

备注: NeurIPS 2024, first two authors contributed equally

🔗 代码/项目: GITHUB


💡 一句话要点

提出AlphaPruning以优化大语言模型的层级剪枝

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大语言模型 剪枝技术 重尾自正则化 层级稀疏化 模型压缩 自然语言处理 深度学习

📋 核心要点

  1. 现有大语言模型剪枝方法通常在各层之间采用统一的剪枝比例,导致整体剪枝能力受限。
  2. 本文提出AlphaPruning,利用重尾自正则化理论设计层级剪枝比例,以更理论化的方式分配稀疏性。
  3. 实验结果显示,AlphaPruning能够将LLaMA-7B模型剪枝至80%稀疏率,同时保持合理的性能表现。

📝 摘要(中文)

近年来对大语言模型(LLMs)剪枝的研究表明,可以在不影响性能的情况下消除大量参数,从而有效减小模型规模。然而,现有的剪枝策略通常在各层之间分配统一的剪枝比例,限制了整体剪枝能力。本文利用重尾自正则化理论,特别是权重矩阵的经验谱密度形状,设计了改进的层级剪枝比例。我们提出的AlphaPruning方法能够更理论性地分配层级稀疏比,并在多个现有剪枝方法中应用。实验结果表明,AlphaPruning能够将LLaMA-7B剪枝至80%的稀疏率,同时保持合理的困惑度,标志着LLMs领域的首次突破。

🔬 方法详解

问题定义:本文旨在解决现有大语言模型剪枝方法在层级剪枝中普遍采用统一剪枝比例的问题,这种方法往往导致剪枝效果不佳,无法充分利用各层的可剪枝性。

核心思路:论文提出的AlphaPruning方法基于重尾自正则化理论,分析权重矩阵的经验谱密度形状,以此为依据设计层级剪枝比例,从而实现更有效的模型稀疏化。

技术框架:AlphaPruning的整体框架包括数据预处理、权重矩阵谱密度分析、层级稀疏比分配及剪枝实施等主要模块。首先,通过分析权重矩阵的谱密度,识别各层的可剪枝性,然后根据分析结果分配不同的剪枝比例,最后实施剪枝操作。

关键创新:该方法的核心创新在于引入重尾自正则化理论,通过谱密度形状的分析为层级剪枝提供理论支持,与传统的均匀剪枝方法形成鲜明对比。

关键设计:在参数设置上,AlphaPruning根据各层的谱密度特征动态调整剪枝比例,确保在剪枝过程中保持模型性能。此外,损失函数的设计也考虑了剪枝后的模型性能,以实现更好的平衡。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,AlphaPruning能够将LLaMA-7B模型剪枝至80%的稀疏率,同时保持合理的困惑度,展示了在大语言模型剪枝领域的显著提升。这一成果在文献中尚属首次,标志着剪枝技术的重大进展。

🎯 应用场景

AlphaPruning方法在大语言模型的剪枝中具有广泛的应用潜力,能够有效减小模型规模,降低计算资源消耗,适用于各种自然语言处理任务。随着模型规模的不断扩大,该方法的实际价值将愈加显著,未来可能推动更高效的模型部署与应用。

📄 摘要(原文)

Recent work on pruning large language models (LLMs) has shown that one can eliminate a large number of parameters without compromising performance, making pruning a promising strategy to reduce LLM model size. Existing LLM pruning strategies typically assign uniform pruning ratios across layers, limiting overall pruning ability; and recent work on layerwise pruning of LLMs is often based on heuristics that can easily lead to suboptimal performance. In this paper, we leverage Heavy-Tailed Self-Regularization (HT-SR) Theory, in particular the shape of empirical spectral densities (ESDs) of weight matrices, to design improved layerwise pruning ratios for LLMs. Our analysis reveals a wide variability in how well-trained, and thus relatedly how prunable, different layers of an LLM are. Based on this, we propose AlphaPruning, which uses shape metrics to allocate layerwise sparsity ratios in a more theoretically principled manner. AlphaPruning can be used in conjunction with multiple existing LLM pruning methods. Our empirical results show that AlphaPruning prunes LLaMA-7B to 80% sparsity while maintaining reasonable perplexity, marking a first in the literature on LLMs. We have open-sourced our code at https://github.com/haiquanlu/AlphaPruning.