passdrill
AI & LLM Engineering · How LLMs Work: Transformers & Training · Card 004/012 medium

Sennrich et al. (2016), "Neural Machine Translation of Rare Words with Subword Units," introduced byte-pair encoding (BPE) as a tokenization method for handling rare and out-of-vocabulary words. How does the BPE algorithm build its subword vocabulary?

  1. It assigns a fixed-length numeric code to each whole word in a predetermined dictionary, discarding any word not already present in that dictionary
  2. It randomly samples character sequences of varying length from the training corpus until a target vocabulary size is reached
  3. It splits text purely along whitespace and punctuation boundaries, performing no further segmentation within a word
  4. It starts from individual characters and repeatedly merges the most frequent adjacent pair of symbols into a new symbol, learning a fixed number of merge operations to build a subword vocabulary
Next card → Shuffle