TL;DR
This paper introduces "Aggressive Decoding," a novel method to significantly speed up sequence generation (like text translation or error correction) without sacrificing output quality. It achieves this by aggressively predicting multiple tokens in parallel and then verifying them, offering a substantial speedup over traditional methods.
What Problem Does This Paper Address?
Autoregressive (AR) decoding, the standard for sequence generation models like Transformers, is inherently slow. It generates text one token at a time, meaning each step depends on the previous one, limiting parallel computation. While non-autoregressive (NAR) methods offer speedups, they often come at the cost of reduced generation quality. This paper tackles the challenge of achieving significant speedups in sequence generation without compromising the quality of the output, aiming for a "lossless acceleration."
Methods
The core idea of Aggressive Decoding is to combine aggressive decoding (predicting many tokens at once) with verification (ensuring the predictions are correct). This is done in parallel to leverage modern hardware. The authors propose two main variants:
- Input-guided Aggressive Decoding (IAD): For tasks where the output is very similar to the input (like Grammatical Error Correction), IAD aggressively "copies" tokens from the input as drafted predictions. It then verifies these drafted tokens. If a mismatch (bifurcation) is found, it re-decodes from that point using standard AR decoding.
- Generalized Aggressive Decoding (GAD): For tasks with less input-output similarity (like Machine Translation), GAD uses a separate, faster NAR model to generate a "draft" of multiple tokens. This draft is then verified by a standard AR model. If the draft passes verification, it's accepted; otherwise, it's corrected. A variant, GAD++, further loosens the verification criteria to allow more drafted tokens to be accepted, leading to even higher speedups.
Datasets
The paper evaluates its methods on several standard benchmarks:
- Grammatical Error Correction (GEC): CoNLL-2013 (validation), CoNLL-2014 (test), BEA-2019 GEC training data (Lang-8, NUCLE, FCE, W&I+LOCNESS).
- Machine Translation (MT): WMT14 English-German, WMT14 German-English, WMT16 English-Romanian.
- Text Simplification: Wiki-large.
- Abstractive Summarization: CNN Daily Mail.
Key Insights and Ideas
- Parallelism is Key: The fundamental insight is that by aggressively drafting tokens in parallel and then verifying them, we can exploit the parallel processing capabilities of modern hardware much more effectively than sequential AR decoding.
- Lossless is Achievable: The paper demonstrates that it's possible to achieve significant speedups without sacrificing generation quality, a long-standing trade-off in sequence generation research.
- Task-Specific Adaptation: The distinction between IAD and GAD highlights that the best approach depends on the nature of the task, particularly the similarity between input and output sequences.
- Verification is Crucial: The verification step, whether by direct input comparison (IAD) or an AR model (GAD), is essential for maintaining the high quality of AR decoding.
- GAD++ Offers More Speed: Loosening the verification criteria in GAD++ allows for more aggressive acceptance of drafted tokens, leading to higher speedups, even if it means a slight, controlled loss in quality.
Key Results
- Input-guided Aggressive Decoding (IAD): Achieved 7x-9x speedup on Grammatical Error Correction and Text Simplification tasks with identical results to greedy decoding.
- Generalized Aggressive Decoding (GAD): Achieved 3x-5x speedup on Machine Translation and Abstractive Summarization tasks with identical or even better quality compared to autoregressive decoding.
- GAD++: Further improved speedups, reaching up to 4.5x on MT tasks with only a marginal loss in quality.
- Hardware Matters: The speedups are more pronounced on hardware better suited for parallel computing.
- Memory Efficiency: GAD/GAD++ only incurs a small, negligible increase in GPU memory usage compared to AR baselines.
Limitations and Future Work
- NAR Drafter Performance: The quality of the NAR drafter in GAD is crucial. The paper notes that their NAR drafter's quality is good but not state-of-the-art compared to some iterative NAR approaches, suggesting that a more powerful NAR model could further improve GAD.
- Sequential Encoding: The current implementation still has a sequential encoding step for AR and NAR, which could be parallelized for further optimization.
- NAR Decoder Cost: The NAR decoder is more computationally expensive than the AR decoder due to its multi-round computation. Future work could focus on improving NAR decoding mechanisms.
- Implementation Optimization: The authors mention that their current implementation is naive and under-optimized, especially regarding batch inference and cached attention, suggesting that further optimizations could yield even better performance.
- Potential for De Facto Standard: The authors express optimism that Aggressive Decoding could become a standard for efficient and lossless sequence generation.
Summary updated