arXiv:2501.09412cs.LG2025-01被引 5

快速精准剪枝大模型,实现高效部署。

FASP: Fast and Accurate Structured Pruning of Large Language Models

  • 通过层间联动结构,同时剪除前层行与后层列,无性能损失。
  • 在OPT和LLaMA上剪枝后仍保持高精度,速度远超现有方法。
  • 适合需在低资源设备上部署大模型的研究者和开发者。

大型语言模型(LLMs)规模的快速增长显著增加了其计算与内存需求,给资源受限设备上的高效部署带来挑战。结构化剪枝作为一种有效的模型压缩方法,可在保持性能的同时降低需求。本文提出FASP(Fast and Accurate Structured Pruning),一种强调速度与精度的新型结构化剪枝框架。FASP采用独特的层间互联剪枝结构,可同时剪除某层的列与前一层的行,且不造成额外性能损失。其剪枝度量受Wanda启发,计算高效,能有效识别待剪组件。此外,我们提出一种恢复机制,在剪枝后调整剩余权重以提升模型保真度。我们在OPT与LLaMA模型族上评估FASP,结果表明其在困惑度与下游任务准确率上均优于现有先进方法。该方法实现显著加速:在单张NVIDIA RTX 4090 GPU上,对OPT-125M的剪枝仅需17秒,对LLaMA-30B的剪枝耗时15分钟,为优化大模型提供了高度实用的解决方案。

原文摘要 · Abstract (English)

The rapid increase in the size of large language models (LLMs) has significantly escalated their computational and memory demands, posing challenges for efficient deployment, especially on resource-constrained devices. Structured pruning has emerged as an effective model compression method that can reduce these demands while preserving performance. In this paper, we introduce FASP (Fast and Accurate Structured Pruning), a novel structured pruning framework for LLMs that emphasizes both speed and accuracy. FASP employs a distinctive pruning structure that interlinks sequential layers, allowing for the removal of columns in one layer while simultaneously eliminating corresponding rows in the preceding layer without incurring additional performance loss. The pruning metric, inspired by Wanda, is computationally efficient and effectively selects components to prune. Additionally, we propose a restoration mechanism that enhances model fidelity by adjusting the remaining weights post-pruning. We evaluate FASP on the OPT and LLaMA model families, demonstrating superior performance in terms of perplexity and accuracy on downstream tasks compared to state-of-the-art methods. Our approach achieves significant speed-ups, pruning models such as OPT-125M in 17 seconds and LLaMA-30B in 15 minutes on a single NVIDIA RTX 4090 GPU, making it a highly practical solution for optimizing LLMs.

模型剪枝大模型优化高效推理

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