Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Accelerating Transformer Inference for Translation via Parallel Decoding

About

Autoregressive decoding limits the efficiency of transformers for Machine Translation (MT). The community proposed specific network architectures and learning-based methods to solve this issue, which are expensive and require changes to the MT model, trading inference speed at the cost of the translation quality. In this paper, we propose to address the problem from the point of view of decoding algorithms, as a less explored but rather compelling direction. We propose to reframe the standard greedy autoregressive decoding of MT with a parallel formulation leveraging Jacobi and Gauss-Seidel fixed-point iteration methods for fast inference. This formulation allows to speed up existing models without training or modifications while retaining translation quality. We present three parallel decoding algorithms and test them on different languages and models showing how the parallelization introduces a speedup up to 38% w.r.t. the standard autoregressive decoding and nearly 2x when scaling the method on parallel resources. Finally, we introduce a decoding dependency graph visualizer (DDGviz) that let us see how the model has learned the conditional dependence between tokens and inspect the decoding procedure.

Andrea Santilli, Silvio Severino, Emilian Postolache, Valentino Maiorca, Michele Mancusi, Riccardo Marin, Emanuele Rodol\`a• 2023

Related benchmarks

TaskDatasetResultRank
Text-to-Image GenerationMSCOCO 2017 (val)
CLIP Score0.3131
39
Speculative Decoding EfficiencyCNN/DM, GSM8K, TinyStories Aggregate
Decoding Speed (tokens/s)19.49
15
Mathematical ReasoningGSM8K 20 (test)
Speedup (x)0.99
15
Narrative GenerationTinyStories 21 (test)
Speedup (x)0.98
15
SummarizationCNN/Daily Mail 19 (test)
Speedup (x)0.96
15
Text-to-Image GenerationParti-Prompts (val)
SR Score1.01
14
Text-to-Image GenerationT2ICompBench (val)
SR Score1.02
14
Code GenerationHumanEval
Accuracy87.8
10
Mathematical ReasoningGSM8K (test)
TPF (Time Per First Token)1.05
9
Code GenerationHumanEval
TPF1.03
9
Showing 10 of 12 rows

Other info

Follow for update