[论文解读] Synthesizer: Rethinking Self-Attention in Transformer Models
Synthesizer 用合成注意力替代点积自注意力,以在不依赖标记之间交互的情况下学习对齐。随机/密集变体在各任务中具有竞争力,甚至能超越部分基线;同时,将合成注意力与点积注意力结合可带来进一步提升。
The dot product self-attention is known to be central and indispensable to state-of-the-art Transformer models. But is it really required? This paper investigates the true importance and contribution of the dot product-based self-attention mechanism on the performance of Transformer models. Via extensive experiments, we find that (1) random alignment matrices surprisingly perform quite competitively and (2) learning attention weights from token-token (query-key) interactions is useful but not that important after all. To this end, we propose extsc{Synthesizer}, a model that learns synthetic attention weights without token-token interactions. In our experiments, we first show that simple Synthesizers achieve highly competitive performance when compared against vanilla Transformer models across a range of tasks, including machine translation, language modeling, text generation and GLUE/SuperGLUE benchmarks. When composed with dot product attention, we find that Synthesizers consistently outperform Transformers. Moreover, we conduct additional comparisons of Synthesizers against Dynamic Convolutions, showing that simple Random Synthesizer is not only $60\%$ faster but also improves perplexity by a relative $3.5\%$. Finally, we show that simple factorized Synthesizers can outperform Linformers on encoding only tasks.
研究动机与目标
- 质疑 Transformer 中点积自注意力的必要性。
- 研究基于合成注意力(非依赖标记之间交互的注意力)在语言任务中的表现。
- 提出并评估多种 Synthesizer 变体(Dense、Random、Factorized、Mixtures)。
- 评估合成注意力与传统点积注意力以及快速 Transformer 变体的组合效果。
提出的方法
- 定义合成注意力,用一个合成函数 F 来替代 QK 权重计算,输出一个对齐矩阵。
- 实现 Dense Synthesizer,其中每个标记通过两层前馈网络投射到一个序列长度向量。
- 定义 Random Synthesizer,具有固定或可训练的随机对齐矩阵 R,并进行 softmax 归一化。
- 引入因式分解变体以减少参数数量(Dense 与 Random),以及将多个 synthesizer 组合的混合形式。
- 在机器翻译(WMT En-De/En-Fr)、语言建模(LM1B)、文本生成,以及 GLUE/SuperGLUE 基准上评价这些变体,并与 Dynamic Convolutions 和 Linformers 进行比较。
实验结果
研究问题
- RQ1点积自注意力在主流 NLP 任务中的性能是否必不可少?
- RQ2独立于标记-标记交互的合成注意力机制是否可以匹配甚至超越原生 Transformer?
- RQ3合成注意力与点积注意力的混合是否在各任务上带来稳健的提升?
- RQ4随机或因式分解的合成注意力变体与像 Linformers、Dynamic Convolutions 这样的快速 Transformer 替代方案相比如何?
主要发现
- Random Synthesizer 在 WMT 2014 英-德上取得 27.27 的 BLEU,在英-法翻译上取得 41.12 的 BLEU。
- Random Synthesizer 在 LM1B 的语言建模困惑度可在与原生 Transformer 相差 1–2 点的范围内具备竞争力。
- 简单的 Random Synthesizers 在困惑度上相对 Dynamic Convolutions 提升约 3.5%(相对)并且在 MLM 设置中大约快 60%。
- 因式分解的 Random Synthesizers 在仅编码任务上可以超越 Linformers。
- 将合成注意力与点积注意力结合的混合变体在多个任务上对 Transformers 产生一致的性能提升。
- 在对话生成任务中,点积注意力可能降低性能,而 Synthesizers (D) 和 (R) 则带来改进。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。