LoRAP: Transformer Sub-Layers Deserve Differentiated Structured Compression for Large Language Models
作者: Guangyan Li, Yongqiang Tang, Wensheng Zhang
分类: cs.LG, cs.AI, cs.CL
发布日期: 2024-04-15
备注: 8 pages,4 figures
💡 一句话要点
提出LoRAP以优化大语言模型的结构化压缩
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大语言模型 结构化压缩 低秩矩阵 多头自注意力 前馈网络 通道剪枝 深度学习
📋 核心要点
- 现有的大语言模型在性能上表现优异,但其庞大的参数规模导致高昂的计算和内存需求。
- 论文提出了一种名为LoRAP的混合压缩模型,通过结合低秩矩阵近似和结构化剪枝来优化模型结构。
- 实验结果显示,LoRAP在零-shot困惑度和零-shot任务分类上优于以往的结构化压缩方法,具有更好的性能表现。
📝 摘要(中文)
大语言模型(LLMs)在复杂任务中表现出色,但通常需要大量的内存和计算资源。如何减少LLMs的参数规模已成为研究热点。本研究观察到Transformer的多头自注意力(MHA)子层具有明显的低秩结构,而前馈网络(FFN)子层则没有。为此,我们设计了一种混合压缩模型LoRAP,结合了低秩矩阵近似和结构化剪枝。我们提出了一种输入激活加权的奇异值分解方法,以增强MHA子层的低秩特性,并发现MHA子层的权重矩阵具有不同的低秩程度。针对FFN子层,我们提出了一种无梯度的结构化通道剪枝方法。大量评估表明,我们的方法在多个压缩比下优于以往的结构化压缩方法。
🔬 方法详解
问题定义:本论文旨在解决大语言模型在参数规模和计算资源上的高需求问题,现有方法在压缩效率和模型性能之间存在矛盾。
核心思路:论文的核心思路是针对Transformer的不同子层采用差异化的压缩策略,MHA子层利用低秩特性,而FFN子层则通过结构化剪枝来优化。
技术框架:整体架构包括两个主要模块:MHA子层的低秩矩阵近似和FFN子层的无梯度结构化剪枝,二者结合形成LoRAP模型。
关键创新:最重要的技术创新在于提出了输入激活加权的奇异值分解方法和针对MHA子层不同低秩程度的参数分配方案,这与现有方法的统一压缩策略形成鲜明对比。
关键设计:在MHA子层中,采用加权奇异值分解来增强低秩特性;在FFN子层中,设计了无梯度的通道剪枝方法,发现最不重要的1%参数对模型性能至关重要。
📊 实验亮点
实验结果表明,LoRAP在多个压缩比下的零-shot困惑度和任务分类性能均优于传统的结构化压缩方法,显示出显著的性能提升,具体数据未提供,但提升幅度明显。
🎯 应用场景
该研究的潜在应用领域包括自然语言处理、机器翻译和对话系统等,能够有效降低大语言模型的资源消耗,提高其在实际应用中的可行性和效率。未来,LoRAP模型的设计理念可能会影响其他深度学习模型的压缩策略,推动更高效的AI系统发展。
📄 摘要(原文)
Large language models (LLMs) show excellent performance in difficult tasks, but they often require massive memories and computational resources. How to reduce the parameter scale of LLMs has become research hotspots. In this study, we make an important observation that the multi-head self-attention (MHA) sub-layer of Transformer exhibits noticeable low-rank structure, while the feed-forward network (FFN) sub-layer does not. With this regard, we design a mixed compression model, which organically combines Low-Rank matrix approximation And structured Pruning (LoRAP). For the MHA sub-layer, we propose an input activation weighted singular value decomposition method to strengthen the low-rank characteristic. Furthermore, we discover that the weight matrices in MHA sub-layer have different low-rank degrees. Thus, a novel parameter allocation scheme according to the discrepancy of low-rank degrees is devised. For the FFN sub-layer, we propose a gradient-free structured channel pruning method. During the pruning, we get an interesting finding that the least important 1% of parameter actually play a vital role in model performance. Extensive evaluations on zero-shot perplexity and zero-shot task classification indicate that our proposal is superior to previous structured compression rivals under multiple compression ratios.