Skip to content

Neural Machine Translation of Rare Words with Subword Units

Skip →Chinchilla (compute-optimal)
main track #1LLM main #2extendedfundamentalpaperrubric 8/122016 · ACL 2016 · ~25 min

Rico Sennrich, Barry Haddow, Alexandra Birch

Status

TL;DR. Neural translation models in 2015 used a fixed word vocabulary and mapped rare words to an unknown token. Sennrich et al. instead segment words into subword units learned with byte-pair encoding (BPE): start from characters and repeatedly merge the most frequent adjacent pair. Rare words, names and compounds are then translated piece by piece, with no unknown tokens. This is the ancestor of the BPE tokenizers used by most LLMs.

  1. Split every word into characters plus an end-of-word marker.
  2. Count adjacent symbol pairs, weighted by word frequency (pairs do not cross word boundaries).
  3. Merge the most frequent pair into a new symbol and repeat.

The final vocabulary size is the number of characters plus the number of merges, which is the only hyperparameter. At test time, the learned merges are applied in order to any word. In the paper’s toy example, merges learned from {low, lowest, newer, wider} segment the unseen word “lower” as “low er·”.

Results. On WMT15 English→German and English→Russian, subword models beat a back-off dictionary baseline by up to 1.1 and 1.3 BLEU. The authors also find subword models translate rare words more accurately than large-vocabulary models with back-off dictionaries. The segmentation statistics (Table 1) use 59,500 merges for separate BPE and 89,500 for joint BPE. Compared with character-level input, BPE gives shorter sequences and lets attention work over variable-length units.

  • SentencePiece — makes BPE language-independent and lossless by treating whitespace as a symbol.
  • Attention Is All You Need — uses BPE vocabularies for its translation experiments.
  • BERT — WordPiece, a close variant, is used by most BERT-based retrievers.
  • ColBERT — token-level matching over subword units.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    Run BPE by hand on the paper's Algorithm 1 vocabulary {low: 5, lower: 2, newest: 6, widest: 3}, with an end-of-word symbol </w>. Compute the initial pair counts, carry out the first five merges (breaking ties by first occurrence), and show how the unseen word "lowest" is then segmented.

    What a strong answer covers
    • Initial counts: e s, s t and t </w> are 9 (newest 6 + widest 3); w e is 8 (lower 2 + newest 6); l o and o w are 7; n e and e w are 6.
    • Merges: (e, s) → es; (es, t) → est; (est, </w>) → est</w>; (l, o) → lo; (lo, w) → low. Each merge adds one symbol, so the vocabulary is characters plus number of merges.
    • "lowest" becomes l o w e s t </w> → … → low est</w>: two known subwords and no unknown token.
    • The tie at 9 shows that merge order can depend on implementation details, which changes segmentations for rare words.
  2. Mechanism

    The paper learns joint BPE on the concatenated source and target text, and for English–Russian it first transliterates Russian into Latin script. Explain why joint learning and transliteration help a translation model copy names and cognates correctly.

    What a strong answer covers
    • With separate vocabularies, the same name can be split differently on each side, so the model must learn a mapping between unrelated segment sequences.
    • Joint BPE produces the same segmentation for strings that occur on both sides, which makes copying a near-identity mapping.
    • Russian in Cyrillic shares no characters with English, so joint merges cannot align; transliterating with ISO-9 makes shared names look the same during learning. The merges are then mapped back to Cyrillic.
    • This mirrors why multilingual LLM tokenizers share a vocabulary across languages and scripts.
  3. Connect

    Subword tokenization also matters in retrieval: BM25 over whole words, WordPiece inside BERT-based retrievers, and learned sparse models that put weights on subword vocabulary terms. Explain how the merge budget trades off vocabulary size and sequence length, and what goes wrong for rare domain terms (gene names, product codes) in each setting.

    What a strong answer covers
    • More merges give longer, more word-like units and shorter sequences, but larger embedding tables and fewer training examples per unit.
    • A rare term split into many short pieces is longer and its pieces are shared with unrelated words, which blurs its meaning in a dense model.
    • Learned sparse retrieval puts weights on vocabulary units, so a rare term split into common pieces may match unrelated documents; exact-match BM25 over full words does not have this problem but cannot handle variants.
    • Options: domain-specific merges, keeping a word-level index alongside the model, or adding frequent domain terms to the vocabulary before training.

Done with this page?

Status