Chip Foundry Services Request Assessment

Token

A token is the integer ID a tokenizer assigns to a chunk of text, and it is the only unit a language model ever actually sees — not words, not characters, just a sequence of numbers looked up against a fixed vocabulary. A token can be a whole common word, a word fragment, a single character, a punctuation mark, or a byte, depending on how the tokenizer segments text; "unbelievable" might become one token in a huge vocabulary or three subword pieces ("Un", "believ", "able") in a smaller one. This matters well beyond vocabulary trivia: token count directly sets attention cost, KV-cache memory, context-window limits, training batch size, and API billing, so two sentences that look similarly long in English can cost meaningfully different amounts to process depending on how their words happen to tokenize.

Token Pipeline
Raw text to a vector the model can compute on
Raw text
"Unbelievable pre-training"
Tokenizer
Segments into subword pieces
Vocabulary lookup
Each piece → integer ID
Embedding + position
ID → dense vector the model reads

Byte-Pair Encoding (BPE) is the dominant tokenizer family, and the reason it won out is almost entirely economic. BPE starts with individual characters and iteratively merges the most frequent adjacent pair into a new vocabulary entry, repeating until it reaches a target vocabulary size (commonly 30,000-100,000+ entries) — so a common word like "the" gets its own single token while a rare or made-up word gets split into several smaller pieces it can still represent. Byte-level BPE (used by GPT-style models) operates on raw bytes rather than Unicode characters specifically so that *any* input — emoji, unusual Unicode, malformed text — can always be represented, trading a slightly longer token count for the guarantee that nothing is ever truly "unknown." SentencePiece and WordPiece solve the same underlying problem with different merge criteria and are common in encoder-style and multilingual models.

TokenizerCore mechanismMain strengthMain limitation
BPEMerge frequent adjacent pairsSimple, efficient subwordsFrequency bias toward training data
Byte-level BPEBPE over raw bytesNever produces an unknown tokenSlightly longer sequences for rare scripts
WordPieceLikelihood-maximizing mergesMature, used in BERT-family modelsTraining procedure is implementation-specific
SentencePiece (Unigram)Probabilistic piece inventory, prunedWorks without a pre-tokenizer; language-agnosticTraining is slower than BPE
Character-levelOne token per characterSimple, transparent, zero unknownsSequences get very long, very fast

Tokenization is also where some of the most confusing LLM behavior actually comes from. English prose tokenizes at roughly 0.7-1 token per word on most modern tokenizers, but this ratio is not stable across languages or content types — non-English languages, especially those with large character sets like Chinese or Japanese, routinely use 2-3x more tokens for the same semantic content purely because the tokenizer's vocabulary was trained predominantly on English text, which translates directly into non-English users paying more and getting less usable context per message on the exact same API. Numbers and code tokenize unevenly too: a model that seems to struggle with basic arithmetic is often struggling because multi-digit numbers get split into inconsistent token chunks ("1234" might become "123"+"4" in one context and a single token in another), not because it fundamentally can't add.

Production systems treat the tokenizer as part of the model's identity, not an interchangeable preprocessing step. A model and its tokenizer are trained together, and using a mismatched tokenizer at inference — even one that looks similar — produces token IDs that are syntactically valid but map to the wrong vocabulary entries entirely, silently corrupting the model's input with no error thrown. This is why serving infrastructure pins the exact tokenizer file and version alongside the model checkpoint, and why changing a model's chat template (the special tokens that wrap a conversation into the format the model was trained on) without updating token-counting logic is a common, hard-to-spot source of truncated context or broken multi-turn conversations in deployed chat systems.

Read token accounting the way this site reads interconnect bandwidth in a GPU cluster: it looks like a minor implementation detail until a workload crosses a threshold, at which point it becomes the thing that actually limits cost, context length, and correctness — the sequence length a tokenizer produces is not a footnote to how an LLM works, it is the variable that everything else (attention cost, KV-cache size, context window, price per request) scales against.