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

大规模语言模型在手机上的实时的执行

Real-Time Execution of Large-scale Language Models on Mobile

College of William and Mary(威廉玛丽学院);Northeastern University(东北大学);MIT-IBM Watson AI Lab, IBM Research(麻省理工学院-IBM沃森人工智能实验室,IBM研究院);University of Notre Dame(圣母大学);University of Connecticut(康涅狄格大学)

Wei Niu, Zhenglun Kong, Geng Yuan, Weiwen Jiang, Jiexiong Guan, Caiwen Ding, Pu Zhao, Sijia Liu, Bin Ren, Yanzhi Wang

摘要:

预训练的大规模语言模型在许多自然语言处理(NLP)任务中越来越多地表现出高准确性。然而,硬件平台上有限的权重存储和计算速度阻碍了预训练模型的普及,特别是在边缘计算时代。在本文中,我们试图找到最好的模型结构的BERT为一个给定的计算规模,以匹配特定的设备。我们提出了第一个编译器感知的神经架构优化框架。我们的框架可以保证识别的模型,以满足移动设备的资源和实时的【形】规范,从而实现实时的【形】执行大型transformer为基础的模型,如BERT的变种。我们在几个NLP任务上评估了我们的模型,在移动设备上具有较低延迟的知名基准测试中取得了有竞争力的结果。具体来说,我们的模型在CPU上快5.2倍,在GPU上快4.1倍,与BERT-base相比,精度损失0.5-2%。与TensorFlow-Lite相比,我们的整体框架实现了高达7.8倍的加速,只有轻微的准确性损失。

英文摘要:

Pre-trained large-scale language models have increasingly demonstrated high accuracy on many natural language processing (NLP) tasks. However, the limited weight storage and computational speed on hardware platforms have impeded the popularity of pre-trained models, especially in the era of edge computing. In this paper, we seek to find the best model structure of BERT for a given computation size to match specific devices. We propose the first compiler-aware neural architecture optimization framework. Our framework can guarantee the identified model to meet both resource and real-time specifications of mobile devices, thus achieving real-time execution of large transformer-based models like BERT variants. We evaluate our model on several NLP tasks, achieving competitive results on well-known benchmarks with lower latency on mobile devices. Specifically, our model is 5.2x faster on CPU and 4.1x faster on GPU with 0.5-2% accuracy loss compared with BERT-base. Our overall framework achieves up to 7.8x speedup compared with TensorFlow-Lite with only minor accuracy loss.

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

↑