Tokens: How Models Read Text
A language model never sees characters or words. It sees a sequence of integers — token IDs — drawn from a fixed vocabulary, typically 32k–200k entries. Everything about cost, context length, multilingual quality and even some famous failure modes ("how many r's in strawberry?") traces back to this step.
In this lesson
- Why not characters or words?
- Byte-Pair Encoding (BPE)
- Pre-tokenization
- Consequences that matter in practice
- Hands-on: count tokens
This lesson is part of AI Engineering. Unlock the full course to read it, take the quiz and track your progress.