What is a token in AI?
A token is a small chunk of text, often a word or part of a word, that an AI language model reads, counts and writes one at a time.
Rung 1 Explain like I'm 6
Think of a sentence as a LEGO model. Before a computer can play with it, it pulls the model apart into bricks. Some bricks are a whole word, like "love". Some are half a word, like "token" and "ization". Each kind of brick has a number painted on it, and the computer only ever looks at the numbers. When it talks back, it snaps bricks together one at a time until the sentence is built. Those bricks are called tokens.
Rung 2 High-school level
A token is the unit of text an AI language model reads and writes. A program called a tokenizer cuts text into tokens using a fixed list called the vocabulary, and gives each token an ID number. The model never sees letters, only these IDs.
Tokens are usually common words, pieces of rarer words, punctuation, or single characters. A space often sticks to the front of the next word, so " love" with its space is one token. As a rough guide for English, one token is about four bytes of text, which is about four letters [2].
Tokens matter to users for two reasons. AI services charge per token, for both what you send and what comes back. And every model has a context window: the most tokens it can handle at once, counting your input and its reply together. A token limit usually means a cap on one part, most often how many tokens the model may write in a single answer. So "context window vs token limit" is the size of the whole desk versus the size of one sheet of paper.
Rung 3 Undergraduate level
Most tokenizers today use byte-pair encoding (BPE), brought to language models in 2016 [1]. Training a BPE tokenizer works like this:
- Start with every single byte (or character) as its own token.
- Count every pair of neighbouring tokens in a large text corpus.
- Merge the most frequent pair into a new token, and add it to the vocabulary.
- Repeat until the vocabulary reaches the target size.
Frequent words end up as one token. Rare words fall apart into pieces that still exist in the vocabulary, so nothing is ever "unknown".
A real example, from OpenAI's cl100k_base tokenizer (run with tiktoken on 2026-11-18) [2]:
"I love tokenization" -> ["I", " love", " token", "ization"]
IDs -> [40, 3021, 4037, 2065]
Four tokens for three words. "tokenization" is split because the whole word was not frequent enough to earn its own entry. The word "unbelievable" becomes three pieces, and two tokenizers split it differently: un|belie|vable in cl100k_base and un|bel|ievable in o200k_base.
Inside the model, each ID picks one row of a big table of numbers, the embedding matrix. From then on the model works with those vectors, not with text.
Check yourself: Why does a BPE tokenizer never meet an "unknown word"?
Any word can be broken down into smaller pieces, all the way to single bytes, and every byte is in the vocabulary.
Rung 4 Graduate level
The main design choice is vocabulary size. OpenAI's cl100k_base has about 100,000 tokens and the newer o200k_base about 200,000 (counted with tiktoken, 2026-11-18) [2]. A bigger vocabulary makes sequences shorter, which saves compute and fits more text in the context window. The cost is a bigger embedding and output layer, and rare tokens that get few training examples.
Language coverage shows the trade-off clearly. The Hindi phrase "नमस्ते दुनिया" ("hello world") takes 13 tokens in cl100k_base but 5 in o200k_base (our count, 2026-11-18). Across tokenizers, the same text translated into different languages can differ in length by up to 15 times [3]. Since price, speed and context are all counted in tokens, speakers of under-represented languages pay more and get less room.
Tokens also explain some odd failures. " strawberry" is a single token in both OpenAI tokenizers above, so the model never directly sees its letters. Counting the r's means recalling spelling facts, not reading them. Numbers split into chunks that do not line up with place value, which makes arithmetic harder.
Context window versus token limit, with real numbers: Current Claude models (November 2026) have a 1-million-token context window, but a single reply is capped at 128,000 output tokens [7].
Check yourself: Why can a bigger vocabulary make a model cheaper to run on long text?
The same text becomes fewer tokens, so the model does fewer steps and attention covers a shorter sequence.
Rung 5 PhD level
Tokenization is lossless compression chosen before training and then frozen. BPE [1] is greedy: it merges by frequency, not by what helps the model predict. Alternatives such as the unigram language-model tokenizer (Kudo, 2018) pick segmentations probabilistically, but every subword method shares the same problem. The tokenizer is not learned end to end with the model, so its mistakes are baked in.
Known costs include:
- Unfairness across languages and scripts, measured as up to 15x length gaps [3].
- Brittle arithmetic and spelling, because digit and letter boundaries are hidden inside tokens.
- Under-trained tokens: entries that appear in the tokenizer's corpus but rarely in the model's training data, which can trigger strange behaviour.
- Sensitivity to noise: a typo can turn one familiar token into several unfamiliar ones.
The obvious fix is to drop tokenizers and model raw bytes. Byte-level models such as ByT5 (2021) work, but since a token averages about four bytes [2], sequences get roughly four times longer, and attention cost grows faster than length. The research question is how to spend compute where text is hard and save it where text is predictable.
Open problems: choosing vocabulary size from first principles, making tokenization learnable, measuring how segmentation affects reasoning, and tokenizing many languages fairly in one fixed budget.
Rung 6 State of the art: what experts work on now
Last checked 18 November 2026.
The biggest research shift is away from fixed tokens. Meta's Byte Latent Transformer (December 2024, published at ACL 2025) groups raw bytes into patches whose length depends on how hard the next byte is to predict. In the first FLOP-controlled scaling study of byte-level models, up to 8B parameters and 4T training bytes, it matched or beat tokenizer-based models and was more robust to noisy input [4].
Context windows, counted in tokens, kept growing. Llama 4 Scout (April 2025) claims a 10-million-token window, though it was trained at 256K tokens and relies on length generalization beyond that [5]. Claude Opus 4.6 (February 2026) launched a 1-million-token window in beta, with prompts over 200K tokens billed at a higher rate [6]; by November 2026 Anthropic's docs list 1M as the standard window for current models, with up to 128K output tokens [7]. Tokens are now the unit of price, of memory and of product limits at once.
Tokenizers themselves grew. OpenAI's move from about 100K to about 200K entries [2] shortened many non-English texts. Our own Hindi test went from 13 tokens to 5. The language-fairness gap [3] is narrowing but has not closed.
Sources
- Sennrich, Haddow, Birch: Neural Machine Translation of Rare Words with Subword Units (2016)
- openai/tiktoken: a fast BPE tokeniser for use with OpenAI's models (2025)
- Petrov et al.: Language Model Tokenizers Introduce Unfairness Between Languages (2023)
- Pagnoni et al.: Byte Latent Transformer: Patches Scale Better Than Tokens (2024)
- Meta AI: The Llama 4 herd (2025)
- Anthropic: Introducing Claude Opus 4.6 (2026)
- Claude API docs, Context windows (2026)