[论文解读] LoSparse: Structured Compression of Large Language Models based on Low-Rank and Sparse Approximation
LoSparse 通过将每个权重矩阵分解为低秩部分加上稀疏部分来压缩变换器权重,在 NLU、QA、NLG 任务上比先前的剪枝或纯低秩方法表现更好。
Transformer models have achieved remarkable results in various natural language tasks, but they are often prohibitively large, requiring massive memories and computational resources. To reduce the size and complexity of these models, we propose LoSparse (Low-Rank and Sparse approximation), a novel model compression technique that approximates a weight matrix by the sum of a low-rank matrix and a sparse matrix. Our method combines the advantages of both low-rank approximations and pruning, while avoiding their limitations. Low-rank approximation compresses the coherent and expressive parts in neurons, while pruning removes the incoherent and non-expressive parts in neurons. Pruning enhances the diversity of low-rank approximations, and low-rank approximation prevents pruning from losing too many expressive neurons. We evaluate our method on natural language understanding, question answering, and natural language generation tasks. We show that it significantly outperforms existing compression methods.
研究动机与目标
- 需要有效压缩大型变换器模型的动机。
- 提出一组联合低秩加稀疏近似,以捕捉连贯和非连贯的神经元部分。
- 开发一种算法来训练并剪枝稀疏分量,同时保留预训练知识。
- 在自然语言理解、问答与自然语言生成任务上证明有效性。
提出的方法
- 将每个权重 W 近似为 W = UV + S,其中 U,V 形成低秩矩阵,S 为结构化稀疏矩阵。
- 从 W(0) 的前 k 行向量的 SVD 中初始化 U 和 V,并将 S(0) 设置为 W(0) − UV;将前向传播替换为 Y = (XU)V + XS。
- 通过梯度步更新 U,V,S;通过神经元重要性分数 Γ(S*i) 来剪枝 S,只保留前 p_t% 的神经元,p_t 采用立方衰减计划。
- 将神经元重要性 Γ(W*i) 计算为跨神经元的 I(wij) = | w_ij ∂L/∂w_ij | 的平均平滑重要性,以适用于结构化剪枝。
- 使用立方计划在训练步骤中逐步将剩余比例从 1 降至目标 p_T。
- 可选地将 LoSparse 与知识蒸馏及其他压缩方法结合,以进一步提升性能。
实验结果
研究问题
- RQ1低秩与稀疏近似的组合是否能够在变换器压缩中超越纯低秩或剪枝方法?
- RQ2在 NLU(GLUE)、QA(SQuAD)和 NLG(XSum)基准上,与基线如 Movement pruning 与 ITP 相比,LoSparse 的表现如何?
- RQ3低秩与稀疏分量的分配如何影响跨任务的性能与稳定性?
- RQ4LoSparse 是否可以与蒸馏方法及其他压缩框架(如 CoFi)有效集成?
主要发现
- LoSparse 在 GLUE 任务如 MNLI 上显著优于现有剪枝方法,在某些情况下准确率提升超过 2.0%。
- 在 SQuADv1.1 上,在极端稀疏性下 LoSparse 的 F1 提升了 3.3 点,在较高剩余比时仍具竞争力。
- 在 XSum 摘要任务中,LoSparse 的 ROUGE-1 超过现有方法 2.99 点,在需要摘要性生成的更难任务上显示更大收益。
- LoSparse 通过确保每个权重矩阵在剪枝稀疏部分的同时保留低秩成分来维持训练稳定性,减少了与其他剪枝方法相关的发散性。
- 该方法与知识蒸馏是正交的,结合蒸馏或嵌入到其他压缩框架(如 CoFi)时可进一步提升性能。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。