[Paper Review] Lossless Acceleration for Seq2seq Generation with Aggressive Decoding
This paper proposes Aggressive Decoding, a novel lossless acceleration method for sequence-to-sequence generation that replaces sequential autoregressive decoding with parallel aggressive decoding followed by autoregressive verification. It achieves 3×–9× speedup over greedy autoregressive decoding with identical or improved generation quality on tasks like machine translation, abstractive summarization, and grammatical error correction, leveraging parallel computing for efficiency without quality trade-offs.
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.
Motivation & Objective
- Address the inefficiency of autoregressive decoding in sequence-to-sequence models, which processes one token at a time and limits inference speed.
- Overcome the quality degradation common in prior speedup methods like non-autoregressive decoding, which sacrifice output quality for speed.
- Develop a decoding framework that maintains autoregressive generation quality while significantly accelerating inference through parallelization.
- Design task-specific variants of aggressive decoding for different seq2seq scenarios: input-similar tasks (e.g., GEC) and general seq2seq tasks (e.g., MT).
Proposed method
- Propose Aggressive Decoding as a two-stage process: first aggressively generate a batch of draft tokens in parallel, then verify them using autoregressive scoring to ensure correctness.
- Introduce Input-guided Aggressive Decoding (IAD) for tasks with high input-output similarity (e.g., GEC, text simplification), where the input sentence itself is used as the draft sequence.
- Introduce Generalized Aggressive Decoding (GAD) for general seq2seq tasks (e.g., MT, summarization), using a separate non-autoregressive (NAR) model to generate draft tokens.
- Apply parallel verification: only tokens that pass autoregressive verification are accepted, ensuring output fidelity identical to standard autoregressive decoding.
- Leverage parallel computing for both draft generation and verification stages, maximizing hardware utilization on GPUs.
- Optimize inference by enabling parallel encoding of the input for both the NAR and AR components in GAD, reducing sequential bottlenecks.
Experimental results
Research questions
- RQ1Can we accelerate sequence-to-sequence generation without sacrificing generation quality, particularly by replacing sequential decoding with a parallelizable alternative?
- RQ2How can we design a decoding strategy that achieves significant speedup while guaranteeing identical or improved output quality compared to autoregressive decoding?
- RQ3Can we develop a unified framework that adapts to different seq2seq tasks—especially those with high input-output similarity versus general translation tasks—using task-specific draft generation strategies?
- RQ4To what extent can aggressive decoding benefit from stronger hardware with better parallel computing capabilities?
- RQ5How does the performance of aggressive decoding scale with improvements in the non-autoregressive draft model, and what are the key bottlenecks in the current implementation?
Key findings
- Input-guided Aggressive Decoding (IAD) achieves 7× to 9× speedup over greedy autoregressive decoding in grammatical error correction and text simplification, with identical output quality.
- Generalized Aggressive Decoding (GAD) achieves 3× to 5× speedup in machine translation and abstractive summarization, with generation quality matching or exceeding that of autoregressive decoding.
- The speedup is highly dependent on hardware parallelism, with stronger GPUs yielding even greater performance gains, indicating strong scalability with compute resources.
- The verification step ensures that all accepted outputs are identical to those of autoregressive decoding, confirming the lossless nature of the method.
- The NAR draft model is a critical bottleneck in GAD, consuming more time than the AR verification due to bidirectional attention and lack of computation caching.
- The input encoding step for both NAR and AR components accounts for ~16% of total inference time, suggesting potential for optimization via parallel encoding.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.