What is it?
Tokenization is the process of converting text into tokens.
A token can be a whole word, part of a word, punctuation, or another text unit, depending on the tokenizer.
A token is not always the same thing as a word.
Tokenization converts text into smaller units that a language model can process.
Tokenization is the process of converting text into tokens.
A token can be a whole word, part of a word, punctuation, or another text unit, depending on the tokenizer.
A token is not always the same thing as a word.
Puzzle pieces
Think of cutting a sentence into puzzle pieces before giving it to the model. The model works with those pieces, then uses them to understand the input and produce an output.
A chat message is split into token units before the language model processes it.
Input: “unbelievable”
System: A tokenizer may represent it as one token or several pieces, depending on the tokenizer.
Output: Token IDs sent into the model.
Tokenization: Uses a tokenizer’s rules to create model-readable units.
Splitting by spaces: Only separates text at spaces.
Token: May be a whole word, part of a word, punctuation, or another unit.
Word: A human language unit.
Tokenizer: Converts text into token pieces and IDs.
Language model: Processes those inputs to predict or generate text.
Explore next
Tokenization turns raw text into the token units a model can process.
A Tokenization explainer video is not available yet.