arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2301.04761cs.CLcs.LG
收藏

NarrowBERT:加速掩码语言模型预训练与推理

NarrowBERT: Accelerating Masked Language Model Pretraining and Inference

University of Washington(华盛顿大学);Allen Institute for Artificial Intelligence(艾伦人工智能研究所)

Haoxin Li, Phillip Keung, Daniel Cheng, Jungo Kasai, Noah A. Smith

AI总结:

本文提出 NarrowBERT,通过让自注意力查询和前馈层仅处理被掩码 token 来稀疏化 transformer 编码器,从而将预训练吞吐量提升逾 2 倍、推理吞吐量最高提升 3.5 倍,并在多项 NLU/NER 任务上保持接近 BERT 的性能。

摘要:

大规模语言模型预训练是自然语言处理中一种非常成功的自监督学习形式,但随着模型和预训练语料库随时间不断变大,其执行成本也越来越高。我们提出 NarrowBERT,这是一种经过修改的 transformer 编码器,可将掩码语言模型预训练的吞吐量提高 2 倍以上。NarrowBERT 对 transformer 模型进行稀疏化,使自注意力查询和前馈层在预训练期间仅作用于每个句子的被掩码 token,而不是像通常的 transformer 编码器那样作用于所有 token。我们还表明,NarrowBERT 在推理时可将吞吐量提高多达 3.5 倍,同时在 MNLI 等句子编码任务上仅有极小(或没有)的性能下降。最后,我们检验了 NarrowBERT 在 IMDB 和 Amazon 评论分类以及 CoNLL NER 任务上的性能,并表明它也与标准 BERT 的性能相当。

英文摘要:

Large-scale language model pretraining is a very successful form of self-supervised learning in natural language processing, but it is increasingly expensive to perform as the models and pretraining corpora have become larger over time. We propose NarrowBERT, a modified transformer encoder that increases the throughput for masked language model pretraining by more than $2\times$. NarrowBERT sparsifies the transformer model such that the self-attention queries and feedforward layers only operate on the masked tokens of each sentence during pretraining, rather than all of the tokens as with the usual transformer encoder. We also show that NarrowBERT increases the throughput at inference time by as much as $3.5\times$ with minimal (or no) performance degradation on sentence encoding tasks like MNLI. Finally, we examine the performance of NarrowBERT on the IMDB and Amazon reviews classification and CoNLL NER tasks and show that it is also comparable to standard BERT performance.

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

↑