Tokenization
From Text to Tokens
Learn how language models break down text into pieces they can understand.
Try It Out
Hello,world!Thisistokenization.
What is Tokenization?
Tokenization is the process of breaking down text into smaller pieces called tokens. These tokens can be words, subwords, or even characters. Language models process tokens rather than raw text, making tokenization a crucial first step.
🔤
Types of Tokenization
Word-based: Split by spaces and punctuation. Simple but creates large vocabularies.
Subword (BPE): Breaks words into common subwords. Used by GPT-2, BERT.
Character-based: Split into individual characters. Small vocabulary but long sequences.
Example: BPE Tokenization
Input:"unhappiness"
Tokens:["un", "happiness"]