Before an AI model reads a word, your text is cut into small numbered pieces. Here is how that works, in plain language.
Your text is cut into small pieces called tokens, and each piece becomes a number. Pick a way to split, then step through a whole sentence.
Token IDs here are illustrative. Every model has its own list, so the same piece gets a different number elsewhere.
You could split on spaces, but the model would then need a separate number for every word it has ever seen, including misspellings, slang and every language. That is millions of entries. A smaller, smarter list of pieces works better.
| Split | How it cuts | “procurement” | Trade-off |
|---|---|---|---|
| Word | One token per word | procurement | Simple, but a huge list, and new words break it |
| Subword | Meaningful pieces | procure + ment | Best balance, and used by most modern models |
| Character | One token per letter | p r o … | Tiny list, but very long sequences |
| Byte | Raw computer codes | 112 114 111 … | Copes with any language, but sequences get long |
Why subwords win. “Procure”, “procurement” and “procuring” share a root, so a subword list can reuse the same piece for all three.
The tokenizer starts with single letters, finds the pair that appears together most often, and glues it into one piece. Press Play and watch it repeat.
No merges yet. Press Play to start.
The textbook example. Start from low lower newest widest, with ▁ marking the end of each word. One possible run: e + s becomes es, then es + t becomes est, then l + o becomes lo, then lo + w becomes low. Several pairs tie on count, so the order you see in the playground may differ.
Nothing here knows English. “low” and “est” emerge purely because those letters keep appearing together.
Learning happens once. The merge rules are learned from a very large body of text before the model is trained, then saved and fixed. The playground above shows that learning step on a tiny sample.
Everyday use is a lookup. When you send a prompt, your text is split into letters and the saved rules are applied in order. No new rules are discovered. A real tokenizer has tens of thousands of entries, so common words like “vendor” and “contract” are usually single tokens, unlike in this small demo.
A model can only read so much at once, and tokens are how that room is counted. The same facts take more or fewer tokens depending on how you write them.
Try your own text
Rule of thumb for English: one token is about 4 characters, or about three quarters of a word. Estimates here use that rule. Real counts depend on the model’s own tokenizer.
| Content | Rough size |
|---|---|
| A short question (“Review this proposal”) | about 5 tokens |
| A paragraph of vendor data (10 lines) | about 150 tokens |
| A prompt template with instructions | about 400 tokens |
| A full eight-section assessment | about 800 tokens |
About prices. What a token costs depends on how a model is accessed and changes over time, so this page does not quote prices. For questions about limits or usage in Amazon Quick, ask your DNA / IT team.
Every message follows this path. The tokenizer comes first, so everything after it depends on how your text was split.
Pieces, IDs and numbers shown here are illustrative.
Three ways to build the list of pieces
| Method | Direction | How it chooses | Used by |
|---|---|---|---|
| BPE (Byte Pair Encoding) | Bottom-up: merge | The most frequent pair | GPT-family and LLaMA models |
| WordPiece | Bottom-up: merge | The most likely pair (probability) | BERT |
| Unigram | Top-down: prune | Removes the least useful pieces | T5 |
The same text can give different token counts on different models, which changes how much fits in one request.
Every list also holds a few reserved tokens with special jobs.
| Token | Purpose |
|---|---|
[PAD] | Fills short inputs so a batch has equal lengths |
[UNK] | Stands in for a piece not found in the list |
[CLS] | Marks the start of an input (BERT-specific) |
[SEP] | Separates two segments of text |
[MASK] | Hides a token for the model to predict during BERT training |
How text representation evolved. Each step fixed a limit of the one before.