Many-to-Many and Low-Resource Translation › Multilingual Neural Machine Translation

Michael BrenndoerferNovember 25, 20265 min read
Language AI HandbookAll chapters
Part 27 of 67Machine Translation and Speech Translation
Chapter 193Many-to-Many and Low-Resource Translation › Multilingual Neural Machine Translation
Reading section 3 of 11 · Multilingual Neural Machine Translation · 5 minSection 3 of 11 · 5 min

Section 3 of 11 · 5 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

Multilingual NMT models can share an encoder, a decoder, and a tokenizer across languages, as in Johnson et al.’s system. Some designs share most parameters and add language-specific layers, as in Fan et al.’s experiments. A language tag is a token that identifies the input language or specifies the requested output language. The same source string can be translated into different languages, so a model needs a way to tell which output is wanted.

Sharing parameters is what lets one model serve several directions. The encoder learns a common way to represent sentences, and the decoder learns a common way to generate them. When one language lacks data, the shared weights still carry information from languages that have plenty. The cost of sharing is interference: the same weights must serve structures that may have little in common, and gradients from one language can disturb another. The rest of this chapter is largely about managing that tension.

In Google's multilingual NMT experiments, Johnson et al. prepended a token for the requested target language to the source sequence, such as <2es> for Spanish. The shared encoder read the tag along with the source tokens, and the shared decoder conditioned on the resulting encoder states. Some source-to-target directions absent from direct training could be translated this way, a result known as zero-shot translation.

Language tags

The tag’s position and the language it identifies are separate choices:

  • Source-language tag on the encoder. Prepend the source language tag to the encoder input.
  • Target-language tag on the encoder. Prepend the requested target language tag to the encoder input.
  • Target-language tag on the decoder. Supply the requested target language in the decoder input.
  • Forced first generated token. Use generation controls to force the target-language tag after the decoder-start token.

Johnson et al.’s encoder-side prefix identifies the requested target. A decoder prefix supplies a token as part of the decoder input, while forcing the first generated token constrains the token chosen at generation time.

The NLLB example below sets the source-language tag in the tokenizer with src_lang. It then uses forced_bos_token_id to force the decoder’s first generated token after decoder start to be the target-language tag. M2M-100 also conditions on source and target language identifiers. Follow the source and target conventions in the instructions for the checkpoint you run.

Example language-tag placements and the language identity each tag encodes.
DesignEncoder inputDecoder inputLanguage information supplied
Source tag on encoder[fr] BonjourGuten TagSource language supplied to the encoder
Target tag on encoder[de] BonjourGuten TagRequested target language supplied to the encoder
Target tag on decoderBonjour[de] Guten TagRequested target language supplied to the decoder
Source tag on encoder and target tag on decoder[fr] Bonjour[de] Guten TagThe encoder receives the source language and the decoder receives the target language

A shared subword vocabulary lets identical subword units reuse the same token ID and embedding. Languages can also share encoder and decoder weights when their token inventories are disjoint. See Part V: Subword Tokenization for subword segmentation. With the model and sentence held fixed, a tokenizer that splits the text into more pieces gives the model more positions to process. A fixed vocabulary has a limited number of slots, so adding a unit for one group uses a slot that could have gone to another.

Zero-shot translation

Zero-shot translation evaluates a source-to-target direction that never appeared in direct training. Suppose you train on en→fr, en→de, fr→en, and de→en. You can then ask the model for fr→de and check the result. In Johnson et al.’s experiments, the model directly translated Portuguese to Spanish without Portuguese–Spanish training bitext.

A shared encoder and decoder can process a source and target combination that training never presented together. Johnson et al. visualized multilingual sentence representations that sometimes clustered by meaning, alongside clusters that reflected translation direction. The architecture gives the model a way to attempt an unseen direction.

The decoder can still produce output in the wrong language. A training mixture with many into-English examples gives the model extensive practice generating English. Measure target-language adherence separately from whether the translation preserves the source meaning.

Zero-shot directions need their own evaluation. Here are comparisons you can run with the same test sentences and decoding settings.

Evaluation checks for zero-shot translation under different training conditions.
Training conditionEvaluation check
Source and target seen in other directionsCompare the direct zero-shot output with a two-stage pivot baseline
High-resource source and targetMeasure both directions to check for asymmetric quality
Low-resource targetMeasure target-language adherence and meaning preservation separately
Target seen only as sourceCheck whether any training targets use the requested output language
Language tags are droppedCompare a tag ablation with the fully tagged model

You can test language-tag dropout, round-trip consistency, or balanced sampling against a baseline with the same training budget. Each changes a different part of the recipe. If direct bitext is available, compare a system trained on it with the zero-shot and pivot systems. M2M-100 supported 9,900 ordered translation directions across 100 languages and used training bitext for 2,200 directions. The NLLB project also mined parallel data for low-resource languages.

Plan the evaluation before deciding which directions to serve. Measure translation quality and target-language adherence on the directions that never appeared in training.

Zero-shot is not free

Compare zero-shot output with a pivot baseline and, where data permits, with a bilingual model. Report the results by ordered direction.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy