Vision transformer (ViT) expands the success of transformer models from sequential data to images. The model decomposes an image into many smaller patches and arranges them into a sequence. Multi-head self-attentions are then applied to the sequence to learn the attention between patches. Despite many successful interpretations of transformers on sequential data, little effort has been devoted to the interpretation of ViTs, and many questions remain unanswered. For example, among the numerous attention heads, which one is more important? How strong are individual patches attending to their spatial neighbors in different heads? What attention patterns have individual heads learned? In this work, we answer these questions through a visual analytics approach. Specifically, we first identify what heads are more important in ViTs by introducing multiple pruning-based metrics. Then, we profile the spatial distribution of attention strengths between patches inside individual heads, as well as the trend of attention strengths across attention layers. Third, using an autoencoder-based learning solution, we summarize all possible attention patterns that individual heads could learn. Examining the attention strengths and patterns of the important heads, we answer why they are important. Through concrete case studies with experienced deep learning experts on multiple ViTs, we validate the effectiveness of our solution that deepens the understanding of ViTs from head importance, head attention strength, and head attention pattern.


翻译:视觉Transformer(ViT)将Transformer模型从序列数据成功扩展到图像领域。该模型将图像分解为多个较小的图像块,并将它们排列成序列。随后,多头自注意力机制被应用于该序列以学习图像块之间的注意力关系。尽管已有许多关于Transformer在序列数据上解释的成功案例,但对ViT解释的研究仍相对较少,许多问题尚待解答。例如,在众多注意力头中,哪些更为重要?在不同注意力头中,单个图像块对其空间邻域的注意力强度如何?各个注意力头学习了哪些注意力模式?本研究通过可视化分析方法回答了这些问题。具体而言,我们首先引入多种基于剪枝的度量指标,识别出ViT中更重要的注意力头;其次,刻画各注意力头内图像块之间注意力强度的空间分布及跨注意力层的强度变化趋势;第三,基于自编码器学习方法,归纳各个注意力头可能学习到的所有注意力模式。通过分析重要注意力头的注意力强度与模式,我们揭示了其重要性的原因。通过与多位资深深度学习专家在多类ViT模型上展开的具体案例研究,验证了我们方法的有效性——该方法从注意力头的重要性、注意力强度及注意力模式三个维度深化了对ViT的理解。

0
下载
关闭预览

相关内容

Transformer如何用于视频?最新「视频Transformer」2022综述
专知会员服务
76+阅读 · 2022年1月20日
【论文推荐】小样本视频合成,Few-shot Video-to-Video Synthesis
专知会员服务
24+阅读 · 2019年12月15日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
60+阅读 · 2019年10月17日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
BERT/Transformer/迁移学习NLP资源大列表
专知
19+阅读 · 2019年6月9日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
深度自进化聚类:Deep Self-Evolution Clustering
我爱读PAMI
15+阅读 · 2019年4月13日
逆强化学习-学习人先验的动机
CreateAMind
16+阅读 · 2019年1月18日
无监督元学习表示学习
CreateAMind
27+阅读 · 2019年1月4日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
跨越注意力:Cross-Attention
我爱读PAMI
172+阅读 · 2018年6月2日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Arxiv
17+阅读 · 2022年2月23日
Arxiv
58+阅读 · 2021年11月15日
Arxiv
19+阅读 · 2020年12月23日
VIP会员
最新内容
《多域战场上反制小型无人机系统》150页
专知会员服务
9+阅读 · 今天7:47
战场人工智能:增强陆地作战能力的发现与要求
专知会员服务
2+阅读 · 今天7:37
以人工智能为中心的指挥控制
专知会员服务
1+阅读 · 今天7:14
《基于深度强化学习的反无人机技术研究》178页
专知会员服务
11+阅读 · 6月10日
“史诗怒火”行动与“AI中心战”模式的浮现
专知会员服务
11+阅读 · 6月10日
【CVPR2026教程】扩散模型的解析理解
专知会员服务
5+阅读 · 6月10日
马赛克战:俄乌战场透析
专知会员服务
16+阅读 · 6月10日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员