GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
★ Read firstACL 2016

Neural Machine Translation of Rare Words with Subword Units

A 1994 compression trick, repurposed: merge the most frequent pair of symbols, again and again, until a fixed vocabulary covers every word. Where the tokens in your LLM bill come from.

Breakdown by FDE Interviews · 11 min read · Updated

About the original · 2015
AUTHORS
Sennrich, Haddow, Birch
FROM
University of Edinburgh
PUBLISHED
Aug 2015 · ACL 2016
CITED BY
9,288Semantic Scholar · Nov 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 25% of this breakdown.

01

The paper in one minute

Translation is an open-vocabulary problem: new names, numbers, compounds and inflections keep appearing. Neural translation models of 2015 read and wrote from a fixed list of 30,000 to 50,000 words. Anything else became an unknown token, and systems copied or looked up those words in a dictionary afterward. That fails for words that need to be built from parts, such as the German compound for "sewage water treatment plant", or names that must be transliterated into another alphabet.

Sennrich, Haddow and Birch represent words as sequences of subword units instead. Their main method adapts byte pair encoding (BPE), a 1994 compression algorithm. Start with every word in the training data split into characters plus an end-of-word marker. Count every adjacent pair of symbols, weighted by how often each word occurs, and replace the most frequent pair everywhere with a new merged symbol. Repeat. Each merge adds one symbol, so the vocabulary size is the number of characters plus the number of merges, the method's only setting. Frequent words end up as single symbols and rare words as a few known pieces, so no word is ever unknown.

At translation time, a new word is split into characters and the learned merges are applied in order. The model translates sequences of subword units, and pieces are joined back into words afterward. The authors also learn merges jointly on the source and target languages, so that names are split the same way on both sides, which helps transliteration.

On the WMT 2015 English to German and English to Russian tasks, models with subword vocabularies of 60,000 to 90,000 symbols beat a word-level model with a 500,000-word target vocabulary and a dictionary back-off, by up to 1.1 and 1.3 BLEU. The gains were concentrated in rare and unseen words, which make up 9% to 11% of the test words. BPE, in byte-level and other variants, became the standard way language models turn text into tokens.

THE IDEA, VISUALLY
LEARNING MERGES (SECTION 3.2, ALGORITHM 1) start l o w · | l o w e r · | n e w e s t · | w i d e s t · merge e s ... n e w es t · | w i d es t · merge es t ... n e w est · | w i d est · merge est · ... n e w est· | w i d est· merge lo, low low · | low e r · | ... word counts: low 5, lower 2, newest 6, widest 3 APPLYING THEM TO NEW WORDS (OUR MERGES) subword sub | word· transliteration trans | liter | ation· Abwasserbehandlungsanlage Ab w as ser be hand l un g s an l age· arXiv 1508.07909, University of Edinburgh, ACL 2016 GERMAN TRAINING TEXT BY SEGMENTATION (TABLE 1) vocabulary size (log scale) unknown tokens in test words 1,750,000 1,079 characters 3,000 0 char trigrams 120,000 59 compound split 1,100,000 643 Morfessor 544,000 237 hyphenation 404,000 230 BPE 63,000 0 BPE, joint 82,000 32 BPE keeps a small vocabulary with no unknown words; characters do too but make sequences 5x longer (550M tokens vs 112M for BPE).
Left: learning BPE merges on the paper's sample dictionary (our run of Algorithm 1), and how our merges learned from nine papers split new words. Right: Table 1, the German training corpus under each segmentation: vocabulary size on a log scale and unknown tokens in the test set.
Research notes: the problem, approach and results
0

unknown tokens in the German test text with a 63,000-symbol BPE vocabulary, against 1,079 for a 1.75M-word vocabulary (Table 1)

+1.1 / +1.3

BLEU over the back-off dictionary baseline for English to German and English to Russian ensembles (Tables 2 and 3)

1.52

symbols per word when our 4,000-merge BPE, learned on nine papers, encodes a tenth; a word vocabulary that size missed 22% of words

THE PROBLEM

Neural translation models in 2015 had fixed vocabularies of 30,000 to 50,000 words. Names, compounds and rare words became an 'unknown' token and were patched with a dictionary lookup, which cannot translate a German compound or transliterate a name into Russian.

THE IDEA

Split words into subword units learned by byte pair encoding: start with characters, repeatedly merge the most frequent adjacent pair across the training vocabulary, and stop after a chosen number of merges. Frequent words stay whole; rare words become sequences of known pieces.

THE RESULT

With no dictionary back-off, subword models improved over the dictionary baseline by up to 1.1 BLEU on English to German and 1.3 on English to Russian, and raised unigram F1 on rare words from 36.8% to 41.8% and 26.5% to 29.7%. BPE cut the German vocabulary to 63,000 types with no unknown tokens.

02

Why it matters to an FDE

Tokens are the unit you pay for and the unit that fills the context window. Every LLM API prices and limits by tokens, and those tokens come from a BPE-style vocabulary learned on the provider's data. When you estimate cost or check whether a contract fits in context, count tokens with the model's own tokenizer, not words.

The token count depends on the text. Common English words are one token; rare words, names, code identifiers, numbers and many non-English languages break into several. In our run, a vocabulary learned on nine papers needed 1.52 symbols per word on a tenth, and a German compound became 15 pieces. Budget per language and per document type.

Odd model behavior often traces to tokenization. Counting letters, comparing numbers, matching product codes or handling rare names can fail because the model never sees the characters as units. When a customer reports a strange error on identifiers or numbers, inspect the tokens.

Domain vocabularies can matter for your own models. If you train or fine-tune a small model on a specialized corpus, the tokenizer's merges reflect the text it was learned on. Heavy fragmentation of domain terms makes sequences longer and learning harder.

No unknown words is the design goal. Byte-level and character fallback mean modern models can read any input. They may still read it badly, but they will not drop it, which matters for names and IDs in customer data.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 290 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦2 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    The open-vocabulary problem, BPE, joint BPE, the segmentation comparison and translation results

    Free account
  2. 04How it works

    Merge learning step by step, applying merges, the baselines, and the translation setup

    Premium
  3. 05The numbers that matter

    Table 1's segmentations, Tables 2 and 3 by system, and the rare-word gains recomputed

    Premium
  4. 06Try it yourself

    Check the gains, run Algorithm 1 as printed, then learn BPE on real text and compare with words

    Premium
  5. 07Where it breaks

    Modest BLEU gains, a greedy segmentation, unseen characters, and long sequences for rare text

    Premium
  6. 08Using it on a deployment

    Count with the real tokenizer, budget per language, inspect tokens when IDs fail

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →