NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Bag-of-Words as Target for Neural Machine Translation

Shuming Ma, Xu Sun, Yizhong Wang, Junyang Lin

Abstract

Neural Machine Translation (NMT) systems typically rely on sequence-to-sequence models trained to minimize cross-entropy loss against a single reference sentence. This approach often penalizes valid translations that deviate from the specific word order of the reference. This paper introduces a novel training objective that incorporates a "Bag-of-Words" (BoW) target alongside the standard sequence target. By treating translation as both sequence generation and multi-label classification, the model learns to capture the core content of the target sentence more effectively. Experimental results on Chinese-English translation tasks show that this method significantly outperforms baseline NMT models and other state-of-the-art approaches.

Introduction: The One-to-Many Challenge

In machine translation, there is rarely a single "correct" answer. A single source sentence can often be translated into multiple valid target sentences using different syntactic structures or synonyms. However, standard NMT systems are usually trained using a sequence-to-sequence (Seq2Seq) approach with cross-entropy loss against a single reference.

This creates a "one-to-many" mapping problem: if a model generates a perfectly valid translation that differs from the specific reference in the training set, the loss function treats it as an error. This rigidity discourages the model from exploring diverse expressions. The authors propose that while correct translations may vary in structure, they typically share a common "Bag-of-Words" (BoW)—the set of core semantic units.

Methodology: Dual-Target Training

The proposed architecture extends the standard Bi-LSTM encoder-decoder framework with an attention mechanism by adding a dedicated BoW module.

The BoW Module

Instead of only predicting the next word in a sequence, the model is trained to predict the entire set of words present in the target sentence. The decoder produces word-level score vectors ($s_t$) at each time step. To incorporate the BoW target, these vectors are summed across the entire generated sequence to create a sentence-level score.

The architecture of the proposed NMT model featuring the Bag-of-Words (BoW) module integrated with the decoder.

Loss Function and Weighting

A sigmoid function is applied to the summed score to estimate the probability ($p_b$) of each word appearing in the translation. The final training objective is a weighted combination of:

  1. Sequence Loss ($l_1$): Standard cross-entropy for word order.
  2. BoW Loss ($l_2$): Multi-label classification loss to ensure the presence of correct content words.

The authors employ a dynamic scheduling coefficient ($\lambda$) for the BoW loss. It starts low to allow the model to learn basic sequencing and gradually increases to emphasize content accuracy.

Experimental Setup

The model was evaluated on the NIST Chinese-English translation task using 1.25 million sentence pairs for training. The NIST 2002 dataset served as the validation set, while NIST 2003 through 2008 were used for testing. The vocabulary was limited to the 50,000 most frequent words for both languages.

Results and Discussion

The addition of the BoW target yielded substantial improvements in translation quality.

Comparison of BLEU scores across various NIST test sets, showing the proposed model's performance against several baselines.

As shown in the results table, the proposed model outperformed the Seq2Seq+Attention baseline by an average of 4.55 BLEU points across all test sets. It also consistently surpassed established models like Moses (phrase-based), RNNSearch, and more complex architectures like Bi-Tree-LSTM.

Key Insights

  • Relaxed Supervision: The BoW target provides a "relaxed" signal, rewarding the model for including essential words even if they are not in the exact reference position.
  • Improved Adequacy: Qualitative analysis indicated that the BoW-trained model was less likely to omit crucial words, leading to more informative translations.
  • Generalization: By acting as a proxy for alternative valid translations, the BoW target helps the model generalize better to unseen phrasing.

Conclusion and Future Work

This paper demonstrates that incorporating a Bag-of-Words target is a simple yet effective way to address the one-to-many mapping problem in NMT. While the current study focused on Chinese-to-English, future research could explore its effectiveness in morphologically rich languages or low-resource settings. Additionally, refining the BoW module to account for word frequency (rather than just presence) could further enhance performance.

Summary updated

BibTeX
@inproceedings{ma2018bag,
  author = {Shuming Ma and Xu Sun and Yizhong Wang and Junyang Lin},
  title = {{Bag-of-Words as Target for Neural Machine Translation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2018},
  doi = {10.18653/v1/p18-2053},
}
Figure