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

6 cards in “3.2 Byte Pair Encoding (BPE)” · whole deck

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.

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/