[论文解读] Repulsive Attention: Rethinking Multi-head Attention as Bayesian Inference
本文提出Repulsive Attention,一种多头注意力的贝叶斯解释方法,通过粒子优化采样技术在注意力头之间强制实现多样性,防止注意力坍塌。通过将注意力头建模为近似后验分布的粒子,该方法在不增加额外参数的情况下提升了特征多样性与模型表达能力,且在各类NLP任务中均实现了稳定的性能提升。
The neural attention mechanism plays an important role in many natural language processing applications. In particular, the use of multi-head attention extends single-head attention by allowing a model to jointly attend information from different perspectives. Without explicit constraining, however, multi-head attention may suffer from attention collapse, an issue that makes different heads extract similar attentive features, thus limiting the model's representation power. In this paper, for the first time, we provide a novel understanding of multi-head attention from a Bayesian perspective. Based on the recently developed particle-optimization sampling techniques, we propose a non-parametric approach that explicitly improves the repulsiveness in multi-head attention and consequently strengthens model's expressiveness. Remarkably, our Bayesian interpretation provides theoretical inspirations on the not-well-understood questions: why and how one uses multi-head attention. Extensive experiments on various attention models and applications demonstrate that the proposed repulsive attention can improve the learned feature diversity, leading to more informative representations with consistent performance improvement on various tasks.
研究动机与目标
- 为解决多头注意力中注意力头学习冗余特征导致模型表达能力受限的注意力坍塌问题。
- 为多头注意力为何优于单头注意力提供一个系统性且理论基础坚实的解释。
- 开发一种方法,在不引入额外可训练参数或显式正则化项的前提下增强注意力头的多样性。
- 证明该贝叶斯解释在多种基于注意力的模型和NLP任务中的有效性。
提出的方法
- 本文将多头注意力建模为一个贝叶斯推断问题,将每个注意力头视为从注意力参数后验分布中采样的粒子。
- 采用粒子优化采样技术(Liu & Wang, 2016)通过最小化参数空间中头之间的接近程度,实现头之间的排斥性。
- 该方法通过优化过程中粒子的固有差异性避免显式正则化,促进在参数空间中探索不同的模式。
- 通过端到端训练方案将粒子优化集成到标准注意力模块中实现该框架。
- 该方法可推广至多种注意力模型,包括Transformer、BERT以及序列到序列架构。
实验结果
研究问题
- RQ1为何多头注意力相比单头注意力能提升模型性能?
- RQ2如何在不引入额外可训练参数的前提下显式促进注意力头的多样性?
- RQ3多头注意力在捕捉多样化表征方面的理论基础是什么?
- RQ4在注意力头之间强制实现排斥性是否能在不同NLP任务中带来一致的性能提升?
主要发现
- Repulsive Attention显著提升了多头注意力中的特征多样性,减少了头之间的冗余。
- 该方法在多个NLP任务中均实现了稳定的性能提升,包括文本分类、机器翻译和抽象文本摘要。
- 在IWSLT14 De-En翻译任务中,采用Repulsive Attention的Transformer-small模型相比标准多头注意力取得了更低的负对数似然损失。
- 在抽象文本摘要任务中,采用Repulsive Attention的GraphWriter模型在知识图谱覆盖率上提升了10%,且重复句式减少。
- 人工评估确认,使用Repulsive Attention生成的文本在结构连贯性和信息量方面优于基线模型。
- 实验揭示了注意力头的最优数量(Yelp情感分类任务中约为20个,Transformer-small模型中为4个),支持了关于多样性与过拟合之间权衡的理论分析。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。