Skip to main content
QUICK REVIEW

[论文解读] Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depth

Yihe Dong, Jean-Baptiste Cordonnier|arXiv (Cornell University)|Mar 4, 2021
Neural Networks and Applications被引用 90
一句话总结

本文表明纯自注意力网络(不使用跳跃连接或 MLPs)会使输出收敛到一个秩-1矩阵,随着深度呈双指数级增加;跳跃连接和 MLPs 可以抵消这一塌缩,且通过路径分解进行分析。

ABSTRACT

Attention-based architectures have become ubiquitous in machine learning, yet our understanding of the reasons for their effectiveness remains limited. This work proposes a new way to understand self-attention networks: we show that their output can be decomposed into a sum of smaller terms, each involving the operation of a sequence of attention heads across layers. Using this decomposition, we prove that self-attention possesses a strong inductive bias towards "token uniformity". Specifically, without skip connections or multi-layer perceptrons (MLPs), the output converges doubly exponentially to a rank-1 matrix. On the other hand, skip connections and MLPs stop the output from degeneration. Our experiments verify the identified convergence phenomena on different variants of standard transformer architectures.

研究动机与目标

  • 激发对像 Transformer 这类架构为何在经验成功之外仍然有效的更深层理解。
  • 证明自注意力网络随着深度增加出现秩-坍缩的行为。
  • 引入路径分解,将 SANs 分析为浅层网络的集合。
  • 描述跳跃连接和 MLPs 如何抵消秩坍缩。
  • 通过在常见的 Transformer 变体上进行实验来验证理论结果。

提出的方法

  • 将 SAN 输出分解为跨层在注意力头之间的路径之和。
  • 证明每条路径收敛到一个秩-1 矩阵且行相同,从而导致整体秩坍缩。
  • 推导单头和多头 SAN 的收敛界限(如定理 2.2 和定理 2.3)。
  • 分析架构组件(跳跃连接、MLP、层归一化)在缓解秩坍缩中的作用。
  • 开发一个基于路径的框架,将 SANs 解释为浅层网络的集合。
  • 通过在如 BERT、ALBERT 和 XLNet 等架构上的实验来验证理论。

实验结果

研究问题

  • RQ1纯自注意力是否会随着深度增加而导致秩坍缩?
  • RQ2跳跃连接、MLP 和层归一化等架构要素如何影响秩坍缩?
  • RQ3路径分解框架是否能揭示 SAN 的内部机制及其归纳偏置?
  • RQ4关于标准 Transformer 的经验结果是否支持关于秩收敛的理论预测?
  • RQ5在 Transformer 中,宽度-深度权衡和长路径利用的实际含义是什么?

主要发现

  • 没有跳跃连接的自注意力网络在深度的双指数级速率下收敛到秩-1 的输出,且各行完全相同。
  • 跳跃连接在实践中显著增加路径多样性,防止秩坍缩。
  • MLPs 通过增大 Lipschitz 常数来减慢收敛到秩-1 的速度,与自注意力形成拉锯。
  • 在本分析中,层归一化并不能缓解秩坍缩。
  • 路径分解表明 SANs 的行为像浅层网络的集合,短路径承载大部分表达能力。
  • 在 BERT、ALBERT 和 XLNet 上的实验确认去掉跳跃连接时会迅速出现秩坍缩。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。