LoRAP:大语言模型的Transformer子层应采用差异化结构化压缩
LoRAP: Transformer Sub-Layers Deserve Differentiated Structured Compression for Large Language Models
AI总结:
针对大语言模型压缩需求,本文提出LoRAP混合压缩框架,对Transformer的MHA子层采用差异化低秩近似、对FFN子层采用无梯度结构化剪枝,实验证明在多种压缩比下性能优于现有结构化压缩方法。
摘要:
大语言模型(LLM)在复杂任务中表现出色,但通常需要海量内存与计算资源,如何降低LLM的参数规模已成为研究热点。本研究得出一项重要观察结论:Transformer的多头自注意力(MHA)子层呈现出显著的低秩结构,而前馈网络(FFN)子层则不具备该特性。基于此,我们设计了一种混合压缩模型,将低秩矩阵近似与结构化剪枝(LoRAP)有机结合。针对MHA子层,我们提出一种输入激活加权奇异值分解方法,以强化其低秩特性;此外我们发现MHA子层中的权重矩阵低秩程度各不相同,因此设计了一种基于低秩程度差异的新型参数分配方案。针对FFN子层,我们提出一种无梯度结构化通道剪枝方法,剪枝过程中我们得到一个有趣发现:最不重要的1%参数实际上对模型性能至关重要。在零样本困惑度和零样本任务分类上的大量评估表明,在多种压缩比下,本文方法均优于以往的结构化压缩同类方案。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。