AI Video Academy · Token Intelligence · beginner

How Does Tokenization Work?

From text to subword pieces to token IDs, with a real tokenizer.

1:02 · captions in English · instrumental music, no narration

Transcript

How does text become numbers a model can read?

Text is pre-split, merged into known pieces, and mapped to token IDs.

BPE training merges the most frequent neighbouring pairs into new tokens, again and again.

Frequent words become one token; rare words split into several pieces.

Scripts with less training data get fewer merges, so the same idea needs more tokens.

WordPiece, SentencePiece, and Unigram reach the same goal with different rules.

Tokenizers are learned from data and fit their training text best.

Experiment with this concept in PromptFlowEngine.