Token-wise Curriculum Learning for Neural Machine Translation

Chen Liang, Haoming Jiang, Xiaodong Liu, Pengcheng He, Weizhu Chen, Jianfeng Gao, Tuo Zhao

TL;DR

This paper introduces Token-wise Curriculum Learning (TC) for Neural Machine Translation, a method that trains models on gradually increasing sub-sequences of target sentences. By focusing on the "easier" beginning tokens first and expanding to the full sentence, TC overcomes the sample diversity limitations of traditional sentence-level curriculum learning, leading to significant performance gains in low-resource translation and language modeling tasks.

What Problem Does This Paper Address?

Curriculum learning—the practice of training a model on "easy" samples before moving to "hard" ones—is a popular technique for improving Neural Machine Translation (NMT). Traditionally, this is done at the sentence level: the model starts by training on short or simple sentence pairs.

However, the authors identify a critical flaw in this approach for low-resource languages: when you filter for only "easy" sentences in an already small dataset, you drastically reduce the diversity of the training data. As shown in Figure 1, sentence-level curriculum (SC) results in significantly fewer unique trigrams during early training compared to standard training, which can actually stall the model's progress.

Figure 1: Sample diversity in early stage of training under low-resource and high-resource settings.

Methods

The authors propose shifting the curriculum from the sentence level to the token level. Instead of picking specific sentences, the model uses all available sentences but only learns to predict the beginning portions initially.

They introduce two variants:

  1. Hard Curriculum: The model only calculates loss for a sub-sequence of length $l_i$ starting from the first token. This length $l_i$ grows linearly as training iterations ($i$) progress until it covers the full sentence.
  2. Soft Curriculum: Instead of a hard cutoff, the model calculates loss for all tokens but applies geometrically decaying weights to later tokens. As training continues, these weights gradually shift toward 1.0 for all positions.
Figure 3: A comparison between sub-sequence selec- tion in hard and soft curricula. Each row of grids repre- sents a target sentence of tokens. The depth of color from light−→dark represents the weight on the token loss from 0−→1.

The rationale is rooted in the nature of autoregressive generation: because NMT models generate text left-to-right, errors in early tokens accumulate and make later tokens harder to predict. Figure 4 confirms this "error accumulation" phenomenon across various sentence lengths.

Figure 4: The averaged beam search error rate at differ- ent relative positions of sentences.

Datasets

The researchers evaluated their approach across several settings:

  • Low-Resource NMT: IWSLT15 English-Vietnamese (En-Vi), IWSLT14 German-English (De-En), IWSLT16 French-English (Fr-En), and WMT16 Romanian-English (Ro-En).
  • High-Resource NMT: WMT16 English-German (En-De).
  • Language Modeling: Penn Treebank (PTB) and WikiText-2 (WT2).
  • Transfer Learning: Fine-tuning pre-trained models (like XLM) on subsets (1% to 50%) of target domain data.

Key Insights and Ideas

  • Diversity vs. Simplicity: The "aha moment" is that for low-resource settings, sample diversity is just as important as sample easiness. Token-wise curriculum allows the model to see every source sentence from the start, maintaining high trigram diversity (Figure 5) while still providing an "easy" entry point.
  • Directionality Matters: Through ablation studies, the authors found that a "left-to-right" curriculum is essential. Trying to learn the middle or end of sentences first (or using random sub-sequences) actually hurts performance because it misaligns with how the model eventually decodes text.
  • Synergy with Sentence-Level Methods: In high-resource settings where data diversity isn't a bottleneck, token-wise and sentence-level curricula can be combined to achieve even better results than either method alone.

Key Results

  • Low-Resource Gains: In standard training, TC outperformed sentence-level baselines by approximately 0.5 BLEU points across multiple language pairs.
  • Extreme Scarcity: The benefits were most pronounced in extremely low-resource scenarios. In a domain transfer task with only 1% of the target data, the token-wise approach improved performance by over 3 BLEU points.
  • Generalization: The method isn't limited to translation; it improved perplexity by over 0.5 points on standard language modeling benchmarks (PTB and WT2).
  • Faster Convergence: As seen in Figure 2, the BLEU score under token-wise curriculum increases faster and more smoothly in the early stages compared to models trained without a curriculum.
Figure 2: BLEU score (dev) in low-resource (upper) and high-resource (lower) settings.

Limitations and Future Work

The authors note that they used a simple linear expansion schedule for the sub-sequences. They suggest that future work could explore adaptive schedulers that adjust the expansion rate based on the model's current performance or uncertainty, potentially leading to even more efficient training. Additionally, while the method works well for left-to-right autoregressive models, its application to non-autoregressive models remains an open question.

Summary updated

BibTeX
@inproceedings{liang2021token,
  author = {Chen Liang and Haoming Jiang and Xiaodong Liu and Pengcheng He and Weizhu Chen and Jianfeng Gao and Tuo Zhao},
  title = {{Token-wise Curriculum Learning for Neural Machine Translation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  url = {https://openreview.net/forum?id=tSseufUqAu},
}
Figure