[论文解读] Fast Interleaved Bidirectional Sequence Generation
本文提出了一种交错双向解码器(IBDecoder),通过交错重组序列并修改自注意力掩码,实现从左到右和从右到左两个方向的并行生成,从而加速神经序列生成。该方法在保持或提升翻译与摘要生成质量的同时,相较于自回归解码实现了最高11倍的速度提升,优于仅从左到右的半自回归解码方法,因其对远距离非相邻标记之间的独立性假设更为合理。
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.
研究动机与目标
- 解决神经模型中自回归序列生成的推理速度缓慢问题。
- 减少半自回归解码中因独立性假设导致的质量下降。
- 探索双向生成作为单向或半自回归方法的更优替代方案。
- 在不增加模型参数或显著训练开销的前提下,实现高效、高速解码。
- 在保持竞争力生成质量的同时,实现高于先前方法的速度提升。
提出的方法
- IBDecoder通过将从左到右和从右到左两个方向的生成结果交错重组为单一序列,重新组织目标序列。
- 通过调整词元位置和自注意力掩码,实现方向内与方向间注意力,同时保持与标准Transformer解码器的兼容性。
- 假设两个方向中对应位置(如 y₁ 和 yₙ)之间具有独立性,从而支持并行生成。
- 该方法与标准单向解码器(如Transformer)兼容,仅需序列重排和掩码调整。
- 混合变体通过引入多词预测(SA)或多方向划分(IMDecoder)进一步提升速度。
- 该方法端到端训练,无需额外参数或复杂的数据构建。
实验结果
研究问题
- RQ1能否在不改变架构的前提下,将双向序列生成高效集成到标准Transformer解码器中?
- RQ2与仅从左到右的半自回归方法相比,交错融合从左到右和从右到左生成是否能减少质量下降?
- RQ3双向生成中的独立性假设是否比单向半自回归解码中的假设更具优势?
- RQ4在多种序列生成任务中,该方法能否在极小质量损失下实现显著速度提升?
- RQ5采用多词预测或多方向划分策略时,该方法的性能扩展性如何?
主要发现
- 在五个机器翻译和两个摘要生成任务上,IBDecoder相较于自回归解码实现了2倍速度提升,BLEU和ROUGE分数保持相当。
- 平均而言,IBDecoder结合半自回归扩展(IBDecoder+SA)在各项任务中实现了4.2倍至11.15倍的速度提升,BLEU或ROUGE分数下降不足1点或0.5点。
- 该模型在质量上优于仅从左到右的半自回归解码方法,表明双向独立性假设比单向假设更具优势。
- 通过知识蒸馏,IBDecoder在六项任务中的五项上超越了标准Transformer基线模型的BLEU和ROUGE分数。
- 在CDMail摘要任务(长序列基准)上,该方法实现了3.02倍的速度提升,而此类任务中非自回归模型通常表现不佳。
- 该方法与其他加速技术(如模型压缩)正交,可与之结合以获得进一步性能增益。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。