Skip to content

AI Glossary · Concepts

What is Tokenization?

Tokenization

Tokenization splits text into the chunks a model actually processes — tokens, which can be whole words, pieces of words, single characters or punctuation. It's why model limits and pricing are counted in tokens, and why 'a few paragraphs' is a fuzzy unit but 'tokens' is exact.

Also known as: tokens, tokenizer

· Updated · Chain of Thought

Model Architecture

  • 3 explainers
  • 8 episodes
  • 2 sources

A model reads tokens, the units a tokenizer cuts text into. Most modern tokenizers use subword methods such as byte-pair encoding, which keep common words whole and split rare ones into smaller pieces. So a common word may be a single token, while rare words, code, or other languages split into several, down to single characters. As a rough rule, a token is about three-quarters of an English word, but it varies a lot by content.

Tokens are the unit that actually matters in practice. Context windows are measured in tokens, API pricing is per token, and latency scales with how many tokens go in and come out. That’s why trimming a prompt or compacting context is a real cost and speed lever, and why text that looks short can be expensive if it tokenizes badly — dense code, unusual formatting, or non-English text all use more tokens than their length suggests.

See AI vocabulary in plain English for this term alongside the other language of models, data, agents, and infrastructure.

Sources

Go deeper

  • Hugging Face: Tokenization algorithms docs

    Work through the BPE and WordPiece merge examples, then compare them with Unigram. Inspect why different vocabularies and splitting rules produce different token boundaries.

From the conversation