{"course":{"slug":"ai-actually-explained","title":"AI, Actually Explained","url":"https://addaly.com/learn/ai-actually-explained","level":"beginner","track":"start"},"lesson":{"slug":"words-into-tokens","title":"Text is chopped up before the model sees it","url":"https://addaly.com/learn/ai-actually-explained/words-into-tokens","position":21,"of":92,"minutes":9,"answer":"Tokenisation turns text into model-specific units. Token counts can affect capacity and token-billed prices across languages; spelling, arithmetic and answer quality still need direct testing.","keyIdea":"Tokenisation turns text into model-specific units. Token counts can affect capacity and token-billed prices across languages; spelling, arithmetic and answer quality still need direct testing."},"body":{"format":"markdown","text":"## Text becomes token identifiers\n\nBefore 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.\n\nA 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.\n\nCommon 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.\n\nYou 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.\n\n## Why this explains so many oddities\n\nSuppose 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`.\n\nFor 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.\n\nCharacter 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.\n\n## The part that is unfair\n\nToken counts can differ substantially across languages. That matters when capacity or price is measured in tokens rather than in words or meanings.\n\nAhia 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.\n\n> Figure: One passage, five hypothetical token counts. Bars (illustrative token counts, not measured language results): Encoding example A 14; Encoding example B 17; Encoding example C 46; Encoding example D 48; Encoding example E 52. These five counts are hypothetical, not results for English, Spanish, Hindi, Bengali or Tamil. They illustrate the arithmetic: more tokens for a passage can use more of a fixed token window and cost more on a token-billed API. Actual multilingual differences must be measured with the exact texts and tokenizer; Ahia and colleagues’ 2023 study provides evidence for the systems it tested.\n\nWhen one version uses more tokens, consider three separate consequences:\n\n- **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.\n- **Less text may fit.** A fixed token window can hold less of a passage that takes more tokens.\n- **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.\n\nTokenizer 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.\n\nIf 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.\n\n## What to do with this\n\n**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.\n\n**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.\n\n**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":{"question":"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?","options":[{"text":"The larger token count can increase token-billed cost and use more of the window. It may affect quality, but the quality difference needs further investigation.","correct":true},{"text":"The model has a separate, smaller Bengali model behind the scenes, which is cheaper to run but weaker.","correct":false,"tempting":"This invents separate language-specific routing without evidence. The observations do not establish which model or components served the request."},{"text":"Bengali text requires more processing because its script uses more bytes per character in storage.","correct":false,"tempting":"Storage bytes and model tokens are different units. The stated API bills tokens, although tokenizer design can itself use byte-level units."},{"text":"Providers charge a surcharge for non-English languages to cover the extra translation step.","correct":false,"tempting":"The stated token counts already explain a possible price difference. They do not establish a separate translation step or a language surcharge."}]},"prev":{"slug":"what-a-chatbot-does","title":"What a chatbot is doing when it answers","url":"https://addaly.com/learn/ai-actually-explained/what-a-chatbot-does"},"next":{"slug":"the-next-word-game","title":"One chunk at a time, and it cannot take it back","url":"https://addaly.com/learn/ai-actually-explained/the-next-word-game"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Source and assessment review continues. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Text is chopped up before the model sees it', in AI, Actually Explained. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/ai-actually-explained/words-into-tokens (Accessed: 29 November 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Text is chopped up before the model sees it","courseTitle":"AI, Actually Explained","module":{"index":3,"slug":"how-a-chatbot-works","title":"What a chatbot is actually doing"},"answer":null,"keyIdea":"Tokenisation turns text into model-specific units. Token counts can affect capacity and token-billed prices across languages; spelling, arithmetic and answer quality still need direct testing.","hero":{"kind":"figure","figure":{"t":"figure","label":"Figure","figure":{"type":"bars","title":"One passage, five hypothetical token counts","caption":"These five counts are hypothetical, not results for English, Spanish, Hindi, Bengali or Tamil. They illustrate the arithmetic: more tokens for a passage can use more of a fixed token window and cost more on a token-billed API. Actual multilingual differences must be measured with the exact texts and tokenizer; Ahia and colleagues’ 2023 study provides evidence for the systems it tested.","unit":"illustrative token counts, not measured language results","series":[{"label":"Encoding example A","value":14},{"label":"Encoding example B","value":17},{"label":"Encoding example C","value":46,"highlight":true},{"label":"Encoding example D","value":48},{"label":"Encoding example E","value":52}]},"alt":"Figure: One passage, five hypothetical token counts. Bars (illustrative token counts, not measured language results): Encoding example A 14; Encoding example B 17; Encoding example C 46; Encoding example D 48; Encoding example E 52. These five counts are hypothetical, not results for English, Spanish, Hindi, Bengali or Tamil. They illustrate the arithmetic: more tokens for a passage can use more of a fixed token window and cost more on a token-billed API. Actual multilingual differences must be measured with the exact texts and tokenizer; Ahia and colleagues’ 2023 study provides evidence for the systems it tested."}},"blocks":[{"t":"h2","id":"text-becomes-token-identifiers","runs":[{"text":"Text becomes token identifiers"}]},{"t":"p","runs":[{"text":"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."}]},{"t":"p","runs":[{"text":"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."}]},{"t":"p","runs":[{"text":"Common strings may have a token of their own, while less common ones are split into smaller units. A split such as "},{"text":"un","code":true},{"text":" + "},{"text":"believ","code":true},{"text":" + "},{"text":"able","code":true},{"text":" 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."}]},{"t":"p","runs":[{"text":"You can inspect these pieces with free tools such as "},{"text":"tiktoken","code":true},{"text":" or Hugging Face’s "},{"text":"tokenizers","code":true},{"text":". 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."}]},{"t":"h2","id":"why-this-explains-so-many-oddities","runs":[{"text":"Why this explains so many oddities"}]},{"t":"p","runs":[{"text":"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 "},{"text":"straw","code":true},{"text":" + "},{"text":"berry","code":true},{"text":"."}]},{"t":"p","runs":[{"text":"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."}]},{"t":"p","runs":[{"text":"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."}]},{"t":"h2","id":"the-part-that-is-unfair","runs":[{"text":"The part that is unfair"}]},{"t":"p","runs":[{"text":"Token counts can differ substantially across languages. That matters when capacity or price is measured in tokens rather than in words or meanings."}]},{"t":"p","runs":[{"text":"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."}]},{"t":"p","runs":[{"text":"When one version uses more tokens, consider three separate consequences:"}]},{"t":"ul","items":[[{"text":"Price can differ.","b":true},{"text":" 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."}],[{"text":"Less text may fit.","b":true},{"text":" A fixed token window can hold less of a passage that takes more tokens."}],[{"text":"Quality needs testing.","b":true},{"text":" 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."}]]},{"t":"p","runs":[{"text":"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."}]},{"t":"p","runs":[{"text":"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."}]},{"t":"h2","id":"what-to-do-with-this","runs":[{"text":"What to do with this"}]},{"t":"p","runs":[{"text":"Count tokens rather than relying on word estimates","b":true},{"text":" near a limit or a token-based budget. Count the actual input with the relevant tokenizer, including any instructions and history the application supplies."}]},{"t":"p","runs":[{"text":"Use explicit character operations for exact character work.","b":true},{"text":" 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."}]},{"t":"p","runs":[{"text":"Check unusual names and technical terms.","b":true},{"text":" 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":{"question":[{"text":"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?"}],"options":[{"text":[{"text":"The larger token count can increase token-billed cost and use more of the window. It may affect quality, but the quality difference needs further investigation."}],"correct":true,"tempting":null},{"text":[{"text":"The model has a separate, smaller Bengali model behind the scenes, which is cheaper to run but weaker."}],"correct":false,"tempting":[{"text":"This invents separate language-specific routing without evidence. The observations do not establish which model or components served the request."}]},{"text":[{"text":"Bengali text requires more processing because its script uses more bytes per character in storage."}],"correct":false,"tempting":[{"text":"Storage bytes and model tokens are different units. The stated API bills tokens, although tokenizer design can itself use byte-level units."}]},{"text":[{"text":"Providers charge a surcharge for non-English languages to cover the extra translation step."}],"correct":false,"tempting":[{"text":"The stated token counts already explain a possible price difference. They do not establish a separate translation step or a language surcharge."}]}],"order":[3,0,2,1],"why":null},"prev":{"slug":"what-a-chatbot-does","title":"What a chatbot is doing when it answers","minutes":8},"next":{"slug":"the-next-word-game","title":"One chunk at a time, and it cannot take it back","minutes":9}}}