[论文解读] Compressed Deep Networks: Goodbye SVD, Hello Robust Low-Rank Approximation
该论文提出用基于鲁棒 $\varepsilon$-近似 $\mu$-范数的低秩近似替代传统的基于 SVD 的低秩近似,以压缩深度神经网络,特别是嵌入层。通过使用 $p \in [1,2]$ 的 $\ell_p$-范数,该方法在压缩过程中显著提升了准确率保留效果——例如,对 RoBERTa 的嵌入层实现 28% 的压缩率时,准确率仅下降 0.63%,而 SVD 方法则下降 11%,这主要得益于对异常值更强的鲁棒性。
A common technique for compressing a neural network is to compute the $k$-rank $\ell_2$ approximation $A_{k,2}$ of the matrix $A\in\mathbb{R}^{n imes d}$ that corresponds to a fully connected layer (or embedding layer). Here, $d$ is the number of the neurons in the layer, $n$ is the number in the next one, and $A_{k,2}$ can be stored in $O((n+d)k)$ memory instead of $O(nd)$. This $\ell_2$-approximation minimizes the sum over every entry to the power of $p=2$ in the matrix $A - A_{k,2}$, among every matrix $A_{k,2}\in\mathbb{R}^{n imes d}$ whose rank is $k$. While it can be computed efficiently via SVD, the $\ell_2$-approximation is known to be very sensitive to outliers ("far-away" rows). Hence, machine learning uses e.g. Lasso Regression, $\ell_1$-regularization, and $\ell_1$-SVM that use the $\ell_1$-norm. This paper suggests to replace the $k$-rank $\ell_2$ approximation by $\ell_p$, for $p\in [1,2]$. We then provide practical and provable approximation algorithms to compute it for any $p\geq1$, based on modern techniques in computational geometry. Extensive experimental results on the GLUE benchmark for compressing BERT, DistilBERT, XLNet, and RoBERTa confirm this theoretical advantage. For example, our approach achieves $28\%$ compression of RoBERTa's embedding layer with only $0.63\%$ additive drop in the accuracy (without fine-tuning) in average over all tasks in GLUE, compared to $11\%$ drop using the existing $\ell_2$-approximation. Open code is provided for reproducing and extending our results.
研究动机与目标
- 解决基于 SVD 的低秩近似在 NLP 模型嵌入矩阵中对异常值敏感的问题。
- 通过将 $\ell_2$-范数近似替换为 $p \in [1,2]$ 的更鲁棒 $\ell_p$-范数近似,提升模型压缩效率。
- 设计适用于深度网络压缩的实用且可证明准确的 $\ell_p$-基低秩近似算法。
- 证明鲁棒低秩近似在无需微调的情况下,于多个 NLP 基准测试中优于 SVD 的准确率保留能力。
- 提供开源代码以支持所提压缩框架的可复现性与进一步扩展。
提出的方法
- 用 $p \in [1,2]$ 的 $\ell_p$-范数近似替代标准的 $\ell_2$-范数低秩近似(通过 SVD 实现),以增强对异常值的鲁棒性。
- 采用现代计算几何技术,设计适用于 $\ell_p$-基 $k$-秩矩阵近似的实用且可证明的近似算法。
- 通过将权重矩阵 $A \in \mathbb{R}^{n \times d}$ 分解为两个更小的矩阵 $U \in \mathbb{R}^{n \times k}$ 和 $W \in \mathbb{R}^{k \times d}$,应用于嵌入层压缩,将内存占用从 $O(nd)$ 降低至 $O(k(n+d))$。
- 使用 $\ell_p$-范数目标 $\|A - A_k\|_p^p = \sum_{i=1}^n \|A^{(i)} - A_k^{(i)}\|_p^p$ 最小化误差,且对极端值的敏感度低于 $\ell_2$-范数。
- 采用两阶段方法:首先,使用 $\ell_p$-范数计算鲁棒的低秩近似;其次,将该近似直接应用于嵌入层压缩,无需微调。
- 在 GLUE 基准上对 BERT、RoBERTa、XLNet 和 DistilBERT 进行验证,对比 SVD 方法在准确率与压缩率方面的表现。
实验结果
研究问题
- RQ1在深度神经网络中,$p \in [1,2]$ 的 $\ell_p$-范数低秩近似是否能提供优于基于 $\ell_2$-范数的 SVD 的压缩准确率?
- RQ2$\ell_p$-范数近似对异常值的鲁棒性如何影响压缩过程中的模型性能,特别是在大词汇量或小模型中?
- RQ3在不进行微调的情况下,$\ell_p$-基压缩在多大程度上能保持甚至提升模型准确率?
- RQ4计算 $\ell_p$-基 $k$-秩近似的实际与理论效率如何,适用于真实世界中的 NLP 模型?
- RQ5所提方法能否在不同架构(如 RoBERTa、XLNet 和 DistilBERT)上泛化,特别是在嵌入层成为准确率瓶颈时?
主要发现
- 所提出的 $\ell_p$-基压缩方法在 RoBERTa 的嵌入层上实现了 28% 的压缩率,且在 GLUE 任务上的平均准确率仅下降 0.63%,而 SVD 方法则下降 11%。
- 对于 DistilBERT,由于其对小误差敏感且对异常值鲁棒性更强,该方法优于 SVD。
- 在 RoBERTa 中,其庞大的词汇量(50,265 个子词单元)增加了异常值出现的可能性,使得 $\ell_p$-基方法尤为有效。
- 在 XLNet 中,由于异常值对相对位置嵌入的影响较大,而后者对性能至关重要,因此该方法优于 SVD。
- 在某些任务(如 SST-2)中,低压缩率下准确率略有提升,可能归因于冗余维度的去除。
- 该方法在大多数 GLUE 任务和压缩率下均持续优于 SVD,展现出更强的鲁棒性与更高的准确率保留能力。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。