Abstract
State-of-the-art neural machine translation models generate a translation from left to right and every step is conditioned on the previously generated tokens. The sequential nature of this generation process causes fundamental latency in inference since we cannot generate multiple tokens in each sentence in parallel. We propose an attention-masking based model, called Disentangled Context (DisCo) transformer, that simultaneously generates all tokens given different contexts. The DisCo transformer is trained to predict every output token given an arbitrary subset of the other reference tokens. We also develop the parallel easy-first inference algorithm, which iteratively refines every token in parallel and reduces the number of required iterations. Our extensive experiments on 7 translation directions with varying data sizes demonstrate that our model achieves competitive, if not better, performance compared to the state of the art in non-autoregressive machine translation while significantly reducing decoding time on average.
Introduction
Standard Neural Machine Translation (NMT) relies on autoregressive (AR) decoding, where words are generated sequentially. While accurate, this process is a bottleneck for real-time applications. Non-autoregressive translation (NAT) aims to generate all words simultaneously but often suffers from "multimodality" issues, leading to repetitions or omissions. Iterative refinement techniques, such as Conditional Masked Language Models (CMLMs), attempt to mitigate this by repeatedly masking and re-predicting tokens. However, these models are often inefficient to train and rely on fixed inference schedules.
The Disentangled Context Transformer
The DisCo Transformer addresses these limitations through a novel architecture and training objective. Unlike standard models that predict only masked tokens, DisCo is trained to predict every word in a sentence simultaneously, conditioned on a random subset of context tokens.
To prevent "cyclic information leakage"—where tokens might inadvertently attend to their own ground-truth values through intermediate layers—the architecture employs a disentangled context mechanism. As shown in Figure 1, the model separates the query (Q) from the keys and values (K, V). The keys and values are derived directly from word and position embeddings, ensuring that the context remains "disentangled" from the specific token being predicted at the current layer.
Parallel Easy-First Inference
Complementing the architecture is the "Parallel Easy-First" inference algorithm. Instead of a rigid masking schedule, this algorithm predicts all tokens in parallel and ranks them by confidence. In subsequent iterations, every token is updated based on the "easiest" (most confident) tokens from the previous pass. This allows the model to dynamically adjust the number of refinement steps based on sentence complexity, often converging much faster than fixed-step baselines.
Experimental Results
The authors evaluated DisCo across several benchmarks, including WMT14 EN-DE, WMT16 EN-RO, WMT17 EN-ZH, and WMT14 EN-FR.
Efficiency and Quality
DisCo demonstrates a superior trade-off between translation quality (BLEU) and inference speed. On the WMT17 EN-ZH dataset, DisCo outperformed the CMLM baseline (34.63 vs 34.24 BLEU) while requiring significantly fewer sequential steps (5.44 vs 10).
As illustrated in Figure 2, the DisCo model with Easy-First decoding maintains high BLEU scores while achieving up to a 3x speedup over standard autoregressive Transformers. The dynamic nature of the Easy-First algorithm allows it to reach high quality in fewer iterations than the fixed-step CMLM.
Conclusion
The DisCo Transformer represents a significant step forward in non-autoregressive translation. By enabling efficient training on arbitrary contexts and introducing a flexible, confidence-based inference algorithm, it matches or exceeds the performance of previous NAT state-of-the-art models while offering substantial speedups. Future work may explore its application to general-purpose language representation pre-training, leveraging its ability to learn from diverse contextual subsets.
Summary updated