arXiv:2501.15255cs.LGcs.AI2025-01被引 3

轻量级离线剪枝让手机端大模型更快更省内存

Lightweight and Post-Training Structured Pruning for On-Device Large Lanaguage Models

  • 分两步剪枝:先粗剪层,再细剪神经元
  • 在LLaMA-2-7B上剪20%仍提效6.13%,内存降80%
  • 无需微调,适合手机等设备部署

针对资源受限设备上大语言模型的算力与存储压力,结构化剪枝因其硬件友好性成为有效方案。传统方法需微调恢复性能,带来高内存开销与数据需求,不适用于设备端。现有离线剪枝技术常依赖特定激活函数或结构修改,应用范围受限。本文提出COMP,一种轻量级后训练结构化剪枝方法,采用混合粒度策略:先按粗粒度筛选重要层进行剪枝,再对保留层中的密集层进行细粒度神经元剪枝。为更准确评估神经元重要性,引入基于矩阵条件的新度量指标。随后通过掩码调优恢复精度,无需微调,显著降低内存消耗。实验表明,在LLaMA-2-7B模型上,20%剪枝率下性能比LLM-Pruner提升6.13%,同时内存开销减少80%。

原文摘要 · Abstract (English)

Considering the hardware-friendly characteristics and broad applicability, structured pruning has emerged as an efficient solution to reduce the resource demands of large language models (LLMs) on resource-constrained devices. Traditional structured pruning methods often need fine-tuning to recover performance loss, which incurs high memory overhead and substantial data requirements, rendering them unsuitable for on-device applications. Additionally, post-training structured pruning techniques typically necessitate specific activation functions or architectural modifications, thereby limiting their scope of applications. Herein, we introduce COMP, a lightweight post-training structured pruning method that employs a hybrid-granularity pruning strategy. COMP initially prunes selected model layers based on their importance at a coarse granularity, followed by fine-grained neuron pruning within the dense layers of each remaining model layer. To more accurately evaluate neuron importance, COMP introduces a new matrix condition-based metric. Subsequently, COMP utilizes mask tuning to recover accuracy without the need for fine-tuning, significantly reducing memory consumption. Experimental results demonstrate that COMP improves performance by 6.13\% on the LLaMA-2-7B model with a 20\% pruning ratio compared to LLM-Pruner, while simultaneously reducing memory overhead by 80\%.

模型剪枝轻量化大模型部署

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