arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.18850cs.LG

两个稀疏矩阵优于一个:用双重稀疏分解对神经网络进行稀疏化

Two Sparse Matrices are Better than One: Sparsifying Neural Networks with Double Sparse Factorization

Faculty of Mathematics, Physics and Informatics, Comenius University(数学、物理与信息学系,科门纽斯大学);Powerful Medical(强力医疗);GrizzlyTech(灰熊科技)

Vladimír Boža, Vladimír Macko

AI总结:

本文提出双重稀疏分解(DSF),将权重矩阵分解为两个稀疏矩阵,并基于ADMM交替最小化实现高效求解,在LLaMA2-13B等模型上实现50%稀疏化且性能优于稠密小模型,超越现有逐层剪枝方法。

摘要:

神经网络通常因其庞大的规模和复杂性而难以处理。为了解决这一问题,各种方法旨在通过稀疏化或分解权重矩阵来减小模型规模,例如幅度剪枝以及低秩或块对角分解。在这项工作中,我们提出了双重稀疏分解(Double Sparse Factorization,DSF),其中我们将每个权重矩阵分解为两个稀疏矩阵。尽管精确求解该问题在计算上是不可行的,但我们提出了一种基于交替方向乘子法(ADMM)交替最小化的高效启发式方法,取得了最先进的结果,实现了前所未有的神经网络稀疏化。例如,在一次性剪枝设置下,我们的方法可以将 LLaMA2-13B 模型的规模减少 50%,同时保持优于稠密 LLaMA2-7B 模型的性能。我们还与 Optimal Brain Compression(目前最先进的卷积神经网络逐层剪枝方法)相比具有优势。此外,即使经过进一步的模型微调,我们方法的精度提升仍然持续存在。代码可在 https://github.com/usamec/double_sparse 获取。

英文摘要:

Neural networks are often challenging to work with due to their large size and complexity. To address this, various methods aim to reduce model size by sparsifying or decomposing weight matrices, such as magnitude pruning and low-rank or block-diagonal factorization. In this work, we present Double Sparse Factorization (DSF), where we factorize each weight matrix into two sparse matrices. Although solving this problem exactly is computationally infeasible, we propose an efficient heuristic based on alternating minimization via ADMM that achieves state-of-the-art results, enabling unprecedented sparsification of neural networks. For instance, in a one-shot pruning setting, our method can reduce the size of the LLaMA2-13B model by 50% while maintaining better performance than the dense LLaMA2-7B model. We also compare favorably with Optimal Brain Compression, the state-of-the-art layer-wise pruning approach for convolutional neural networks. Furthermore, accuracy improvements of our method persist even after further model fine-tuning. Code available at: https://github.com/usamec/double_sparse.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑