Skip to content
Notes on AIE012Act 2 — Behavior & Limits

Tokenization

E012 · by — AI Strategist, Practitioner & Educator · Founder, AI Center of Excellence

Show how tokenization explains strange behavior with numbers, emojis, and languages.

Full Explanation

Tokenization is the process of turning raw text into tokens before an AI model processes it. It is preprocessing, not thinking — the model only sees the resulting pieces.

Tokenization is learned from training data, not designed by hand. It balances compression (efficient reuse of common patterns) and flexibility (representing rare words, new terms, different languages, and typos via subwords).

It is model-specific: different models use different tokenizers, so the same sentence can become different tokens and different counts. This explains why limits, costs, and odd behavior with numbers, emojis, or languages vary between providers.

Tokenization has nothing to do with meaning — the tokenizer only cuts text. A useful mental model: tokenization is the scissors; the model is the brain. Once you see this step, differences between models start making sense.

Transcript

Read every word ↓

Before AI reads your message, it first cuts it into pieces. When you send a message to a model, something happens before the model even starts thinking about it. Your text gets cut into pieces, and this process is called tokenization. Tokenization is the process of turning raw text into tokens. Before an AI model can do anything about your message before it predicts, reasons, or generates text, your input first goes through this tokenization process. This step happens every single time you send a prompt. At a very high level, text goes in, tokenization happens, tokens come out.

And only then does the model start working. So tokenization is not thinking, it's not understanding, it's more like pre-processing. You can think of it as cutting the text into pieces that the model knows how to handle. An important point to mention, tokenization is learned and not manually designed. During the training process, models are exposed to massive amounts of text data. From this data, a tokenizer learns which character sequences appear frequently and which pieces of text can efficiently be reused. As a result, the tokenizer builds a vocabulary that balances two things, compression and flexibility.

Compression so that common patterns don't waste space and flexibility so that new or rare words can still be represented by the tokenization. This is why tokenization usually works on subwords rather than full words. If a word is very common, it might exist as a single token. If a word is rare or completely new, it can be split into smaller parts that the model already knows. This allows models to handle new names, technical terms, different languages, and even typos without needing to relearn language from scratch. And now a very important detail.

Tokenization is model-specific. Different models use different tokenizers. That means that the same sentence can be split into different tokens depending on the model. As a result, the same text may produce a different number of tokens in different models, even though the text itself is exactly the same. This is also why token counts, limits, and costs can vary between providers. And another key point. Tokenization has nothing to do with meaning. The tokenizer doesn't know what a sentence means. It doesn't understand context, intention, or truth. It simply applies learned rules to break text into pieces.

Meaning only emerges later inside the model when it processes the sequence of tokens and tries to predict the next one. So a useful mental model is this. Tokenization is like a pair of scissors. It cuts the text into pieces. And the model itself is the brain. Tokenization decides how the text enters into the system, and tokens decide what the system actually works with. And that's why understanding tokenization helps to explain why different models behave differently, even when you give them exactly the same problem. This was a Note on AI for today.

Thank you for watching, and I'll see you in the next one. Bye.

Resources

No dedicated resources for this episode yet.

Browse the resource library →

More from Act 2 — Behavior & Limits

Newsletter

Found this useful?

Join the newsletter. You get one e-mail when something new and useful is out: a video, a guide, a tool. No spam, no schedule, and you can leave with one click.

Alexey Makarov

Alexey Makarov

AI Strategist, Practitioner & Educator. Founder & Global Lead of the AI Center of Excellence at SEFE. Creator of the Unreasonable AI YouTube channel. Based in Berlin.

About Alexey →