arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2112.08560cs.CL
收藏

Block-Skim:高效的Transformer问答系统

Block-Skim: Efficient Question Answering for Transformer

Shanghai Jiao Tong University(上海交通大学);Shanghai Qi Zhi Institute(上海期智研究院);University of Rochester(罗切斯特大学)

Yue Guan, Zhengyi Li, Jingwen Leng, Zhouhan Lin, Minyi Guo, Yuhao Zhu

摘要:

Transformer模型在自然语言处理(NLP)任务(包括抽取式问答(QA))上取得了令人满意的结果。NLP任务中使用的常见Transformer编码器处理所有层中上下文段落中所有输入标记的隐藏状态。然而,与序列分类等其他任务不同,回答提出的问题并不一定需要上下文段落中的所有标记。基于这个动机,我们提出了Block-skim,它学习在更高的隐藏层中跳过不必要的上下文,以提高和加速Transformer的性能。Block-Skim的关键思想是识别必须进一步处理的上下文和那些可以在推理过程中早期安全丢弃的上下文。重要的是,我们发现,这样的信息可以充分地从Transformer模型内部的自我注意力权重。我们进一步修剪隐藏状态对应的不必要的位置早在较低的层,实现显着的推理时间加速。令我们惊讶的是,我们观察到,以这种方式修剪的模型优于其全尺寸的同行。Block-Skim提高了QA模型在不同数据集上的准确性,并实现了基于BERT模型的3倍加速。

英文摘要:

Transformer models have achieved promising results on natural language processing (NLP) tasks including extractive question answering (QA). Common Transformer encoders used in NLP tasks process the hidden states of all input tokens in the context paragraph throughout all layers. However, different from other tasks such as sequence classification, answering the raised question does not necessarily need all the tokens in the context paragraph. Following this motivation, we propose Block-skim, which learns to skim unnecessary context in higher hidden layers to improve and accelerate the Transformer performance. The key idea of Block-Skim is to identify the context that must be further processed and those that could be safely discarded early on during inference. Critically, we find that such information could be sufficiently derived from the self-attention weights inside the Transformer model. We further prune the hidden states corresponding to the unnecessary positions early in lower layers, achieving significant inference-time speedup. To our surprise, we observe that models pruned in this way outperform their full-size counterparts. Block-Skim improves QA models' accuracy on different datasets and achieves 3 times speedup on BERT-base model.

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

↑