Transformer-based models are popular for natural language processing (NLP) tasks due to its powerful capacity. As the core component, self-attention module has aroused widespread interests. Attention map visualization of a pre-trained model is one direct method for understanding self-attention mechanism and some common patterns are observed in visualization. Based on these patterns, a series of efficient transformers are proposed with corresponding sparse attention masks. Besides above empirical results, universal approximability of Transformer-based models is also discovered from a theoretical perspective. However, above understanding and analysis of self-attention is based on a pre-trained model. To rethink the importance analysis in self-attention, we delve into dynamics of attention matrix importance during pre-training. One of surprising results is that the diagonal elements in the attention map are the most unimportant compared with other attention positions and we also provide a proof to show these elements can be removed without damaging the model performance. Furthermore, we propose a Differentiable Attention Mask (DAM) algorithm, which can be also applied in guidance of SparseBERT design further. The extensive experiments verify our interesting findings and illustrate the effect of our proposed algorithm.


翻译:基于变压器的模型因其强大的能力而受自然语言处理任务(NLP)的欢迎。作为核心组成部分,自我注意模块引起了广泛的兴趣。注意前训练模型的可视化是了解自我注意机制的直接方法,在视觉化中也观察到一些共同的模式。根据这些模式,提出了一系列高效变压器,并配有相应的微弱关注面罩。除了经验结果之外,还从理论角度发现了基于变压器的模型的通用近似性。但是,在理解和分析自我注意的基础上,有一个预先训练的模型。为了重新思考自我注意的重要性分析,我们在训练前将注意力矩阵的动态分解为重要。一个令人惊讶的结果是,与其它关注位置相比,注意图中的对角要素最为不重要,我们还提供证据,表明这些要素可以删除,但不会损害模型性能。此外,我们提议一种差异化的注意蒙像(DAM)算法,也可以进一步应用于对SprarkBERT设计的指导。广泛的实验证实了我们提出的算法的有趣结果和效果。

7
下载
关闭预览

相关内容

Attention机制最早是在视觉图像领域提出来的,但是真正火起来应该算是google mind团队的这篇论文《Recurrent Models of Visual Attention》[14],他们在RNN模型上使用了attention机制来进行图像分类。随后,Bahdanau等人在论文《Neural Machine Translation by Jointly Learning to Align and Translate》 [1]中,使用类似attention的机制在机器翻译任务上将翻译和对齐同时进行,他们的工作算是是第一个提出attention机制应用到NLP领域中。接着类似的基于attention机制的RNN模型扩展开始应用到各种NLP任务中。最近,如何在CNN中使用attention机制也成为了大家的研究热点。下图表示了attention研究进展的大概趋势。
专知会员服务
56+阅读 · 2021年1月26日
注意力机制综述
专知会员服务
198+阅读 · 2021年1月26日
Python分布式计算,171页pdf,Distributed Computing with Python
专知会员服务
105+阅读 · 2020年5月3日
BERT进展2019四篇必读论文
专知会员服务
65+阅读 · 2020年1月2日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
98+阅读 · 2019年10月9日
ICML2020 图神经网络的预训练
图与推荐
12+阅读 · 2020年4月4日
BERT/Transformer/迁移学习NLP资源大列表
专知
19+阅读 · 2019年6月9日
Transferring Knowledge across Learning Processes
CreateAMind
25+阅读 · 2019年5月18日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
Disentangled的假设的探讨
CreateAMind
9+阅读 · 2018年12月10日
Jointly Improving Summarization and Sentiment Classification
黑龙江大学自然语言处理实验室
3+阅读 · 2018年6月12日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
计算机视觉近一年进展综述
机器学习研究会
8+阅读 · 2017年11月25日
Arxiv
3+阅读 · 2020年9月30日
Revealing the Dark Secrets of BERT
Arxiv
4+阅读 · 2019年9月11日
Sparse Sequence-to-Sequence Models
Arxiv
5+阅读 · 2019年5月14日
Arxiv
6+阅读 · 2019年3月19日
Arxiv
8+阅读 · 2018年11月21日
Arxiv
23+阅读 · 2017年3月9日
VIP会员
相关资讯
ICML2020 图神经网络的预训练
图与推荐
12+阅读 · 2020年4月4日
BERT/Transformer/迁移学习NLP资源大列表
专知
19+阅读 · 2019年6月9日
Transferring Knowledge across Learning Processes
CreateAMind
25+阅读 · 2019年5月18日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
Disentangled的假设的探讨
CreateAMind
9+阅读 · 2018年12月10日
Jointly Improving Summarization and Sentiment Classification
黑龙江大学自然语言处理实验室
3+阅读 · 2018年6月12日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
计算机视觉近一年进展综述
机器学习研究会
8+阅读 · 2017年11月25日
相关论文
Arxiv
3+阅读 · 2020年9月30日
Revealing the Dark Secrets of BERT
Arxiv
4+阅读 · 2019年9月11日
Sparse Sequence-to-Sequence Models
Arxiv
5+阅读 · 2019年5月14日
Arxiv
6+阅读 · 2019年3月19日
Arxiv
8+阅读 · 2018年11月21日
Arxiv
23+阅读 · 2017年3月9日
Top
微信扫码咨询专知VIP会员