Skip to main content

Subword Tokenization

Subword Tokenization

  • Core concepts
  • Stage 4 · Under the Hood
  • refs checked 2026-11-19
What problem it solves

Cuts words into smaller fragments so a model can still assemble words it has never seen.

What it is
The dominant scheme is BPE: start from characters, repeatedly merge the most frequent adjacent pairs into a subword inventory. It eases the out-of-vocabulary problem — a whole word may miss the vocabulary, but its fragments usually are in it.
Text is split into subword pieces and mapped to integer IDs; unseen words are broken into known pieces.
Text is split into subword pieces and mapped to integer IDs; unseen words are broken into known pieces.
Why it matters

When a model splits a rare word into odd fragments, it is not "failing to recognize" it — subword tokenization is at work. Vocabulary size and merge rules together decide how friendly a model is to Chinese and code.

Sources
  • Neural Machine Translation of Rare Words with Subword Units (paper) ↗
  • Hugging Face NLP Course: Tokenizers chapter ↗
Use this term in a task

Don’t stop at the definition: use the task handbook for the order and checks, or filter three tool candidates for the job at hand.

Task handbooks → · Filter three candidates →