通过动态探查实现大模型高效剪枝,少算1.5%浮点数仍大幅提升推理速度。
Probe Pruning: Accelerating LLMs through Dynamic Pruning via Model-Probing
- 用少量样本探查关键隐藏状态,识别重要权重通道
- 仅用1.5%计算量即在40%剪枝率下性能下降比现有方法低2.56倍
- 无需微调或新增模块,适配主流LLM如LLaMA-2/OPT
我们提出Probe Pruning(PP),一种面向大型语言模型(LLMs)的在线、动态、结构化剪枝框架,采用批处理方式。该方法基于不同样本与词元对模型输出贡献不均的观察,通过探测每批中的少量关键隐藏状态,提前运行若干模型层以识别核心权重。随后,在历史信息引导的剪枝阶段,将探测状态与历史状态融合,并结合专为评估权重通道重要性设计的PP重要性评分,进行结构化剪枝。最后在剩余权重上执行完整推理。其优势在于兼容现有模型,无需额外神经网络模块或微调。在LLaMA-2/3与OPT模型上的全面评估显示,即使仅使用1.5%的浮点运算量,也可显著提升结构化剪枝效率。例如,在LLaMA-2-7B与WikiText2数据集上,40%剪枝率下,性能下降与运行时间减少的比率仅为当前最优方法的2.56倍。
原文摘要 · Abstract (English)
We introduce Probe Pruning (PP), a novel framework for online, dynamic, structured pruning of Large Language Models (LLMs) applied in a batch-wise manner. PP leverages the insight that not all samples and tokens contribute equally to the model's output, and probing a small portion of each batch effectively identifies crucial weights, enabling tailored dynamic pruning for different batches. It comprises three main stages: probing, history-informed pruning, and full inference. In the probing stage, PP selects a small yet crucial set of hidden states, based on residual importance, to run a few model layers ahead. During the history-informed pruning stage, PP strategically integrates the probing states with historical states. Subsequently, it structurally prunes weights based on the integrated states and the PP importance score, a metric developed specifically to assess the importance of each weight channel in maintaining performance. In the final stage, full inference is conducted on the remaining weights. A major advantage of PP is its compatibility with existing models, as it operates without requiring additional neural network modules or fine-tuning. Comprehensive evaluations of PP on LLaMA-2/3 and OPT models reveal that even minimal probing-using just 1.5% of FLOPs-can substantially enhance the efficiency of structured pruning of LLMs. For instance, when evaluated on LLaMA-2-7B with WikiText2, PP achieves a 2.56 times lower ratio of performance degradation per unit of runtime reduction compared to the state-of-the-art method at a 40% pruning ratio. Our code is available at https://github.com/Qi-Le1/Probe_Pruning.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。