Loading slide

Tokens

  1. 01Tokens
  2. 02Memory card
  3. 03The model can't read
  4. 04Not words. Tokens.
  5. 05The emoji trick
  6. 06Try it yourself
  7. 07How many r's in strawberry?
  8. 08What the model actually sees
  9. 09Some languages cost more
  10. 10Why "cat" and " cat" differ
  11. 11Why not millions of tokens?
  12. 12So why not just use bytes?
  13. 13Context windows are measured in tokens
  14. 14Reinforce your understanding
  15. 15Question: Why not just use words?
  16. 16Question: Weird splits
  17. 17Quiz: answer
  18. 18What to carry out of this chapter
  19. 19Want to go deeper?
5 / 18
BackNext

The emoji trick

Here is a way to feel what tokenization does. Imagine replacing every token in a sentence with a unique little symbol.

"The cat sat on the mat" might become: 🌀 🎯 🍄 🔮 🌀 🎲

That is closer to what the model receives. Not words. A row of symbols, each one a stand-in for a chunk of text, each with its own ID number underneath. The model has no idea these symbols were ever language. To it, they are just abstract markers.

Notice that "the" shows up twice and gets the same symbol both times. That consistency is the point: every time that fragment appears, anywhere in any text, it becomes the exact same token with the exact same ID. The model's entire world is built from a fixed alphabet of these markers, tens of thousands of them, and nothing else.

Hold onto this picture. What the model does with these symbols, how it learns which ones tend to follow which, is the heart of a later module. For now, the key shift is this: the words you see and the symbols the model sees are not the same thing.

Citations(2)↓
  1. 1. huggingface.co
  2. 2. github.com
Citations(2)↓
  1. 1. huggingface.co
  2. 2. github.com