LLMs

Tokenization

Tokenization converts text into a sequence of vocabulary identifiers.

"unbelievable!"split: un | believ | able | !IDs: 403, 12872, 481, 0
Tokenization converts text into a sequence of vocabulary identifiers. Values shown in the worked visual are illustrative unless the labels state otherwise.

How it works

The tokenizer defines the model’s input alphabet and how text length translates into compute. Its segmentation choices affect multilingual coverage and rare strings.

A concrete example

Illustrative: a 12-character identifier can become 1 token or 8 tokens under different vocabularies.

Do not confuse it with Embedding

tokenization chooses IDs; embedding lookup converts those IDs into vectors.

Study the full lesson