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

Standard Neural Machine Translation (NMT) models are typically trained to maximize the likelihood of a single reference sequence, which can lead to excessive penalization of semantically correct but syntactically different translations. This paper introduces an auxiliary Bag-of-Words (BoW) prediction task that encourages the model to capture the essential semantic content of the target sentence. By integrating BoW as a training-time objective, the model achieves significant performance gains, particularly in reducing word omissions. Experiments on Chinese-English translation tasks demonstrate a 4.55 BLEU point improvement over a strong attention-based baseline.

Addressing the Rigidity of Sequence-to-Sequence Learning

In machine translation, there is rarely a single "correct" output. A single source sentence can often be translated into multiple valid target sentences using different synonyms or syntactic structures. However, traditional NMT models (like Seq2Seq) are trained using a rigid cross-entropy loss against a single reference. When a model generates a valid translation that differs from the reference, the standard loss function treats it as an error, limiting the model's ability to generalize and often resulting in the omission of key information.

The authors argue that while correct translations may vary in structure, they almost always share a similar Bag-of-Words—the core set of vocabulary required to convey the intended message. By supervising the BoW, the model is provided with a "soft" target representing the semantic space of possible translations.

Methodology: Dual-Target Training

The proposed architecture utilizes a standard Bi-LSTM encoder and an attention-based LSTM decoder, augmented with a BoW generation module.

The NMT architecture with an auxiliary Bag-of-Words (BoW) target layer derived from decoder word scores.

BoW Generation and Loss

To create the BoW target, the model takes the word-level score vectors produced by the decoder at every position in the sequence. These vectors are summed to create a single sentence-level score vector, which is then passed through a sigmoid function for multi-label classification. The objective is to maximize the probability of words present in the reference bag-of-words, regardless of their specific position.

The total training loss is a weighted sum of the standard sequence loss ($l_1$) and the new BoW loss ($l_2$): $$L = l_1 + \lambda l_2$$

The weight $\lambda$ is dynamically scheduled; it begins low to allow the model to learn basic grammar and increases over time to focus the model on capturing the full set of necessary semantic concepts.

Experimental Results

The model was evaluated on a large-scale Chinese-English translation task using 1.25 million sentence pairs from LDC corpora. Testing was conducted across multiple NIST translation tasks (2003–2008).

Comparison of BLEU scores across multiple NIST datasets, showing the proposed BoW model outperforming various baselines.

As shown in the results table, the BoW-augmented model achieved a combined BLEU score of 36.51, representing a significant jump of 4.55 BLEU points over the Seq2Seq+Attention baseline (31.96). Furthermore, the model outperformed several other sophisticated NMT variants, including RNNSearch, Lattice-based models, and Mixed RNNs. Qualitative analysis confirmed that the BoW loss acts as a safety net, making the model significantly less likely to omit critical technical terms compared to the baseline.

Discussion and Key Insights

  • BoW as a Semantic Proxy: The Bag-of-Words acts as a rough but effective approximation for the "meaning" of a sentence, allowing for more flexible supervision during training.
  • Training vs. Inference: The BoW module is primarily a training-time intervention. It guides the model to learn superior internal representations without adding computational complexity during the inference (translation) phase.
  • Future Directions: While highly effective for Chinese-English, future work is needed to assess performance in morphologically rich languages (e.g., Finnish) where word forms vary significantly, and in low-resource settings. Additionally, while this study utilized LSTMs, the BoW target concept is theoretically compatible with modern Transformer architectures.

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