[论文解读] Evolving Attention with Residual Convolutions
本文提出了一种新型机制——演化注意力(EA-Transformer),通过在各层之间利用残差连接和二维卷积模块对注意力图进行演化,从而提升Transformer模型的性能。将注意力图视为多通道特征图并利用卷积网络进行精炼,该方法在视觉和自然语言处理任务中均实现了稳定的准确率提升,在ImageNet、GLUE和IWSLT基准测试中达到最先进性能。
Transformer is a ubiquitous model for natural language processing and has attracted wide attentions in computer vision. The attention maps are indispensable for a transformer model to encode the dependencies among input tokens. However, they are learned independently in each layer and sometimes fail to capture precise patterns. In this paper, we propose a novel and generic mechanism based on evolving attention to improve the performance of transformers. On one hand, the attention maps in different layers share common knowledge, thus the ones in preceding layers can instruct the attention in succeeding layers through residual connections. On the other hand, low-level and high-level attentions vary in the level of abstraction, so we adopt convolutional layers to model the evolutionary process of attention maps. The proposed evolving attention mechanism achieves significant performance improvement over various state-of-the-art models for multiple tasks, including image classification, natural language understanding and machine translation.
研究动机与目标
- 解决原始Transformer的局限性,即各层独立学习注意力图,往往难以捕捉精确且动态演化的依赖关系。
- 通过引入建模注意力模式在各层间演化的归纳偏置,提升注意力图的质量。
- 通过残差连接与卷积特征演化,实现层间知识共享,提升模型可解释性与性能。
- 开发一种通用、可插拔的机制,适用于多种基于注意力的架构,包括视觉Transformer、BERT以及带注意力的ResNets。
- 证明注意力图的演化可生成更清晰、更忠实的注意力模式,更好地反映输入数据中的结构与语义依赖关系。
提出的方法
- 将每个Transformer模块的多头注意力图视为多通道特征图(H × W × C),其中C为注意力头的数量。
- 将这些注意力图输入二维卷积模块,学习将其演化为下一层所需的优化后注意力图。
- 在原始注意力图与演化后的注意力图之间使用残差连接,以保留并传播跨标记的依赖知识。
- 通过在各模块间串联多个卷积模块,形成渐进式的演化过程,模仿深层网络中的层次抽象机制。
- 将演化注意力模块作为可插拔组件集成到现有Transformer与自注意力架构中,如BERT、视觉Transformer和AA-ResNet。
- 端到端训练整个模型,使卷积头能够基于局部上下文与全局结构先验,学习优化注意力模式。
实验结果
研究问题
- RQ1通过建模注意力图的演化过程而非孤立学习,能否系统性地提升Transformer各层中的注意力图质量?
- RQ2在注意力图中引入卷积归纳偏置,是否能提升其精确度与结构保真度?
- RQ3注意力图之间的残差连接在多大程度上提升了层间知识迁移与模型性能?
- RQ4演化注意力机制是否能在计算机视觉与自然语言处理的不同架构与任务中实现泛化?
- RQ5提升后的注意力质量是否能带来更好的模型可解释性与预测理由的忠实度?
主要发现
- 在ImageNet图像分类任务中,演化注意力持续提升top-1准确率,EA-AA-ResNet-34达到31.93%的准确率,较AA-ResNet-34提升0.5%。
- 在GLUE基准测试中,EA-BERT使BERT-Base性能提升2.4分,RoBERTa-Large提升0.8分,T5-Base提升1.1分。
- 在ERASER可解释性基准测试中,EA-BERT生成的推理过程比原始BERT更全面(↑0.013),且更不冗余(↓0.01),表明其忠实度更高。
- ImageNet上注意力图分类准确率显著提升,EA-AA-ResNet-34在第16、17、18层的注意力图准确率均超过AA-ResNet-34,表明其结构保真度更高。
- 在IWSLT’14 De-En数据集上,EA-Transformer-Lite的学习曲线显示其收敛更快,训练损失更低,BLEU分数更高,尽管每轮计算量高出3%。
- 可视化结果证实存在清晰的演化趋势:EA-Transformer中注意力图随网络深度增加而变得更清晰、更具对象特异性,而原始Transformer则产生模糊、宽泛的注意力模式。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。