Tokens
An LLM doesn't read letters, or even words — it reads 'tokens'. It's also why it can't reliably spell 'strawberry'.
We've said a model “predicts the next word.” That was a white lie. It predicts the next token— and that small distinction explains some of AI's strangest quirks.
Before a model can turn words into the vectors from earlier, it has to chop your text into units. It doesn't split on spaces, and it doesn't go letter by letter. It uses a fixed dictionary of tokens: common words are usually a single token, while rarer words get broken into familiar pieces. Type something and watch the chopping happen:
Tokenizer Playground
Type, or try the chips below
Notice how strawberry splits into straw + berry— the model never sees the letters s-t-r-a-w-b-e-r-r-y in a row, which is exactly why it fumbles questions like “how many R's are in strawberry?”
Start with strawberry — it splits into straw + berry. A plain sentence is mostly one-token words. tokenization becomes token + ization. And the emoji alone eats several tokens. Keep an eye on the token count versus the character count.
Why chop it up this way?
The dictionary is built by a method called byte-pair encoding: start from single characters and keep merging the most common pairs across a giant pile of text. Frequent words end up as one token; anything unusual falls back to known fragments, and worst case, to single letters. It's a clever balance between “a token for every word” (too many) and “a token for every letter” (too slow).
A language model's entire world is a stream of tokens drawn from a fixed vocabulary (often ~100,000 of them). It predicts the next token, never the next letter — which is exactly why letter-level tasks like “count the R's in strawberry” or rhyming or reversing a word are weirdly hard for it. It literally can't see the letters inside a token.
Tokens are also the unit of money and memory. APIs bill per token, not per word, and a model's “context window” (coming up later) is measured in tokens. Languages that the tokenizer wasn't optimised for can cost two or three times as many tokens for the same sentence — a quiet, real-world unfairness baked into the dictionary.
Tokens are the raw material an LLM is made of. But a model that merely predicts the next token is just a rambler — it'll happily continue your text without ever answering you. So how did that raw predictor become a helpful, polite assistant? That transformation is the rest of this chapter.
Feel like you get it?
Continue to “Fine-Tuning” →