Skip to content
bits
What is an LLM, really? · Lesson 3 of 9

Words become tokens

Tutor:

Last lesson said the model guesses one token at a time. So what is a token?

Tutor:

Before Claude sees your prompt, a tokenizer chops the text into pieces from a fixed menu. The menu is big (modern models carry on the order of a hundred thousand pieces) but fixed, chosen so that any text can be written from it. Each piece has an id number, and the numbers are all the model ever sees. It doesn't see the letters inside them.

tokenizerillustrative: made-up numbers that show the idea, not output from a real model8 tokens · 27 characters

Tutor:

The cuts and ids above are illustrative. Every model family has its own tokenizer, Claude's included, so real splits differ a little. Type your own text to see roughly where cuts land.

Tutor:

Three things to notice. Common words get one token each. Rarer words get split into familiar chunks. And the space usually sticks to the front of the next word.

Why should you care? Two reasons. Limits and prices are counted in tokens, not words. And tokens explain some odd mistakes: ask a model to count letters and it has to work from chunks like “straw” and “berry”, not from letters.

quick check+20 neurons
Tutor:

A model miscounts the r's in “strawberry”. What's the most likely reason?

    Type your answer or tap an option · Enter checks

    Tutor:

    That's enough tokens for now. The Tokens & temperature course goes deeper: counting them, weird splits, and how the odds turn into a choice.