You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Understanding tokens is fundamental to building cost-effective AI applications. This lesson explains how tokenisation works, how to count and estimate costs, and how to work within rate limits.
Tokens are the fundamental units that language models process. A token is not the same as a word — it is a subword unit determined by the model's tokeniser.
| Text | Approximate Tokens |
|---|---|
| "Hello" | 1 token |
| "Hello, world!" | 3 tokens |
| "Tokenisation" | 2–3 tokens |
| "supercalifragilistic" | 5–6 tokens |
Rules of thumb:
Modern LLMs use Byte Pair Encoding (BPE) or similar subword tokenisation:
"unbelievable" → ["un", "believ", "able"] (3 tokens)
"AI" → ["AI"] (1 token)
"GPT-4" → ["G", "PT", "-", "4"] (4 tokens)
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.