arXiv:2412.06419cs.CLcs.AI2024-12被引 2

提出块级重要性传播方法,让大模型剪枝更准更快。

LLM-BIP: Structured Pruning for Large Language Models with Block-Wise Forward Importance Propagation

  • 用块级前向重要性传播评估参数重要性,避免梯度误差。
  • 在多个7B/13B模型上剪枝后,推理准确率平均提升3.26%。
  • 适合需要高效部署大模型的研究者和工程师参考。

大型语言模型(LLMs)在多种语言任务中表现卓越,但其庞大体积和高计算成本阻碍了广泛应用。结构化剪枝通过移除冗余连接(如通道、注意力头)引入稀疏性,实现推理阶段的直接硬件加速。现有方法多采用全局或层级剪枝标准,但因对连接重要性评估不准而效果受限:全局方法依赖近零且不可靠的梯度,层级方法则存在剪枝误差累积问题。为此,本文提出基于块级重要性传播的精确剪枝指标——LLM-BIP。该方法通过衡量连接对对应Transformer块输出的影响来精准评估重要性,可利用Lipschitz连续性假设,在单次前向传播中高效近似计算上界。我们在LLaMA-7B、Vicuna-7B和LLaMA-13B上测试该方法,结果表明其在常见零样本推理任务中平均准确率比当前最优基线提升3.26%;在WikiText2和PTB数据集上,困惑度分别降低14.09和68.76。

原文摘要 · Abstract (English)

Large language models (LLMs) have demonstrated remarkable performance across various language tasks, but their widespread deployment is impeded by their large size and high computational costs. Structural pruning is a prevailing technique used to introduce sparsity into pre-trained models and facilitate direct hardware acceleration during inference by removing redundant connections (structurally-grouped parameters), such as channels and attention heads. Existing structural pruning approaches often employ either global or layer-wise pruning criteria; however, they are hindered by ineffectiveness stemming from inaccurate evaluation of connection importance. Global pruning methods typically assess component importance using near-zero and unreliable gradients, while layer-wise pruning approaches encounter significant pruning error accumulation issues. To this end, we propose a more accurate pruning metric based on the block-wise importance score propagation, termed LLM-BIP. Specifically, LLM-BIP precisely evaluates connection importance by gauging its influence on the respective transformer block output, which can be efficiently approximated in a single forward pass through an upper bound derived from the assumption of Lipschitz continuity. We evaluate the proposed method using LLaMA-7B, Vicuna-7B, and LLaMA-13B across common zero-shot tasks. The results demonstrate that our approach achieves an average of 3.26% increase in accuracy for common reasoning tasks compared to previous best baselines. It also reduces perplexity by 14.09 and 68.76 on average for the WikiText2 dataset and PTB dataset, respectively.

大模型剪枝结构化剪枝重要性评估推理加速

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