arXiv:2502.14770cs.LG2025-02ICML被引 17

提出理论方法解决大模型分层稀疏率分配难题,显著提升压缩后性能。

Determining Layer-wise Sparsity for Large Language Models Through a Theoretical Perspective

  • 用单调递增等差数列分配各层稀疏率,简化超参数调优
  • 70%稀疏的LLaMA2-7B模型困惑度降低52.10,零样本准确率提升10.50%
  • 适用于多种架构与压缩技术,可大幅加速推理(最高2.63倍)

本文从理论视角解决大型语言模型(LLMs)分层稀疏率确定问题。我们发现现有稀疏化方法存在‘重构误差爆炸’现象:早期层的误差在后续层中累积放大,导致整体重构误差显著上升,严重损害模型性能。通过理论分析,我们提出一种简单有效的分层稀疏率分配策略,采用单调递增的等差数列,将多层稀疏率设定简化为单个公差超参数的确定。该方法仅需少量试验即可找到近似最优稀疏率分配。理论与实验均证明此方案接近最优。大量实验表明,该方法在多种模型架构上显著提升稀疏化模型性能,优于现有分层稀疏方法。同时增强各类压缩技术效果,并适用于视觉与多模态模型。值得注意的是,基于Wanda方法得到的70%稀疏LLaMA2-7B模型,困惑度下降52.10,平均零样本准确率提升10.50%,在CPU和GPU上分别实现2.63×和2.23×的推理加速。

原文摘要 · Abstract (English)

In this paper, we address the challenge of determining the layer-wise sparsity rates of large language models (LLMs) through a theoretical perspective. Specifically, we identify a critical issue of ''$\textbf{reconstruction error explosion}$'' in existing LLMs sparsification methods. This refers to the cumulative effect of reconstruction errors throughout the sparsification process, where errors from earlier layers propagate and amplify in subsequent layers. As a result, the overall reconstruction error increases significantly, leading to a substantial degradation in model performance. Through theoretical analysis, we derive a simple yet effective approach to layer-wise sparsity allocation that mitigates this issue. Our method uses a monotonically increasing arithmetic progression, reducing the process of determining sparsity rates for multiple layers to the determination of a single common difference hyperparameter. Remarkably, this allows for the optimal layer-wise sparsity rates to be identified with just a few trials. Both our theoretical analysis and experimental results demonstrate that this sparsity allocation scheme is near optimal. Extensive experiments show that our method significantly improves the performance of sparse LLMs across various architectures, outperforming existing layer-wise sparsity methods. Furthermore, it enhances the performance of various compression techniques and is applicable to vision and multimodal models. Notably, our method achieves a reduction of 52.10 in perplexity for the 70$\%$ sparse LLaMA2-7B model obtained via Wanda, improves average zero-shot accuracy by 10.50$\%$, and delivers speedups of 2.63$\times$ and 2.23$\times$ on CPU and GPU, respectively.

稀疏化大模型压缩理论分析性能优化

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