Skip to main content
QUICK REVIEW

[论文解读] Lossless Acceleration for Seq2seq Generation with Aggressive Decoding

Tao Ge, Heming Xia|arXiv (Cornell University)|May 20, 2022
Algorithms and Data Compression被引用 6
一句话总结

本文提出了一种名为激进解码(Aggressive Decoding)的新方法,这是一种无损加速序列到序列生成的技术,通过将逐个自回归解码替换为并行激进解码与自回归验证的两阶段过程,实现了在机器翻译、抽象摘要和语法错误修正等任务上,相比贪婪自回归解码3倍至9倍的加速,且生成质量保持不变或更优。该方法利用并行计算实现高效性,无需在质量上做出妥协。

ABSTRACT

We study lossless acceleration for seq2seq generation with a novel decoding algorithm -- Aggressive Decoding. Unlike the previous efforts (e.g., non-autoregressive decoding) speeding up seq2seq generation at the cost of quality loss, our approach aims to yield the identical (or better) generation compared with autoregressive decoding but in a significant speedup, achieved by innovative cooperation of aggressive decoding and verification that are both efficient due to parallel computing. We propose two Aggressive Decoding paradigms for 2 kinds of seq2seq tasks: 1) For the seq2seq tasks whose inputs and outputs are highly similar (e.g., Grammatical Error Correction), we propose Input-guided Aggressive Decoding (IAD) that aggressively copies from the input sentence as drafted decoded tokens to verify in parallel; 2) For other general seq2seq tasks (e.g., Machine Translation), we propose Generalized Aggressive Decoding (GAD) that first employs an additional non-autoregressive decoding model for aggressive decoding and then verifies in parallel in the autoregressive manner. We test Aggressive Decoding on the most popular 6-layer Transformer model on GPU in multiple seq2seq tasks: 1) For IAD, we show that it can introduce a 7x-9x speedup for the Transformer in Grammatical Error Correction and Text Simplification tasks with the identical results as greedy decoding; 2) For GAD, we observe a 3x-5x speedup with the identical or even better quality in two important seq2seq tasks: Machine Translation and Abstractive Summarization. Moreover, Aggressive Decoding can benefit even more from stronger computing devices that are better at parallel computing. Given the lossless quality as well as significant and promising speedup, we believe Aggressive Decoding may potentially evolve into a de facto standard for efficient and lossless seq2seq generation in the near future.

研究动机与目标

  • 解决序列到序列模型中自回归解码的低效问题,其一次仅处理一个标记,限制了推理速度。
  • 克服以往加速方法(如非自回归解码)中常见的质量下降问题,这些方法为追求速度而牺牲了输出质量。
  • 开发一种解码框架,在显著加速推理的同时保持自回归生成的质量。
  • 为不同序列到序列场景设计特定任务的激进解码变体:输入相似任务(如GEC)和通用序列到序列任务(如MT)

提出的方法

  • 提出激进解码作为一种两阶段过程:首先并行激进生成一批草稿标记,然后通过自回归评分对这些标记进行验证,以确保正确性。
  • 针对输入输出高度相似的任务(如GEC、文本简化)提出输入引导的激进解码(IAD),其中输入句子本身被用作草稿序列。
  • 针对通用序列到序列任务(如MT、摘要生成)提出广义激进解码(GAD),使用独立的非自回归(NAR)模型生成草稿标记。
  • 应用并行验证:仅通过自回归验证的标记被接受,确保输出保真度与标准自回归解码完全一致。
  • 在草稿生成和验证阶段均利用并行计算,最大化GPU上的硬件利用率。
  • 通过为NAR和AR组件并行编码输入,优化推理过程,减少串行瓶颈。

实验结果

研究问题

  • RQ1我们能否在不牺牲生成质量的前提下加速序列到序列生成,特别是通过用可并行化的替代方案取代顺序解码?
  • RQ2如何设计一种解码策略,实现显著加速,同时保证输出质量与自回归解码相同或更优?
  • RQ3我们能否开发一种统一框架,适配不同序列到序列任务——尤其是高输入输出相似性任务与通用翻译任务——通过特定任务的草稿生成策略?
  • RQ4激进解码在具备更强并行计算能力的硬件上能获得多大程度的性能提升?
  • RQ5当非自回归草稿模型性能提升时,激进解码的性能如何扩展?当前实现中的关键瓶颈是什么?

主要发现

  • 在语法错误修正和文本简化任务中,输入引导的激进解码(IAD)相比贪婪自回归解码实现了7倍至9倍的加速,且输出质量完全一致。
  • 在机器翻译和抽象摘要任务中,广义激进解码(GAD)实现了3倍至5倍的加速,生成质量与自回归解码相当或更优。
  • 加速效果高度依赖硬件并行能力,更强的GPU可带来更大的性能增益,表明该方法在计算资源上具有良好的可扩展性。
  • 验证步骤确保所有被接受的输出与自回归解码结果完全相同,证实了该方法的无损特性。
  • 在GAD中,NAR草稿模型是关键瓶颈,其耗时超过AR验证阶段,原因在于双向注意力机制和缺乏计算缓存。
  • NAR和AR组件的输入编码步骤占总推理时间的约16%,表明通过并行编码可进一步优化。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

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