Abstract
Autoregressive sequence generation models have achieved state-of-the-art performance in areas like machine translation and image captioning. These models generate each word by conditioning on previously generated words, which leads to heavy latency during inference. Recently, non-autoregressive decoding has been proposed to speed up inference by generating all words in parallel. Typically, these models use word-level cross-entropy loss to optimize each word independently. However, such a learning process fails to consider sentence-level consistency, resulting in inferior generation quality. In this paper, we propose a simple and efficient model for Non-Autoregressive sequence Generation (NAG) with a novel training paradigm: Counterfactuals-critical Multi-Agent Learning (CMAL). CMAL formulates NAG as a multi-agent reinforcement learning system where element positions in the target sequence are viewed as agents that learn to cooperatively maximize a sentence-level reward. On the MSCOCO image captioning benchmark, our NAG method achieves performance comparable to state-of-the-art autoregressive models while bringing a 13.9x decoding speedup. On the WMT14 EN-DE machine translation dataset, our method outperforms cross-entropy trained baselines by 6.0 BLEU points while achieving a decoding speedup of 17.46x.
Introduction: The Latency-Quality Trade-off
Standard sequence generation models, such as the original Transformer, are inherently autoregressive (AG). They generate text sequentially, where each word's prediction depends on the preceding context. While effective, this sequential nature prevents parallelization, creating a significant bottleneck for real-time applications like live translation or interactive image captioning.
Non-autoregressive (NAG) models aim to break this bottleneck by predicting all words in a sequence simultaneously. However, NAG models frequently suffer from the "multimodality problem," leading to decoding inconsistencies. Because standard NAG models are trained using word-level cross-entropy (XE) loss, they optimize the probability of each word slot independently. This lack of global coordination often results in repetitive or ungrammatical outputs, such as "a zebra of zebras grazing in a a field a."
Methodology: Counterfactuals-critical Multi-Agent Learning (CMAL)
To address the consistency issues of NAG models, we introduce CMAL, a training paradigm that treats the NAG decoder as a cooperative Multi-Agent Reinforcement Learning (MARL) system.
Agents and Cooperative Rewards
In CMAL, each word position in the target sequence is treated as an individual "agent." Instead of optimizing word-level probabilities, these agents work together to maximize a global, sentence-level reward, such as BLEU or CIDEr scores. This shift from local to global optimization forces the model to learn inter-word dependencies without requiring sequential decoding.
Solving Credit Assignment with Counterfactual Baselines
A core challenge in MARL is credit assignment: determining which specific agent's action contributed to a high or low global reward. CMAL employs a counterfactual baseline to calculate agent-specific advantages. It compares the total reward of the generated sentence to the expected reward if a specific agent had chosen a different word while all other agents' actions remained fixed. This provides a precise training signal, allowing the model to identify and correct specific errors, such as redundant words in a sequence.
Compositional Agents and Data Augmentation
To further enhance local fluency, we introduce "compositional agents" that evaluate pairs of neighboring words, ensuring smooth transitions. Additionally, we utilize unlabeled data augmentation. A pre-trained autoregressive "teacher" model generates high-quality labels for large-scale unlabeled datasets, providing a robust training signal for the "student" NAG model.
Experimental Results
The CMAL-trained NAG model was evaluated on the MSCOCO image captioning benchmark and the WMT14 EN-DE machine translation dataset.
Performance and Speedup
As shown in the results table below, the CMAL approach significantly narrows the quality gap between AG and NAG models. On MSCOCO, the final model (+ postprocess) achieved a CIDEr score of 126.9, nearly matching the performance of state-of-the-art autoregressive models while delivering a massive 13.9x speedup compared to the teacher model.
On the WMT14 EN-DE translation task, CMAL improved the baseline NAG model by 6.0 BLEU points and achieved a peak speedup of 17.46x. Qualitative analysis confirmed that CMAL effectively eliminates the stuttering and unfluent phrases typical of standard NAG models.
Conclusion and Future Work
CMAL demonstrates that multi-agent reinforcement learning can effectively bridge the gap between speed and quality in sequence generation. By optimizing for sentence-level consistency through counterfactual credit assignment, we enable high-speed parallel generation without the usual pitfalls of non-autoregressive models.
Future research will focus on handling longer sequences, where agent coordination becomes increasingly complex. Potential avenues include Hierarchical Reinforcement Learning, where higher-level agents manage groups of word-level agents to maintain coherence across long-form text.
Summary updated