Ep. 02 — How an AI "reads": what are Tokens (without mathematical formulas)
Yesterday we left our agent in front of a written sentence. It has no eyes, no ears. And yet it "reads". How?
The short answer: it doesn't read letters, nor whole words. It breaks everything into building blocks called tokens.
The Lego Analogy
Imagine having to build any sentence in the world using a box of Lego bricks. You don't have bricks for every possible word (there would be billions). Instead, you have a limited set — say 50,000 pieces — covering syllables, word fragments, common words, punctuation, spaces.
When the agent receives "Ciao mondo", it doesn't see "C-i-a-o space m-o-n-d-o". It sees two bricks: [Ciao] and [ mondo] (note: the space often travels attached to the next piece).
A Concrete Example in Italian
Let's try with a single word: "intelligenza" (intelligence).
A real tokenizer (like GPT-4's) splits it like this:
| Original text | Pieces (tokens) | Approximate IDs |
|---|---|---|
| intelligenza | int + ell + igenza | 3 tokens |
Three bricks for a single word. If you counted letters, you'd say "12 characters". The agent counts: "3 tokens".
And that's why models count letters poorly: they don't see them at all. They only see the bricks.
Why It Matters to You (Wallet and Memory)
Every brick costs. When you pay for an API "per token" or fill the "context window" (the agent's short-term memory), you pay per brick, not per word.
- "Ciao" = 1 token
- "Intelligenza" = 3 tokens
- "Supercalifragilistichespiralidoso" = who knows how many (try to guess: lots of tiny pieces come out)
The more "jagged" the language (Italian, German, Finnish), the more bricks needed to say the same things. In English — the native language of almost all models — words often stay whole: 1 token ≈ 1 word. In Italian: 1 word ≈ 1.5–2 tokens on average.
The Brick Dictionary (Vocabulary)
That set of 50,000–100,000 pieces is called the vocabulary. It's fixed, decided during training. The agent cannot invent new ones on the fly. If it encounters a never-before-seen word ("Silicea", "Xyzzy", a tax code), it splits it into known pieces until it reconstructs it: Sil + ice + a.
Where We Stop Today
Okay, now we know how it reads: in bricks. But if the agent only sees statistical pieces... how does it choose the next brick? And why does it sometimes invent things with total confidence that are completely false?
We'll see tomorrow. 👉 progettosiliceo.online/tutorial-agenti.html — Ep. 03: Why AI Sometimes Hallucinates: Probability, Temperature and Context Window
🧱 Community Extra (reply to @byte.aster.arca): Want to see the exact same sentence in Italian vs English measured across 5 real 2026 tokenizers (GPT-6
o200k_base, Qwen 3.8, Gemma 4, Ministral 3, and Emma-6)? 👉 Read Ep. 02-bis — Italian vs English on real 2026 tokenizers