Text becomes token identifiers
Before a text model processes a message, a tokenizer converts it into token identifiers, which are then represented by numerical vectors. The model does not receive a printed page in the way a person sees it. But it can learn information about spelling; tokenisation does not make letters unknowable.
A token may represent a word, part of a word, punctuation, bytes or other symbols. Four characters per token, or about three quarters of an English word, is only a rough English-text estimate for some tokenizers. Seven hundred and fifty words might be around one thousand tokens; an actual book must be counted with the chosen tokenizer.
Common strings may have a token of their own, while less common ones are split into smaller units. A split such as un + believ + able is an illustration, not a guaranteed encoding of “unbelievable”. Case, spaces, language and tokenizer version affect the result. The vocabulary is fixed for a particular tokenizer version; some designs use byte-level pieces to represent unfamiliar text.
You can inspect these pieces with free tools such as tiktoken or Hugging Face’s tokenizers. Use the tokenizer for the exact model you are studying, and record its version with the text. A count from one tokenizer is not automatically a count for another.
Why this explains so many oddities
Suppose a tokenizer represents “strawberry” with larger pieces rather than one token per letter. The model then has to recover the spelling relationship rather than simply receive ten separately indexed letters. Check the actual split instead of assuming it is always straw + berry.
For example, “strawberry” contains three letters r. A language model may answer correctly, but a token representation is not a dedicated character counter. Test spelling and counting tasks rather than assuming that fluency guarantees exact character-level work.
Character counting, reversal and long-number arithmetic expose similar distinctions. A tokenizer can group digits in ways that do not match written columns, but a model can still learn some arithmetic or call a calculator. For exact work, use an explicit calculation or string operation and check its rules.
The part that is unfair
Token counts can differ substantially across languages. That matters when capacity or price is measured in tokens rather than in words or meanings.
Ahia and colleagues’ 2023 study compared commercial language-model APIs on multilingual text and found unequal token costs and utility across the languages and systems tested. Some tokenizers represent particular Indian-script texts with many more tokens than an English translation. The ratio depends on the exact texts and tokenizer; it is not a fixed property of a language.
When one version uses more tokens, consider three separate consequences:
- Price can differ. On an API billed per token, more billable tokens can mean a higher price, depending on its pricing rules. A subscription need not bill this way.
- Less text may fit. A fixed token window can hold less of a passage that takes more tokens.
- Quality needs testing. Tokenisation can affect performance, but training data, model design, post-training and the task also matter. More tokens alone do not prove why a particular answer failed.
Tokenizer design changes. Meta’s 2024 Llama 3 report describes a vocabulary of about 128,000 tokens and more efficient encoding than its predecessor. That is one documented example, not evidence that every model has the same multilingual gap or that a gap can never close. Compare the exact versions you plan to use.
If a task succeeds in English and fails in another language, inspect the token counts and then evaluate the model on representative examples. Tokenisation is one candidate explanation. The output alone does not isolate it from differences in training, retrieval or the task.
What to do with this
Count tokens rather than relying on word estimates near a limit or a token-based budget. Count the actual input with the relevant tokenizer, including any instructions and history the application supplies.
Use explicit character operations for exact character work. A short program can count letters or reverse a string under specified rules. Those rules matter: Unicode code points, user-perceived characters and bytes are different units. Let a language model help write the program if useful, then test the result.
Check unusual names and technical terms. They may be split into unfamiliar pieces, but tokenisation alone does not tell you why a name was misspelled. Supply the exact spelling, compare the output and keep names out of a workflow that silently accepts substitutions.
Check your understanding
A token-billed API uses many more tokens for a Bengali passage than for its English translation, and the Bengali task also performs worse. Which conclusion is justified?
Pick the one you would defend. Your answer stays private.
Your place and first choices stay on this browser. Classroom credit is recorded separately.
Stuck on something?Ask Meenal, your AI tutor