加载中...
Attention Is All You Need
主流序列转换模型基于包含编码器和解码器的复杂循环或卷积神经网络。性能最佳的模型还通过注意力机制连接编码器和解码器。我们提出了一种新的简单网络架构——Transformer,它仅基于注意力机制,完全摒弃了循环和卷积。在两个机器翻译任务上的实验表明,这些模型在质量上更优,同时更具并行性,且训练时间显著减少。我们的模型在WMT 2014英德翻译任务上取得了28.4的BLEU分数,比现有最佳结果(包括集成模型)提高了超过2个BLEU。在WMT 2014英法翻译任务上,我们的模型在8块GPU上训练3.5天后,取得了41.8的新单模型最先进BLEU分数,仅为文献中最佳模型训练成本的一小部分。我们通过将Transformer成功应用于英语成分句法分析(包括大规模和有限训练数据)表明其能很好地泛化到其他任务。
Abstract
The dominant sequence transduction models are based on complex recurrent or convolutional neural networks that include an encoder and a decoder. The best performing models also connect the encoder and decoder through an attention mechanism. We propose a new simple network architecture, the Transformer, based solely on attention mechanisms, dispensing with recurrence and convolutions entirely. Experiments on two machine translation tasks show these models to be superior in quality while being more parallelizable and requiring significantly less time to train. Our model achieves 28.4 BLEU on the WMT 2014 English-to-German translation task, improving over the existing best results, including ensembles, by over 2 BLEU. On the WMT 2014 English-to-French translation task, our model establishes a new single-model state-of-the-art BLEU score of 41.8 after training for 3.5 days on eight GPUs, a small fraction of the training costs of the best models from the literature. We show that the Transformer generalizes well to other tasks by applying it successfully to English constituency parsing both with large and limited training data.
Transformer在WMT 2014英德翻译任务上达到28.4 BLEU,超越所有先前模型
在WMT 2014英德翻译任务上,大Transformer模型(如表2中Transformer (big))比先前最佳模型(包括集成模型)高出2.0 BLEU以上,确立了新的最先进BLEU分数28.4。该模型在8块P100 GPU上训练了3.5天,训练成本远低于竞争模型。
Transformer在WMT 2014英法翻译任务上达到41.8 BLEU的新单模型最先进分数
在WMT 2014英法翻译任务上,大模型取得了41.8的BLEU分数,超越了所有先前发表的单模型,训练成本不到先前最先进模型的1/4。英法模型使用了dropout率Pdrop=0.1。
Transformer在英语成分句法分析(WSJ 23)上取得92.7的F1分数,在无任务特定调参下表现优异
在WSJ部分训练的半监督设置下,Transformer(4层)在英语成分句法分析上取得了92.7的F1分数,优于所有先前模型,除了循环神经网络语法(RNNG)。仅在WSJ训练集(40K句子)上训练的Transformer也优于BerkeleyParser。
多头注意力通过允许模型联合关注不同表示子空间的信息来提升性能
在模型变体实验中,与单头注意力相比,多头注意力(h=8)的模型在英德翻译开发集上BLEU更高。单头注意力比最佳设置差0.9 BLEU,而头数过多(如32头)质量也会下降。多头注意力允许模型在不同位置共同关注来自不同表示子空间的信息。