arXiv:2504.21174cs.LG2025-04被引 7

提出结构化剪枝方法AMP,高效压缩大模型且保持性能。

Efficient LLMs with AMP: Attention Heads and MLP Pruning

  • 通过投影输入数据评估注意力头和MLP结构重要性
  • 30%剪枝率下零样本任务性能几乎不变,推理速度提升
  • 适用于LLaMA、Phi等多类大模型,部署友好

深度学习推动计算系统新变革,大语言模型(LLMs)在认知任务中表现接近或超越人类水平。然而其庞大参数带来高计算成本与慢推理速度,限制了在资源受限环境的部署。剪枝作为有效压缩手段,可在保持预测能力前提下减小模型规模。本文提出AMP:一种新型结构化剪枝方法,通过将输入数据投影到权重上评估注意力头与多层感知机(MLP)结构的重要性,实现对多头注意力(MHA)和MLP结构的高效裁剪。相比现有方法,AMP在灵活性与效率上更具优势。在常识推理任务上,性能比当前最优方法最高提升1.49个百分点;在30%剪枝率下,零样本任务性能几乎无损,同时显著提升推理速度,适合资源受限场景部署。实验验证了AMP在不同大模型家族(如LLaMA、Phi)上的通用性。

原文摘要 · Abstract (English)

Deep learning drives a new wave in computing systems and triggers the automation of increasingly complex problems. In particular, Large Language Models (LLMs) have significantly advanced cognitive tasks, often matching or even surpassing human-level performance. However, their extensive parameters result in high computational costs and slow inference, posing challenges for deployment in resource-limited settings. Among the strategies to overcome the aforementioned challenges, pruning emerges as a successful mechanism since it reduces model size while maintaining predictive ability. In this paper, we introduce AMP: Attention Heads and MLP Pruning, a novel structured pruning method that efficiently compresses LLMs by removing less critical structures within Multi-Head Attention (MHA) and Multilayer Perceptron (MLP). By projecting the input data onto weights, AMP assesses structural importance and overcomes the limitations of existing techniques, which often fall short in flexibility or efficiency. In particular, AMP surpasses the current state-of-the-art on commonsense reasoning tasks by up to 1.49 percentage points, achieving a 30% pruning ratio with minimal impact on zero-shot task performance. Moreover, AMP also improves inference speeds, making it well-suited for deployment in resource-constrained environments. We confirm the flexibility of AMP on different families of LLMs, including LLaMA and Phi.

大模型压缩结构化剪枝推理加速

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