๐ Modern Approach โ Tokenization

๐จ Spaces Are Part of the Token Too!
Here's something surprising โ tokens don't just capture the word itself, they often include the space before it as well! ๐คฏ
" important" โ notice the space at the front ๐
This tells the model two things at once:
๐ A new word is starting here
๐ฌ That word is "important"
๐งฉ Where a Token Appears Matters
The same word can be tokenized differently depending on where it sits:
Type | Example |
|---|---|
๐ข Start of a word |
|
๐ต Fragment inside a word |
|
๐ Take "unimportant" for example:
โun+important(fragment)
๐ก Why This is Clever
By tracking spaces and positions, the model can understand word structure more naturally โ recognizing roots, prefixes, and how words connect to each other. ๐ง
๐ Rare Words Get Broken Into Pieces

Uncommon words don't get their own token โ instead, they're split into smaller, familiar fragments the model already knows. ๐งฉ
๐ฌ "exquisitely" โ
ex+quis+ite+ly
๐ง Why This is Smart
Rather than learning every rare word from scratch, the model reuses its knowledge of:
๐ Prefixes
๐ Suffixes
๐ Common fragments
This leads to faster learning โก, sharper pattern recognition ๐ฏ, and a leaner vocabulary ๐ฆ.
๐งฑ Real Word Examples
Word | Token Split |
|---|---|
๐คฒ handcrafted |
|
๐ง witchcraft |
|
๐ masters |
|
๐ก Worth Noting
Fragment tokens like crafted typically don't carry a leading space โ a subtle signal that they're the middle or end of a word, not the start of a new one.
๐ข Numbers Are Also Tokenized

Numbers aren't special โ they get chunked just like words!
๐ฌ 3.141592653589793 โ
3.+141+592+653+589+793
๐ก Fun fact: GPT vocabularies include tokens for every number from 000 to 999 โ meaning any 3-digit number is just one single token. ๐ฏ
๐ค Why Old GPT Models Struggled at Math
Problem Type | Difficulty |
|---|---|
๐ข 3-digit math | Easier |
๐ด 4-digit math | Harder |
Larger numbers split across multiple tokens, making relationships harder to learn. Modern models handle this much better. โ
๐ Token-to-Word Ratio
A handy rule of thumb:
๐ค 1 token โ 4 characters or 0.75 words
Tokens | Approx Words |
|---|---|
1,000 | ~750 words |
1,000,000 | ~750,000 words |
๐ The Complete Works of Shakespeare (~900,000 words) is roughly 1.2 million tokens โ a popular benchmark for understanding token scale.
๐ฐ Tokens Have a Real Cost
AI APIs charge based on input and output tokens. Understanding tokens helps you:
๐ต Estimate API costs
๐ Manage context window usage
๐ง Stay within model limits
โ ๏ธ Code Uses More Tokens
Programming and technical content is token-heavy due to:
๐ก Uncommon variable names
๐ฃ Dense symbols and syntax
๐ฆ Compressed expressions
const userAuthenticationHandler = ...can split into many fragments ๐ฌ
๐งช Try It Yourself!
Play around with tokenizer tools to:
โ๏ธ See how text splits
๐ Compare different models
๐งฎ Estimate token counts
This builds real intuition for prompt engineering ๐ ๏ธ, cost optimization ๐ฐ, and context management ๐ง .