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

DPBERT:基于动态规划的BERT高效推理

DPBERT: Efficient Inference for BERT based on Dynamic Planning

Sun Yat-sen University(中山大学)

Weixin Wu, Hankz Hankui Zhuo

AI总结:

针对BERT推理计算资源消耗大的问题,提出动态规划微调策略,通过规划模块选择transformer层子序列作为计算路径,在保持98%准确率下将延迟降至75%。

摘要:

BERT等大规模预训练语言模型为NLP的发展做出了巨大贡献。然而,这些模型需要大量的计算资源,难以应用于计算能力受限的移动设备。本文旨在解决现有输入自适应推理方法未能充分利用BERT结构的缺陷。我们提出了Dynamic Planning in BERT,这是一种新颖的微调策略,通过从骨干网络的transformer层列表中选择子序列作为输入样本的计算路径,来加速BERT的推理过程。为此,该方法在原始BERT模型中添加了规划模块,以决定推理时某一层是被包含还是被跳过。在GLUE基准上的实验结果表明,该方法在保持98%准确率的同时将延迟降至75%,与最先进的输入自适应方法相比,实现了更好的准确率与速度权衡。

英文摘要:

Large-scale pre-trained language models such as BERT have contributed significantly to the development of NLP. However, those models require large computational resources, making it difficult to be applied to mobile devices where computing power is limited. In this paper we aim to address the weakness of existing input-adaptive inference methods which fail to take full advantage of the structure of BERT. We propose Dynamic Planning in BERT, a novel fine-tuning strategy that can accelerate the inference process of BERT through selecting a subsequence of transformer layers list of backbone as a computational path for an input sample. To do this, our approach adds a planning module to the original BERT model to determine whether a layer is included or bypassed during inference. Experimental results on the GLUE benchmark exhibit that our method reduces latency to 75\% while maintaining 98\% accuracy, yielding a better accuracy-speed trade-off compared to state-of-the-art input-adaptive methods.

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

↑