Neural Machine Translation of Rare Words with Subword Units

Sennrich et al., 2016, Neural Machine Translation of Rare Words with Subword Units (Proceedings of the 54th Annual Meeting of ACL (Volume 1: Long Papers))

Subscriber deck — free during early access

20 cards

1 Introduction

  1. What problem does subword NMT address?
    NMT models have a fixed vocabulary (typically 30,000–50,000 words), but translation is open-vocabulary, especially for languages with productive word formation like compounding and agglutination. Rare and unseen words were translated poorly.
  2. Why are back-off dictionaries a poor fix for rare words in NMT, according to Sennrich et al.?
    They assume a 1-to-1 correspondence between source and target words, which fails when languages differ in morphological synthesis (e.g. compounds), and word-level models can’t generate unseen words. Copying unknown words works for names only when no transliteration or morphological change is needed.
  3. What are the two main contributions of Sennrich, Haddow and Birch (2016)?
    Showing that open-vocabulary NMT is possible by encoding (rare) words as sequences of subword units, simpler and more effective than large vocabularies plus back-off dictionaries; and adapting byte pair encoding (BPE) to word segmentation.

3 Subword Translation

  1. Which kinds of words are “transparent”, translatable through units smaller than words?
    Named entities (copied or transliterated, e.g. Barack Obama in Russian or Japanese script), cognates and loanwords (claustrophobia → German Klaustrophobie), and morphologically complex words such as compounds (solar system → Sonnen|system).
  2. What did Sennrich et al. find when analyzing 100 rare German tokens?
    Most were potentially translatable from English through smaller units: 56 compounds, 21 names, 6 loanwords, 5 cases of transparent affixation, 1 number and 1 computer language identifier.

3.1 Related Work

  1. How does Sennrich et al.’s segmentation differ from segmentation used in phrase-based SMT?
    SMT segmenters (compound splitters, Morfessor) are conservative; subword NMT wants aggressive segmentation that gives open-vocabulary translation with a compact network vocabulary and no back-off dictionary, while keeping text sequences reasonably short.
  2. Why might variable-length subword sequences beat fixed-length character-based word vectors in NMT?
    With subwords the attention mechanism can focus on different units of a word at each step; a fixed-length vector per word (as in parallel work) is an information bottleneck, e.g. for a long compound like Abwasser|behandlungs|anlage.

3.2 Byte Pair Encoding (BPE)

  1. How does BPE learn a subword vocabulary?
    Start with the character vocabulary, each word a character sequence plus an end-of-word symbol. Repeatedly count all adjacent symbol pairs (weighted by word frequency, not crossing word boundaries) and merge the most frequent pair (A, B) into a new symbol AB. The number of merges is the only hyperparameter.
  2. Learn BPE merges from the word counts {low: 5, lower: 2, newest: 6, widest: 3}.
    Pairs are counted with word frequencies; ties go to the first pair found. The first five merges:
    #mergecounteffect
    1e + s9n e w es t·, w i d es t·
    2es + t9…est·
    3est + ·9…est·
    4l + o7lo w·, lo w e r·
    5lo + w7low·, low e r·
    (· marks the end of a word.)
  3. How is a learned BPE model applied to a new word?
    Split the word into characters (plus end-of-word marker), then apply the learned merges in order. Any word can be segmented into known symbols, so the vocabulary is open but fixed in size: with the merges above, the unseen lowest becomes low est·.
  4. What does the BPE vocabulary size equal, and what happens to frequent words?
    Initial characters plus the number of merge operations. Frequent words end up as single symbols (no shortlist of unsegmented words is needed), while rare words are split into frequent subword units.
  5. How does BPE differ from Huffman-style variable-length word encodings proposed for NMT?
    BPE symbols remain interpretable subword units (character n-grams), so the network can learn to translate and generate new, unseen words from them.
  6. What is joint BPE, and why did it help?
    Learning one set of merges on the union of source and target vocabularies, instead of separate encodings. It segments names and cognates consistently in both languages, making mappings easier to learn; for English–Russian the Russian side was transliterated to Latin script to learn the merges, then transliterated back.

4 Evaluation

  1. How were the subword NMT systems evaluated?
    On WMT 2015 English→German (4.2M sentence pairs) and English→Russian (2.6M), with BLEU, chrF3 (character n-gram F3), and unigram F1 measured separately for all words, rare words (outside the 50,000 most frequent) and OOVs (unseen in training), using an attention-based encoder–decoder.

4.1 Subword statistics

  1. How do segmentation schemes trade off vocabulary size and sequence length?
    Characters give a tiny vocabulary but 5.5× longer text; character n-grams and shortlists sit in between. Compound splitting, Morfessor and hyphenation reduce the vocabulary only moderately and leave unknown words. BPE (63k types) barely lengthens the text (112M vs 100M tokens) and leaves no unknown symbols.

4.2 Translation experiments

  1. What did subword NMT achieve compared with the back-off dictionary baseline?
    All subword systems (no back-off dictionary) beat the word-level baseline with back-off dictionary, especially on rare words (unigram F1 36.8 → 41.8% EN→DE, 26.5 → 29.7% EN→RU). Ensembles improved by 0.3–1.3 BLEU and 0.6–2 chrF3; joint BPE gave +1.3 BLEU for EN→RU.
  2. Why did subword models help much more on OOVs for English→Russian than for English→German?
    Copying unknown source words works well for German, since most OOVs are names in the same alphabet. Russian uses a different alphabet, so names must be transliterated, which subword models can learn and a copying dictionary can’t.
  3. Why might BLEU and chrF3 underestimate the gains of subword NMT?
    Rare and unseen words make up only 9–11% of test tokens, but they tend to carry central information in a sentence. BLEU also has a precision bias and chrF3 a recall bias, which explains some disagreement between them.

5.1 Unigram accuracy

  1. Why can a smaller vocabulary with more subword-coded words be better?
    Words with frequency ranks between 50,000 and 500,000 occur only 2–60 times in training, too sparse to learn as single units; subword units are less sparse. A model representing them as subwords was more stable than one keeping them as whole words.

5.2 Manual Analysis

  1. What did manual analysis show about subword NMT outputs?
    Subword systems learned compounding and transliteration, translating “health research institutes” correctly even with odd segmentations like Forsch|ungsinstitu|ten. Errors came from data sparseness (asinine) and inconsistent source/target segmentations, which joint BPE reduced.

Source

  • Rico Sennrich, Barry Haddow and Alexandra Birch. 2016. Neural Machine Translation of Rare Words with Subword Units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1715–1725. License: CC BY 4.0. Flashcards adapted from this work. doi:10.18653/v1/P16-1162 https://aclanthology.org/P16-1162/