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

边缘设备上的量化Transformer语言模型实现

Quantized Transformer Language Model Implementations on Edge Devices

University of Arizona(亚利桑那大学);University of North Dakota(北达科他大学)

Mohammad Wali Ur Rahman, Murad Mehrab Abrar, Hunter Gibbons Copening, Salim Hariri, Sicong Shao, Pratik Satam, Soheil Salehi

AI总结:

针对大规模Transformer模型难以部署在边缘设备的问题,研究将量化MobileBERT转换为FlatBuffer格式部署,在三类设备上验证其体积大幅缩小、延迟达标且精度损失小,还具备本地隐私保护优势。

摘要:

基于Transformer的大规模模型(如Bidirectional Encoder Representations from Transformers(BERT,双向编码器表征Transformer模型))被广泛应用于自然语言处理(NLP)任务中:这类模型首先用包含数百万参数的大型语料库进行预训练,随后针对下游NLP任务进行微调。这类大规模模型的主要局限之一是,由于模型体积大、推理延迟高,无法部署在资源受限的设备上。为克服这些局限,可将这类大规模模型转换为优化的FlatBuffer格式,该格式专为资源受限边缘设备的部署而定制。本文中,我们评估了经FlatBuffer转换的MobileBERT模型在三种不同边缘设备上的性能,这些模型针对RepLab 2013数据集中的英文推文声誉分析任务进行了微调。此外,本研究还对部署后的模型开展了评估,细致衡量了它们的延迟、性能与资源效率。实验结果表明,与原始BERT large模型相比,经转换和量化的MobileBERT模型体积缩小160倍,准确率仅下降4.1%,且在边缘设备上每秒至少可分析一条推文。此外,本研究还凸显了TinyML系统的隐私保护特性——所有数据都在无服务器环境中本地处理。

英文摘要:

Large-scale transformer-based models like the Bidirectional Encoder Representations from Transformers (BERT) are widely used for Natural Language Processing (NLP) applications, wherein these models are initially pre-trained with a large corpus with millions of parameters and then fine-tuned for a downstream NLP task. One of the major limitations of these large-scale models is that they cannot be deployed on resource-constrained devices due to their large model size and increased inference latency. In order to overcome these limitations, such large-scale models can be converted to an optimized FlatBuffer format, tailored for deployment on resource-constrained edge devices. Herein, we evaluate the performance of such FlatBuffer transformed MobileBERT models on three different edge devices, fine-tuned for Reputation analysis of English language tweets in the RepLab 2013 dataset. In addition, this study encompassed an evaluation of the deployed models, wherein their latency, performance, and resource efficiency were meticulously assessed. Our experiment results show that, compared to the original BERT large model, the converted and quantized MobileBERT models have 160$\times$ smaller footprints for a 4.1% drop in accuracy while analyzing at least one tweet per second on edge devices. Furthermore, our study highlights the privacy-preserving aspect of TinyML systems as all data is processed locally within a serverless environment.

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

↑