Skip to main content
QUICK REVIEW

[论文解读] Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View

Yiping Lu, Zhuohan Li|arXiv (Cornell University)|Jun 6, 2019
Topic Modeling参考文献 46被引用 116
一句话总结

本文将 Transformer 重新解释为多粒子扩散对流系统的数值 ODE 求解器,然后提出 Macaron Net,利用 Strang-Marchuk 分裂在性能上优于标准 Transformer。

ABSTRACT

The Transformer architecture is widely used in natural language processing. Despite its success, the design principle of the Transformer remains elusive. In this paper, we provide a novel perspective towards understanding the architecture: we show that the Transformer can be mathematically interpreted as a numerical Ordinary Differential Equation (ODE) solver for a convection-diffusion equation in a multi-particle dynamic system. In particular, how words in a sentence are abstracted into contexts by passing through the layers of the Transformer can be interpreted as approximating multiple particles' movement in the space using the Lie-Trotter splitting scheme and the Euler's method. Given this ODE's perspective, the rich literature of numerical analysis can be brought to guide us in designing effective structures beyond the Transformer. As an example, we propose to replace the Lie-Trotter splitting scheme by the Strang-Marchuk splitting scheme, a scheme that is more commonly used and with much lower local truncation errors. The Strang-Marchuk splitting scheme suggests that the self-attention and position-wise feed-forward network (FFN) sub-layers should not be treated equally. Instead, in each layer, two position-wise FFN sub-layers should be used, and the self-attention sub-layer is placed in between. This leads to a brand new architecture. Such an FFN-attention-FFN layer is "Macaron-like", and thus we call the network with this new architecture the Macaron Net. Through extensive experiments, we show that the Macaron Net is superior to the Transformer on both supervised and unsupervised learning tasks. The reproducible codes and pretrained models can be found at https://github.com/zhuohan123/macaron-net

研究动机与目标

  • 通过多粒子动态系统(MPDS)与 ODE 理论提供对 Transformer 的新解释。
  • 利用数值分析(Lie-Trotter 与 Strang-Marchuk 分裂)设计更精准的神经网络架构。
  • 证明 Macaron Net 在有监督与无监督 NLP 任务中优于标准 Transformer。

提出的方法

  • 将 Transformer 层建模为一个包含对流(FFN)和扩散(自注意力)的 MPDS 的 ODE 求解器。
  • 使用 Lie-Trotter 分裂将层叠映射到时间中的欧拉步长。
  • 用 Strang-Marchuk 分裂替换 Lie-Trotter,创建三子层的 Macaron+ 架构(FFN-半、注意力、FFN-半)。
  • 将 Macaron 层定义为 FFN-Attention-FFN,分别带半步残差和全步残差。
  • 通过堆叠 Macaron 层来构造 Macaron Net,使参数数量等同于 Transformer 基线。
  • 在机器翻译(IWSLT14 De-En, WMT14 En-De)和 GLUE 风格的无监督预训练(BERT 类)上进行实证评估。

实验结果

研究问题

  • RQ1 Transformer 是否可以被理解为一个对流扩散 MPDS 的数值 ODE 求解器?
  • RQ2在神经网络架构中采用 Strang-Marchuk 分裂是否相比 Lie-Trotter 提高准确性和性能?
  • RQ3在相同参数预算下,Macaron 层(FFN-Attention-FFN)是否能带来更好的 NLP 性能?
  • RQ4与 Transformer 相比,Macaron Net 在有监督翻译和无监督预训练任务上的表现如何?
  • RQ5将 ODE 基础设计原则更深地融入到基于注意力的 NLP 模型时,会带来哪些经验性增益?

主要发现

  • Macaron Net 在 IWSLT14 De-En 小模型上 BLEU 为 35.4,Transformer 小模型为 34.4;在 WMT14 En-De 基线为 28.9,Big 为 30.2。
  • 按 Table 1,Macaron Net Big 在 WMT14 En-De 上比 Transformer Big 提升了 1.8 BLEU。
  • 在 GLUE 上,Macaron Net Base 超过 BERT Base 及所有基线,获得更高的通用 GLUE 得分。
  • 在有监督的机器翻译中,Macaron Small 在 IWSLT14 De-En 上超越 Transformer Small 1.0 BLEU;在 WMT14 En-De 上,Macaron Base 超越 Transformer Base 1.6 BLEU 点。
  • 无监督预训练中,Macaron Net 能带来下游任务表现相较基线 BERT/Transformer 配置的提升。
  • 理论分析预测 Strang-Marchuk 分裂将局部截断误差从 O(γ^2) 降至 O(γ^3),这为 Macaron 层设计提供了动机。

更好的研究,从现在开始

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

无需绑定信用卡

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