On Compositional Generalization of Neural Machine Translation

Yafu Li, Yongjing Yin, Yulong Chen, Yue Zhang

Abstract

While Neural Machine Translation (NMT) models often achieve high performance on standard benchmarks, they struggle with compositional generalization—the ability to translate novel combinations of familiar words. This paper introduces CoGnition, a large-scale, real-world benchmark for this task. Our findings reveal that state-of-the-art Transformers fail on nearly 27% of novel phrases, highlighting a significant gap between traditional metrics like BLEU and actual semantic accuracy.

Introduction

Humans possess a remarkable linguistic ability: if we understand "red car" and "blue ball," we can instantly translate "red ball," even if the combination is entirely new. This is known as compositional generalization. In contrast, current NMT models often act as "stochastic parrots," excelling at memorizing frequent patterns but failing when faced with "zero-shot" combinations—phrases where individual words are common, but their specific arrangement is new. Previous evaluations relied on "toy" datasets (e.g., SCAN or CFQ) that lack natural language complexity. To address this, we present CoGnition, a systematic benchmark designed to quantify NMT failure in compositional tasks.

Methodology

The construction of the CoGnition dataset follows a rigorous pipeline to ensure quality and isolation of compositional effects:

  1. Monolingual Sourcing: Utilizing the ROCStories corpus, the vocabulary was restricted to the 2,000 most frequent words to ensure errors are not due to rare word issues.
  2. Atoms and Compounds: The researchers defined "Atoms" (basic units like dog, red) and "Compounds" (syntactic structures like Noun Phrases).
  3. Novel Synthesis: Novel compounds were systematically generated that never appeared in the training set.
  4. Expert Post-Editing: Initial machine translations were post-edited by human experts to ensure perfect fluency and word-level alignment.
  5. Automatic Evaluation: The authors introduced the Compound Translation Error Rate (CTER) to specifically measure the accuracy of novel phrase translations, as standard metrics like BLEU can be deceptive.
The CoGnition construction pipeline, from monolingual sourcing to automatic evaluation.

The CoGnition Dataset

The CoGnition benchmark consists of a training set of 196,246 English-Chinese sentence pairs and a random test set of 10,000 pairs for standard evaluation. The core of the benchmark is the CG Test Set, which contains 10,800 pairs featuring 2,160 unique novel compounds, each tested in five different sentential contexts to measure robustness.

Results and Analysis

Experiments with state-of-the-art Transformer models yielded several key insights into the limitations of current NMT systems:

The Deception of BLEU

Models can achieve high BLEU scores by correctly translating surrounding context while hallucinating the core novel phrase. While the model scored 69.58 BLEU on the random test set, it dropped to 48.66 BLEU on the CG test set. On an instance-wise basis, 27.31% of novel compounds were translated incorrectly.

The "Zero-Shot" Wall

A striking finding is the performance cliff encountered with unseen compounds. Models translate "many-shot" compounds (seen >10 times in training) with near 0% error. However, for "zero-shot" compounds, the error rate jumps significantly, demonstrating that models rely on memorization rather than rule-based composition.

Error Rate comparison between zero-shot, few-shot, and many-shot compounds.

Structural and Contextual Factors

  • Complexity: Longer compounds and those involving modifiers (e.g., "the doctor he liked") exhibit higher error rates due to the complex reordering required in Chinese.
  • Contextual Interference: Increased dependency distance in the "wrapper" sentence correlates with higher failure rates in translating the embedded novel compound, suggesting that global sentence complexity distracts the model from local composition.

Conclusion

CoGnition reveals that current NMT models are heavily dependent on pattern memorization rather than true semantic composition. By providing a clean, large-scale benchmark, this work encourages the development of architectures and data augmentation techniques that move beyond simple pattern matching toward robust linguistic understanding.

Summary updated

BibTeX
@inproceedings{li2021compositional,
  author = {Yafu Li and Yongjing Yin and Yulong Chen and Yue Zhang},
  title = {{On Compositional Generalization of Neural Machine Translation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.368},
}
Figure