提出新型注意力机制,同时解决模型训练中的两个核心难题。
Generalized Probabilistic Attention Mechanism in Transformers
- 引入可出现负分的广义概率注意力,保持总和固定
- 理论与实验证明能同时缓解秩坍缩与梯度消失问题
- 在文本生成任务中表现更优,适合追求稳定训练的研究者
Transformer架构因核心的注意力机制而广泛应用,但该机制存在秩坍缩和梯度消失两大问题。本文理论分析表明,传统注意力机制难以同时解决这两类问题。为此,提出一类新型注意力机制——广义概率注意力机制(GPAM),并在Transformer中实现其双注意力形式(daGPAM)。与传统机制不同,GPAM允许负注意力得分,同时保持总和恒定。理论证明,daGPAM能有效缓解秩坍缩与梯度消失问题。实验验证了该机制在语言建模与神经机器翻译任务中的优势,显著优于其他为解决相同问题提出的替代方案。
原文摘要 · Abstract (English)
The Transformer architecture has become widely adopted due to its demonstrated success, attributed to the attention mechanism at its core. Despite these successes, the attention mechanism of Transformers is associated with two well-known issues: rank-collapse and gradient vanishing. In this paper, we present a theoretical analysis that it is inherently difficult to address both issues simultaneously in the conventional attention mechanism. To handle these issues, we introduce a novel class of attention mechanism, referred to as generalized probabilistic attention mechanism (GPAM), and its dual-attention implementation within the Transformer architecture. Unlike conventional attention mechanisms, GPAM allows for negative attention scores while preserving a fixed total sum. We provide theoretical evidence that the proposed dual-attention GPAM (daGPAM) effectively mitigates both the rank-collapse and gradient vanishing issues which are difficult to resolve simultaneously with the conventional attention mechanisms. Furthermore, we empirically validate this theoretical evidence, demonstrating the superiority of daGPAM compared to other alternative attention mechanisms that were proposed to address the same issues. Additionally, we demonstrate the practical benefits of GPAM in natural language processing tasks, such as language modeling and neural machine translation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。