arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2311.04902cs.CLcs.AIcs.LG
收藏

超越规模:梯度如何塑造大语言模型中的剪枝决策

Beyond Size: How Gradients Shape Pruning Decisions in Large Language Models

Mohamed bin Zayed University of AI(穆罕默德·本·扎耶德人工智能大学);Carnegie Mellon University(卡内基梅隆大学)

Rocktim Jyoti Das, Mukul Ranjan, Mingjie Sun, Liqun Ma, Zhiqiang Shen

AI总结:

本文提出基于梯度的无训练剪枝方法 GBLM-Pruner,利用校准样本归一化梯度确定剪枝度量,在 LLaMA 和 Vision Transformer 上显著优于 SparseGPT、Wanda 等现有方法。

摘要:

拥有数十亿参数的大语言模型(LLMs)是网络剪枝的主要对象,剪枝可在不损害性能的情况下移除部分模型权重。此前的方法,如幅度剪枝、SparseGPT 和 Wanda,要么只关注权重,要么将权重与激活值结合以实现稀疏性。然而,它们忽略了从预训练 LLMs 中获得的具有信息量的梯度。在本文中,我们提出了一种面向预训练 LLMs 的新型以稀疏性为核心的剪枝方法,称为基于梯度的语言模型剪枝器(GBLM-Pruner)。GBLM-Pruner 利用泰勒展开的一阶项,以无训练方式运行,通过利用少量校准样本中经过适当归一化的梯度来确定剪枝度量,并在多个基准上显著优于 SparseGPT 和 Wanda 等竞争方法。有趣的是,通过引入梯度,使用我们方法的非结构化剪枝往往会揭示出一些结构模式,这反映了 LLMs 参数结构中固有的几何相互依赖性。此外,GBLM-Pruner 无需任何后续重训练或权重更新即可运行,从而保持与其他方法一样的简洁性。在 LLaMA-1 和 LLaMA-2 上跨多个基准的广泛评估表明,GBLM-Pruner 以显著优势超过幅度剪枝、Wanda 和 SparseGPT。我们进一步将方法扩展到 Vision Transformer。代码和模型可在 https://github.com/VILA-Lab/GBLM-Pruner 获取。

英文摘要:

Large Language Models (LLMs) with billions of parameters are prime targets for network pruning, which removes some model weights without hurting performance. Prior approaches such as magnitude pruning, SparseGPT, and Wanda either concentrated solely on weights or integrated weights with activations for sparsity. However, they overlooked the informative gradients derived from pretrained LLMs. In this paper, we present a novel sparsity-centric pruning method for pretrained LLMs, termed Gradient-based Language Model Pruner (GBLM-Pruner). GBLM-Pruner leverages the first-order term of the Taylor expansion, operating in a training-free manner by harnessing properly normalized gradients from a few calibration samples to determine the pruning metric, and substantially outperforms competitive counterparts like SparseGPT and Wanda in multiple benchmarks. Intriguingly, by incorporating gradients, unstructured pruning with our method tends to reveal some structural patterns, which mirrors the geometric interdependence inherent in the LLMs' parameter structure. Additionally, GBLM-Pruner functions without any subsequent retraining or weight updates to maintain its simplicity as other counterparts. Extensive evaluations on LLaMA-series, Qwen-Series and Deepseek models across zero-shot, STEM-Reasoning and Coding benchmarks show that GBLM-Pruner surpasses magnitude pruning and Wanda by significant margins and performs competitively against SparseGPT which involves intensive weight updates. We further extend our approach on Vision Transformer and Vision Language Models. Our code and models are available at https://github.com/VILA-Lab/GBLM-Pruner.

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

↑