Code Safari

Chapter 21·Beginner

Tokens in LLMs: How AI Reads, Counts, and Bills Text

01 / 06

What a token is

The model's unit of text — usually a word-piece.

Before an LLM sees anything, your text is split into tokens: often whole words, sometimes fragments. The model only ever works with tokens, never raw letters.

Tokens in LLMs: How AI Reads, Counts, and Bills Text | Code Safari