arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2010.14481cs.CLcs.LG
收藏

快速双向交织序列产生

Fast Interleaved Bidirectional Sequence Generation

School of Informatics, University of Edinburgh(爱丁堡大学信息学院);ILLC, University of Amsterdam(阿姆斯特丹大学语言、逻辑与计算研究所(ILLC));Department of Computational Linguistics, University of Zurich(苏黎世大学计算语言学系)

Biao Zhang, Ivan Titov, Rico Sennrich

摘要:

序列生成过程中的独立性假设可以加快推理速度,但高度相互依赖的令牌的并行生成是以质量为代价的。而不是假设相邻的令牌之间的独立性(半自回归解码,SA),我们从双向序列生成的灵感,并引入一个解码器,从左到右和从右到左的方向同时生成目标字。我们表明,我们可以很容易地转换成一个双向解码器的单向解码的标准架构,通过简单地交织的两个方向和适应字的位置和自我注意力的面具。我们的交织双向解码器(IBDecoder)保留了标准Transformer的模型简单性和训练效率,在五个机器翻译任务和两个文档摘要任务上,与质量相当的自回归解码相比,实现了约2倍的解码加速。值得注意的是,它优于从左到右的SA,因为IBDecoder中的独立性假设更恰当。为了实现更高的加速比,我们探索混合模型,在该模型中,我们可以同时预测每个方向的多个相邻令牌,或者通过分割目标序列来执行多方向解码。这些方法在不同的任务上实现了4 - 11倍的加速,成本<1 BLEU或<0.5 ROUGE(平均)。源代码发布于https://github.com/bzhangGo/zero。

英文摘要:

Independence assumptions during sequence generation can speed up inference, but parallel generation of highly inter-dependent tokens comes at a cost in quality. Instead of assuming independence between neighbouring tokens (semi-autoregressive decoding, SA), we take inspiration from bidirectional sequence generation and introduce a decoder that generates target words from the left-to-right and right-to-left directions simultaneously. We show that we can easily convert a standard architecture for unidirectional decoding into a bidirectional decoder by simply interleaving the two directions and adapting the word positions and self-attention masks. Our interleaved bidirectional decoder (IBDecoder) retains the model simplicity and training efficiency of the standard Transformer, and on five machine translation tasks and two document summarization tasks, achieves a decoding speedup of ~2X compared to autoregressive decoding with comparable quality. Notably, it outperforms left-to-right SA because the independence assumptions in IBDecoder are more felicitous. To achieve even higher speedups, we explore hybrid models where we either simultaneously predict multiple neighbouring tokens per direction, or perform multi-directional decoding by partitioning the target sequence. These methods achieve speedups to 4X-11X across different tasks at the cost of <1 BLEU or <0.5 ROUGE (on average). Source code is released at https://github.com/bzhangGo/zero.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑