arXiv:2410.11261cs.LGcs.AI2024-10被引 34

针对注意力矩阵设计非线性剪枝方法,提升大模型部署效率。

Beyond Linear Approximations: A Novel Pruning Approach for Attention Matrix

  • 直接优化注意力矩阵的非线性结构,突破传统线性近似限制。
  • 在保持性能前提下显著降低计算成本,优于SparseGPT和Wanda。
  • 为资源受限设备上的大模型推理提供新理论支持,适合边缘部署场景。

大型语言模型(LLMs)在对话AI、搜索和智能助手等方面展现出巨大潜力,但其庞大的模型规模给边缘设备的部署带来了内存与计算瓶颈。本文提出一种新型权重剪枝方法,直接针对Transformer架构的核心组件——注意力矩阵进行优化。与现有聚焦于线性近似的剪枝方法不同,该方法充分考虑了Softmax注意力机制的非线性特性。我们为基于梯度下降的优化方法提供了收敛性理论保证,可逼近最优剪枝掩码。实验结果表明,该非线性剪枝方法在维持模型性能的同时,大幅降低计算开销,相较当前最先进的SparseGPT和Wanda方法有显著提升。本工作建立了大模型剪枝算法设计的新理论基础,有望推动资源受限设备上更高效的LLM推理。

原文摘要 · Abstract (English)

Large Language Models (LLMs) have shown immense potential in enhancing various aspects of our daily lives, from conversational AI to search and AI assistants. However, their growing capabilities come at the cost of extremely large model sizes, making deployment on edge devices challenging due to memory and computational constraints. This paper introduces a novel approach to LLM weight pruning that directly optimizes for approximating the attention matrix, a core component of transformer architectures. Unlike existing methods that focus on linear approximations, our approach accounts for the non-linear nature of the Softmax attention mechanism. We provide theoretical guarantees for the convergence of our Gradient Descent-based optimization method to a near-optimal pruning mask solution. Our empirical results demonstrate the effectiveness of our non-linear pruning approach in maintaining model performance while significantly reducing computational costs, which is beyond the current state-of-the-art methods, i.e., SparseGPT and Wanda, by a large margin. This work establishes a new theoretical foundation for pruning algorithm design in LLMs, potentially paving the way for more efficient LLM inference on resource-constrained devices.

模型剪枝注意力机制大模型部署非线性优化

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