LEAP:基于转换器的模型的可学习剪枝
LEAP: Learnable Pruning for Transformer-based Models
摘要:
剪枝是减少与大型自然语言处理模型相关的内存占用和计算成本的有效方法。然而,当前的剪枝算法要么只关注一个剪枝类别,例如,结构化修剪和非结构化,或者需要广泛的超参数调整,以获得合理的准确性性能。为了解决这些挑战,我们提出了LEArnable修剪(LEAP),一种有效的方法来逐步修剪模型的基础上学习的阈值梯度下降。与以往的可学习剪枝方法不同,LEAP引入了一种新的正则化函数,直接与预设的目标剪枝率交互,这种方法利用$L_0$或$L_1$惩罚来间接影响最终的剪枝率。此外,为了减少超参数调整,一个新的自适应正则化系数部署自适应控制正则化惩罚。通过新的正则化项及其相关的自适应正则化系数,LEAP能够应用于不同的修剪粒度,包括非结构化修剪,结构化修剪和混合修剪,具有最小的超参数调整。我们应用LEAP的BERT模型QQP/MNLI/SQuAD不同的修剪设置。我们的结果表明,对于所有的数据集,修剪粒度和修剪率,LEAP实现了同等或更好的结果相比,以前的大量手工调整的方法。
英文摘要:
Pruning is an effective method to reduce the memory footprint and computational cost associated with large natural language processing models. However, current pruning algorithms either only focus on one pruning category, e.g., structured pruning and unstructured, or need extensive hyperparameter tuning in order to get reasonable accuracy performance. To address these challenges, we propose LEArnable Pruning (LEAP), an effective method to gradually prune the model based on thresholds learned by gradient descent. Different than previous learnable pruning methods, which utilize $L_0$ or $L_1$ penalty to indirectly affect the final pruning ratio, LEAP introduces a novel regularization function, that directly interacts with the preset target pruning ratio. Moreover, in order to reduce hyperparameter tuning, a novel adaptive regularization coefficient is deployed to control the regularization penalty adaptively. With the new regularization term and its associated adaptive regularization coefficient, LEAP is able to be applied for different pruning granularity, including unstructured pruning, structured pruning, and hybrid pruning, with minimal hyperparameter tuning. We apply LEAP for BERT models on QQP/MNLI/SQuAD for different pruning settings. Our result shows that for all datasets, pruning granularity, and pruning ratios, LEAP achieves on-par or better results as compared to previous heavily hand-tuned methods.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。