Abstract
Neural Machine Translation (NMT) models frequently struggle with compositionality—the ability to understand complex expressions by combining their constituent parts. This research identifies the encoder's "forgetful" internal representations as a primary bottleneck for two key aspects of compositionality: productivity (generalizing to longer sentences) and systematicity (using known words in novel contexts). We demonstrate that a simple Bag-of-Words (BoW) pre-training step can mitigate these issues by forcing the encoder to maintain a global representation of the input, significantly improving performance on compositional generalization tasks.
Introduction
While modern NMT systems achieve high performance on standard benchmarks, they often fail to exhibit human-like compositional reasoning. This failure manifests in two ways. First, productivity is hampered; models trained on short sentences often fail to translate longer concatenated sequences. Second, systematicity is lacking; models struggle to use a newly learned word in a context slightly different from its training environment.
The Encoder Bottleneck: Information Decay
The researchers hypothesize that the standard Sequence-to-Sequence (Seq2Seq) architecture, particularly the LSTM encoder, fails to create a robust internal representation. As the encoder processes a sequence, the final hidden state tends to "forget" information from the beginning of the sentence.
Diagnostic experiments confirm this decay. When attempting to reconstruct the input from different representations, the final hidden state performs significantly worse than intermediate states or the full sentence representation, as shown in the precision and recall metrics below.
This "forgetfulness" is further evidenced in productivity tests. When translating concatenated sentence pairs, the recall for the first sentence is markedly lower than for the second, indicating that the encoder prioritizes more recent information at the expense of the initial context.
Proposed Solution: Bag-of-Words Pre-training
To address this bottleneck, the authors propose a Bag-of-Words (BoW) Pre-training phase. Before the translation task begins, the encoder is trained to predict the presence or absence of every word in the vocabulary for a given input sentence, regardless of order. This multi-label binary cross-entropy objective acts as a powerful inductive bias, forcing the encoder to capture the global content of the entire sequence in its hidden state before learning the sequential nuances of translation.
Experimental Results
The BoW pre-training was evaluated on the IWSLT-14 German-English dataset for productivity and a synthetic English-French dataset for systematicity.
Productivity Gains
On the productivity test set (concatenated sentence pairs), the BoW pre-training improved the BLEU score from 24.5 to 26.4. By ensuring the encoder did not discard "early" information, the model became more robust to increased sequence length.
Systematicity Gains
The impact on systematicity was even more pronounced. In tests involving novel word usage (e.g., translating a new word like "daxy" in unseen contexts), the BLEU score jumped from 36.14 to 52.53. Crucially, the baseline model's zero-shot word usage—the ability to correctly generate the novel word in the output—rose from a meager 12.25% to 50% with BoW pre-training.
Conclusion
This work highlights that the lack of compositionality in NMT is largely an architectural issue rooted in the encoder's representation fidelity. A simple auxiliary task like Bag-of-Words prediction can significantly improve a model's ability to handle both longer sequences and novel word combinations. Future work should investigate whether similar bottlenecks exist in Transformer-based architectures and explore more complex pre-training objectives.
Summary updated