Abstract
The autoregressive nature of Transformer models remains a significant bottleneck for real-time machine translation, as tokens must be generated sequentially. This paper introduces a novel approach that reframes greedy decoding as a system of nonlinear equations, allowing for parallelization via fixed-point iteration methods. By implementing Parallel Jacobi (PJ), Parallel GS-Jacobi (PGJ), and Hybrid GS-Jacobi (HGJ) decoding, we demonstrate speedups of up to 38% on standard hardware and nearly 2x on highly parallel systems. Crucially, these methods are mathematically guaranteed to converge to the same output as standard greedy decoding, requiring no retraining or loss in translation quality.
Introduction
While Transformers have revolutionized machine translation through their highly parallelizable training phase, their inference remains inherently sequential. To predict the $n$-th token, the model must wait for the preceding $n-1$ tokens, creating a latency bottleneck that hinders deployment in real-time or edge environments. Previous attempts to mitigate this, such as Non-Autoregressive Translation (NAT), often require complex distillation or entirely new architectures, frequently at the cost of translation accuracy. This work addresses the problem by modifying the decoding algorithm itself, rather than the model architecture.
Methodology: Parallelizing the Sequential
The core insight of this work is that greedy autoregressive decoding can be viewed as solving a triangular system of nonlinear equations. Instead of solving these equations one by one, we can use iterative fixed-point methods to solve them in parallel.
The authors propose three primary algorithms:
- Parallel Jacobi (PJ) Decoding: The sequence is initialized with a "draft" (e.g., padding tokens) and updated entirely in parallel across multiple iterations until convergence.
- Parallel GS-Jacobi (PGJ) Decoding: To improve efficiency for long sequences, the sentence is divided into blocks. These blocks are processed using a combination of sequential Gauss-Seidel steps and parallel Jacobi updates.
- Hybrid GS-Jacobi (HGJ) Decoding: This variant addresses the dynamic stopping problem. It runs parallel decoding for a fixed length and then switches to standard sequential decoding to identify the end-of-sentence ([EOS]) token.
Experimental Results
The methods were evaluated on standard benchmarks (WMT14 En-De, WMT16 En-Ro) and various low-to-medium resource language pairs using Opus and MBart50 architectures.
Speedup and Scalability
On a standard 16-core CPU, the PGJ and HGJ algorithms achieved a 34-38% speedup over the autoregressive baseline. The performance gains are even more pronounced as hardware parallelism increases.
As shown in the scaling analysis, the parallel algorithms continue to gain speed as more CPU cores are added, reaching nearly a 2x speedup with 122 cores. In contrast, the standard autoregressive baseline remains limited by its sequential nature, showing no improvement with additional compute.
Discussion and Limitations
A key advantage of this approach is its "plug-and-play" nature; it can be applied to any pre-trained Transformer without retraining. However, there are trade-offs. Parallel decoding increases the total number of floating-point operations (FLOPs) and memory usage per second, which may be a concern for power-constrained devices. Additionally, while the method works perfectly for greedy decoding, adapting it to Beam Search remains a challenge due to the latter's inherent dynamic programming structure. Future work may explore better initialization strategies, such as using lightweight "drafting" models to provide a more accurate starting sequence for the iterations.
Summary updated