arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2206.10461cs.CLcs.AI
收藏

边缘AI系统的自动高效BERT剪枝

An Automatic and Efficient BERT Pruning for Edge AI Systems

University of Connecticut(康涅狄格大学);Northeastern University(东北大学);The Pennsylvania State University(宾夕法尼亚州立大学);University of Texas at San Antonio(德克萨斯大学圣安东尼奥分校)

Shaoyi Huang, Ning Liu, Yueying Liang, Hongwu Peng, Hongjia Li, Dongkuan Xu, Mimi Xie, Caiwen Ding

摘要:

随着人们对深度学习民主化的渴望,越来越多的人要求在资源受限的设备上实现基于transformer的自然语言处理(NLP)模型,以实现低延迟和高准确性。现有的BERT剪枝方法需要领域专家手工创建超参数,以在模型大小、延迟和准确性之间取得平衡。在这项工作中,我们提出了AE-BERT,一个自动和高效的BERT修剪框架,有效的评估,以选择一个“好”的子网络候选人(具有高精度)给定的整体修剪比约束。我们提出的方法不需要人类专家的经验,并在许多NLP任务上实现了更好的准确性。我们在通用语言理解评估(GLUE)基准测试上的实验结果表明,AE-BERT在BERT $_{\mathrm{BASE}}$上的性能优于SOTA手工剪枝方法.在QNLI和RTE上,我们分别获得了75%和42.8%的总体剪枝率,同时获得了更高的准确率。在MRPC上,我们在相同的总体修剪率为0.5的情况下获得了比SOTA高4.6的分数。在STS-B上,与SOTA手工剪枝方法相比,在Spearman相关性损失很小的情况下,剪枝率提高了40%.实验结果还表明,在模型压缩后,Xilinx Alveo U200 FPGA板上单个BERT $_{\mathrm{BASE}}$编码器的推理时间比Intel(R)Xeon(R)Gold 5218(2.30 GHz)CPU有1.83 $\times$加速,这表明了在计算受限设备上部署所提出的方法生成的BERT $_{\mathrm{BASE}}$模型的合理性。

英文摘要:

With the yearning for deep learning democratization, there are increasing demands to implement Transformer-based natural language processing (NLP) models on resource-constrained devices for low-latency and high accuracy. Existing BERT pruning methods require domain experts to heuristically handcraft hyperparameters to strike a balance among model size, latency, and accuracy. In this work, we propose AE-BERT, an automatic and efficient BERT pruning framework with efficient evaluation to select a "good" sub-network candidate (with high accuracy) given the overall pruning ratio constraints. Our proposed method requires no human experts experience and achieves a better accuracy performance on many NLP tasks. Our experimental results on General Language Understanding Evaluation (GLUE) benchmark show that AE-BERT outperforms the state-of-the-art (SOTA) hand-crafted pruning methods on BERT$_{\mathrm{BASE}}$. On QNLI and RTE, we obtain 75\% and 42.8\% more overall pruning ratio while achieving higher accuracy. On MRPC, we obtain a 4.6 higher score than the SOTA at the same overall pruning ratio of 0.5. On STS-B, we can achieve a 40\% higher pruning ratio with a very small loss in Spearman correlation compared to SOTA hand-crafted pruning methods. Experimental results also show that after model compression, the inference time of a single BERT$_{\mathrm{BASE}}$ encoder on Xilinx Alveo U200 FPGA board has a 1.83$\times$ speedup compared to Intel(R) Xeon(R) Gold 5218 (2.30GHz) CPU, which shows the reasonableness of deploying the proposed method generated subnets of BERT$_{\mathrm{BASE}}$ model on computation restricted devices.

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

↑