passdrill
AI & LLM Engineering · How LLMs Work: Transformers & Training · Card 024/024 easy

Radford et al. (2019), "Language Models are Unsupervised Multitask Learners" (the GPT-2 paper), tokenize text using a byte-level variant of byte-pair encoding rather than applying BPE directly to Unicode characters. What problem does operating on bytes instead of Unicode characters solve?

  1. It allows the tokenizer to skip the merge-based vocabulary-building process entirely, since every byte value can be mapped directly to a token without any merges
  2. It increases the base vocabulary size well beyond 100,000 symbols before any merges are added, giving the model more starting granularity to work with
  3. It keeps the base vocabulary, before any merges, small and fixed at 256 symbols (one for every possible byte value), avoiding the far larger base vocabulary that applying BPE directly to Unicode characters would require, and letting the model assign a probability to any input without ever needing an unknown-token symbol
  4. It removes the need for any subword merging at all, since GPT-2 processes each byte independently as its own token throughout generation
Next card → Shuffle