The large attention-based encoder-decoder network (Transformer) has become prevailing recently due to its effectiveness. But the high computation complexity of its decoder raises the inefficiency issue. By examining the mathematic formulation of the decoder, we show that under some mild conditions, the architecture could be simplified by compressing its sub-layers, the basic building block of Transformer, and achieves a higher parallelism. We thereby propose Compressed Attention Network, whose decoder layer consists of only one sub-layer instead of three. Extensive experiments on 14 WMT machine translation tasks show that our model is 1.42x faster with performance on par with a strong baseline. This strong baseline is already 2x faster than the widely used standard baseline without loss in performance.
翻译:基于注意力机制的大型编码器-解码器网络(Transformer)凭借其有效性,近年来日益成为主流。然而,其解码器的高计算复杂度导致了效率低下的问题。通过审视解码器的数学公式,我们证明在温和条件下,该架构可通过压缩其基本构建模块——子层来简化,从而实现更高的并行性。据此,我们提出压缩注意力网络,其解码器层仅包含一个子层而非三个子层。在14项WMT机器翻译任务上的大量实验表明,我们的模型速度提升1.42倍,且性能与强基线相当。该强基线本身已比广泛使用的标准基线(性能无损)快2倍。