arXiv:2411.07066cs.LGcs.AI2024-11被引 4

不重训练就能高效剪枝大模型,提升性能与速度平衡

Zeroth-Order Adaptive Neuron Alignment Based Pruning without Re-Training

  • 基于密集模型激活信息,动态调整块级和行级稀疏度
  • 在300多个测试中,比当前最佳方法性能-速度更优
  • 适用于各类大模型,无需重训练,适合部署优化场景

网络剪枝旨在通过移除部分参数降低模型计算成本,同时尽量减少性能损失。近年来主流方法为剪枝后重训练,但面对海量预训练模型,重训练代价过高。本文提出NeuroAl,一种无需重训练的上层剪枝算法,利用密集模型的输入激活信息,最大化稀疏模型与原模型激活值的对齐程度。该方法自适应选择块级与行级稀疏率,基于模型结构和目标稀疏度动态调整,适用于各类大语言模型。我们在四个大模型族、三种稀疏率、十项语言任务(三类语言建模,七类零样本)下测试,共覆盖约300个实验,结果表明其在性能-运行时间权衡上持续优于最新最先进方法。代码已开源。

原文摘要 · Abstract (English)

Network pruning focuses on algorithms that aim to reduce a given model's computational cost by removing a subset of its parameters while having minimal impact on performance. Throughout the last decade, the most widely used pruning paradigm has been pruning and re-training, which nowadays is inconvenient due to the vast amount of pre-trained models, which are, in any case, too expensive to re-train. In this paper, we exploit functional information from dense pre-trained models, i.e., their input activations, to obtain sparse models that maximize the activations' alignment with respect to their corresponding dense models. Hence, we propose \textbf{NeuroAl}, a \emph{top-up} algorithm that can be used on top of any given pruning algorithm for LLMs, which modifies the block-wise and row-wise sparsity, exploiting information from both the dense model and its sparse version to maximize the \emph{neuron alignment} among activations. Different from existing methods, our approach adaptively selects the best hyperparameters for the block-wise and row-wise sparsity ratios w.r.t. the model and the desired sparsity, and requires \emph{no re-training}. We test our method over $\sim$300 test cases with four LLM families, three sparsity ratios, and ten language tasks (three language modeling and seven zero-shot datasets), showing how it consistently outperforms the latest state-of-the-art methods in terms of performance-runtime trade-off. The code is available at \href{https://github.com/eliacunegatti/NeuroAL}{https://github.com/eliacunegatti/NeuroAL}.

模型剪枝大模型优化无重训练

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。