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.
翻译:Transformer模型在各种自然语言处理任务中取得了显著成果,但其规模往往过于庞大,需要大量内存和计算资源。为缩减这些模型的规模与复杂度,我们提出LoSparse(低秩与稀疏近似)这一新型模型压缩技术,通过将权重矩阵近似为低秩矩阵与稀疏矩阵之和来实现。该方法融合了低秩近似与剪枝的优势,同时避免了各自的局限性:低秩近似压缩神经元中连贯且具有表达能力的部分,而剪枝则移除神经元中不连贯且缺乏表达能力的部分。剪枝增强了低秩近似的多样性,低秩近似则防止剪枝损失过多表达性强的神经元。我们在自然语言理解、问答及自然语言生成任务上评估了该方法,结果表明其显著优于现有压缩方法。