Tokenization Basics
PremiumWhy tokenization? From character-level to subword-level, with Unicode and UTF-8
Why Tokenization
The core of an LLM is the Transformer, which processes sequences of numbers, not text. So the question is: how do we convert text into numbers the model can understand?
Tokenization solves this. It converts text strings into integer sequences (tokens). These integers index into an embedding table to obtain vector representations, which are then fed into the Transformer.

Tokenization looks simple, but it is the root of many “weird” LLM behaviors. For example:
- Why does GPT sometimes struggle with character-by-character spelling?
- Why is performance worse in some languages than English?
- Why is the model unusually sensitive to certain strings?
These issues can often be traced back to tokenization design.
Log in to continue reading
This is premium content. Please log in to access the full article.
CookLLM Docs