Where the text comes from
A model learns a language from text, and most of that text comes from the web. Most training sets start from Common Crawl, a free archive of billions of web pages, which the pretraining lesson described. Common Crawl publishes the share of its pages written mainly in each language. Here are the languages of this course in its crawl of October 2026.
| Language | Share of pages |
|---|---|
| English | 42.56 % |
| Indonesian | 1.06 % |
| Arabic | 0.67 % |
| Persian | 0.62 % |
| Hindi | 0.21 % |
| Bengali | 0.11 % |
| Urdu | 0.032 % |
| Swahili | 0.0099 % |
| Punjabi | 0.0098 % |
| Pashto | 0.0045 % |
| Hausa | 0.0040 % |
| Sindhi | 0.0020 % |
Each page is counted once, under the main language that Common Crawl’s detector finds in it. The detector has no separate entry for Punjabi written in Shahmukhi, the script used in Pakistan. For comparison, Russian is 6.30 %, German 5.77 % and Chinese 4.37 %.
For every Urdu page there are about 1,350 English pages, and for every Sindhi page about 21,000. The number of speakers does not decide this. Bengali and Indonesian are each spoken by more than 200 million people, yet Indonesian has more than nine times as many pages. What counts is how much a language is written down online: how many people have computers and good keyboards for it, and how many write in it rather than in English, or in Latin letters.
Wikipedia, a large part of most training sets, shows a second thing: a count of articles can mislead. Programs can write articles, but only people can keep them accurate, so the number of people who edit is the better sign of a living community.
| Wikipedia | Articles | Active editors |
|---|---|---|
| English | 7,254,684 | 270,152 |
| Egyptian Arabic | 1,633,881 | 301 |
| Arabic | 1,336,768 | 5,624 |
| Persian | 1,098,952 | 7,924 |
| Indonesian | 801,956 | 5,055 |
| Urdu | 706,278 | 390 |
| Bengali | 192,177 | 1,675 |
| Hindi | 172,117 | 1,015 |
| Swahili | 131,585 | 220 |
| Hausa | 121,133 | 297 |
| Western Punjabi (Shahmukhi) | 75,771 | 57 |
| Punjabi (Gurmukhi) | 59,753 | 133 |
| Sindhi | 23,053 | 47 |
| Pashto | 21,353 | 59 |
From Wikimedia’s list of Wikipedias on 21 October 2026. An active editor is a registered user who made at least one edit in the last 30 days. Egyptian Arabic has more articles than Arabic because programs created most of them.
Urdu has almost as many articles as Indonesian, but about one active editor for every thirteen. When few people write and check the text in a language, a model trained on it learns less, and what it learns is less reliable.
- Little text onlinefew pages, few editors
- Little training datathe model learns less of the language
- Few tokenizer mergeswords break into more pieces
- Higher cost, weaker answersmore tokens per answer, more mistakes
- Fewer people use AI in itand less new text is written
- Back to the startunless people break the circle
Quick check
The token tax
The tokens lesson showed that the English word “Privacy” is one token in Qwen3.8, and the Urdu word for it five. A single word proves little, so here is a fair test on a long text. The Universal Declaration of Human Rights has official translations in hundreds of languages, all saying the same thing. This program counts the tokens of the same text in each language, with the tokenizers of four open models, and divides by the English count.
"""tokens.py: how many tokens does the same text take in each language, for four open models?
Save one translation of the same text per file, English first, then:
pip install tokenizers, and: python tokens.py en.txt ur.txt hi.txt sw.txt"""
import sys
from tokenizers import Tokenizer
MODELS = ["openai/gpt-oss-20b", "Qwen/Qwen3.8-27B-FP8", "deepseek-ai/DeepSeek-V4-Flash-0731", "zai-org/GLM-5.3"]
toks = [Tokenizer.from_pretrained(m) for m in MODELS] # downloads only each model's tokenizer.json
files = sys.argv[1:]
texts = [open(f, encoding="utf-8").read() for f in files]
def count(tok, text):
return len(tok.encode(text, add_special_tokens=False).ids)
english = [count(tok, texts[0]) for tok in toks] # the first file is the one to compare with
print("file " + "".join(m.split("/")[1][:13].rjust(16) for m in MODELS))
for f, text in zip(files, texts):
cells = [f"{count(tok, text):5} ({count(tok, text) / e:.2f}×)" for tok, e in zip(toks, english)]
print(f.ljust(10) + "".join(c.rjust(16) for c in cells))
- Each tokenizer comes from the model’s own repository on Hugging Face. Only the file
tokenizer.jsonis downloaded, a few megabytes, not the model. - The texts are the preamble and Articles 1 to 27 of the declaration, from the UDHR in Unicode collection. Each file is one language. No complete Sindhi translation was available.
file gpt-oss-20b Qwen3.8-27B-F DeepSeek-V4-F GLM-5.3
en.txt 1720 (1.00×) 1770 (1.00×) 1703 (1.00×) 1718 (1.00×)
ur.txt 2578 (1.50×) 3184 (1.80×) 3833 (2.25×) 4519 (2.63×)
pnb.txt 3383 (1.97×) 4155 (2.35×) 4611 (2.71×) 5073 (2.95×)
ps.txt 3054 (1.78×) 4292 (2.42×) 4679 (2.75×) 4688 (2.73×)
fa.txt 2437 (1.42×) 2532 (1.43×) 2783 (1.63×) 2972 (1.73×)
ar.txt 2026 (1.18×) 1962 (1.11×) 2350 (1.38×) 2574 (1.50×)
hi.txt 2685 (1.56×) 3648 (2.06×) 4950 (2.91×) 8392 (4.88×)
bn.txt 2886 (1.68×) 3984 (2.25×) 3553 (2.09×) 8551 (4.98×)
sw.txt 2382 (1.38×) 3168 (1.79×) 3252 (1.91×) 3272 (1.90×)
id.txt 2485 (1.44×) 2138 (1.21×) 2642 (1.55×) 3224 (1.88×)
ha.txt 3661 (2.13×) 4805 (2.71×) 4828 (2.83×) 4801 (2.79×)
- The four columns are gpt-oss, Qwen3.8, DeepSeek-V4 and GLM-5.3. The first number is the token count; the number in brackets is how many times the English count it is.
- Urdu takes 1.5 to 2.6 times as many tokens as English, although the Urdu text has 10 % fewer letters and spaces. That gap is the tokenizer’s, not the language’s.
- GLM-5.3 needs almost 5 times as many tokens for Hindi and Bengali. gpt-oss, whose tokenizer has about 200,000 tokens, is the cheapest for nearly every language here.
- Be fair to Hausa: its text is 32 % longer than the English in letters, so part of its gap is the language itself.
This interactive part needs JavaScript.
tokens in your language = m × tokens in Englishm is the number in brackets above; for Urdu with Qwen3.8, m = 1.80
cost = m × cost in Englishpaid services charge per token, so the same request costs m times as much
time to write an answer = m × time in Englisha model writes one token at a time, at about the same speed whatever the language
text that fits in the context window = window ÷ ma window that holds 300 pages of English holds about 167 pages of Urdu
This is not new. In 2023 Aleksandar Petrov and colleagues measured popular tokenizers on parallel texts like this one and found that the same text could need up to 15 times as many tokens in one language as in another. Even models that read raw bytes instead of tokens needed more than 4 times as many bytes for some languages as for others, because UTF-8 stores an English letter in one byte but most other letters in two or three. They called on tokenizer builders to treat languages fairly.
The fix is in the tokenizer. Builders of models for one language often add tokens for it to an existing tokenizer and then train further, so that common words become one or two pieces. The makers of TituLLMs, Bengali models from 2025, extended the Llama 3.2 tokenizer this way and reported that it made training and use faster. Newer tokenizers are also trained on more languages from the start, which is part of why gpt-oss does well in the table.
Quick check
Testing a model in your language
The evals lesson showed that scores in English say little about other languages, and that tests built from local exams, like INCLUDE and IrokoBench, are fairer than translated ones. Before you trust a model in your language, there are a few things to check yourself, and the first is the simplest: does it answer in your language at all?
In 2024 Kelly Marchisio and colleagues at Cohere built the Language Confusion Benchmark, in 15 languages, to measure exactly that. Even the strongest models did not always answer in the language they were asked in, and some switched language halfway through an answer. Llama Instruct and Mistral models were among the most confused. Base models and models tuned mostly in English were worse, and long, complex prompts and a high sampling temperature made it worse still. A few examples in the prompt, and training on instructions in many languages, helped but did not cure it.
You can catch the wrong script with a few lines of Python, because every letter in Unicode has a name that begins with its script. This program counts the share of each script in a text.
"""script_share.py: which writing systems are the letters of a text written in?
A quick check that a model answered in the script you asked for.
python script_share.py answer1.txt answer2.txt"""
import sys, unicodedata
from collections import Counter
def scripts(text):
letters = [c for c in text if c.isalpha()] # letters only: no digits, spaces or punctuation
# every Unicode letter's name starts with its script: "LATIN SMALL LETTER A", "DEVANAGARI LETTER KA"
counts = Counter(unicodedata.name(c, "UNKNOWN").split()[0] for c in letters)
return {s: n / len(letters) for s, n in counts.most_common()}
for f in sys.argv[1:]:
shares = scripts(open(f, encoding="utf-8").read())
print(f.ljust(14) + ", ".join(f"{s.title()} {p:.1%}" for s, p in shares.items() if p >= 0.001))
isalpha()keeps letters only, so numbers, spaces and punctuation do not count.- Unicode names the script, not the language: Urdu, Punjabi, Sindhi, Pashto, Persian and Arabic letters are all called “ARABIC”.
en.txt Latin 100.0%
ur.txt Arabic 100.0%
pnb.txt Arabic 100.0%
hi.txt Devanagari 100.0%
ha.txt Latin 100.0%
ur_pages.txt Arabic 97.0%, Latin 3.0%
- The first five files are the declaration in English, Urdu, Western Punjabi, Hindi and Hausa. The last is this course’s Urdu draft of its About and Privacy pages, with the markup removed.
- Urdu and Punjabi both come out as 100 % Arabic script, and English and Hausa both as 100 % Latin. So this check catches the wrong script, such as Punjabi written in Gurmukhi when you asked for Shahmukhi, but it cannot tell Urdu from Punjabi.
- The Urdu draft is 3 % Latin, from English technical terms that this course keeps on purpose. So expect a correct answer to be mostly, not entirely, in its script: a rule like “at least 90 %” works better than “100 %”.
To tell apart languages that share a script, use a language identifier. GlotLID, from 2023, is a free one: its third version recognises 2,102 combinations of language and script, including Urdu, Western Punjabi, Sindhi, Pashto and Saraiki. Like any detector, it makes more mistakes on very short texts.
- Write about 30 questions that people around you really ask, in school, at work or at the clinic, with good answers written by a speaker of the language.
- Ask each one in the script people actually use. If people also write the language in Latin letters, like Roman Urdu, ask in that too: the evals lesson showed that it can score differently.
- Check the language and script of every answer, with
script_share.pyor GlotLID, before you read it. - Have a speaker grade each answer for correctness and for how natural it sounds, without knowing which model wrote it.
- Keep the questions private, so they do not end up in some model’s training data, and run them again on each new model.
Quick check
Reasoning, safety and trust
Reasoning models learn to think from examples and rewards, and most of those are in English and Chinese. The DeepSeek-R1 paper says so plainly in its limitations: R1 was optimized for Chinese and English, and asked in another language it may reason, and even answer, in English. Models trained on reasoning in other languages behave differently. Fanar 2, an Arabic and English model from Qatar released in 2026, was trained on about 250,000 examples of reasoning written in Arabic, so it thinks in Arabic. Thinking in English does not always make the answer worse, but it matters to a student who wants to follow the steps.
Safety training has the same gap. Teaching a model to refuse harmful requests is done mostly with English examples, and in 2023 Zheng-Xin Yong and colleagues at Brown University found that it did not carry over well. When they translated a standard set of harmful test requests into languages with little training data, a leading model gave useful help towards the harmful goal 79 % of the time. In widely used languages it did so far less often. Labs have since added testing in many languages, and test sets like Aya’s red-teaming data cover several, but the lesson stands: a model that is careful in English has not been shown to be careful in yours.
- If you build something for speakers of a language, test its safety in that language, with speakers, and do not assume that English results carry over. This is called multilingual red-teaming.
- If you use a model, be extra careful with medical, legal and money questions in a language with little online text. Ask for sources, and check them.
- Culture is part of correctness. A model can know the language and still answer as if you lived somewhere else, with the wrong laws, foods, holidays or customs. Local test questions catch this; translated ones do not.
Quick check
Translation and speech
Translation models came first for many languages. Meta’s No Language Left Behind project, in 2022, released a model that translates between 200 languages, with a test set for all of them, FLORES-200, and reported 44 % better translation scores than the earlier best systems. Its weights are free for research but not for commercial use. In June 2024 Google added 110 languages to Google Translate, using its PaLM 2 model, among them Punjabi in Shahmukhi; together they have more than 614 million speakers.
The speech-audio lesson showed that speech recognition, like text, follows the data: Whisper scored over 100 % word errors on Pashto until it was trained on 113 hours of it. Much of that data comes from Mozilla’s Common Voice, where volunteers read sentences aloud and other volunteers listen and confirm each recording. Here is how much each language of this course has, and a few more languages of Pakistan.
| Language | Recorded | Checked and accepted | Voices |
|---|---|---|---|
| English | 3,796 | 2,827 | 100,546 |
| Pashto | 5,581 | 3,530 | 8,429 |
| Swahili | 1,065 | 392 | 1,525 |
| Persian | 431 | 373 | 4,668 |
| Arabic | 158 | 93 | 1,679 |
| Urdu | 295 | 80 | 506 |
| Bengali | 1,278 | 54 | 23,019 |
| Indonesian | 68 | 34 | 678 |
| Hindi | 27 | 16 | 485 |
| Hausa | 13 | 4.4 | 64 |
| Sindhi | 73 | 0.36 | 35 |
| Hindko | 10.5 | 10.2 | 36 |
| Brahui | 9.9 | 9.9 | 18 |
| Saraiki | 6.8 | 4.3 | 60 |
Hours rounded; voices are the people who recorded. Each clip needs two listeners to agree before it is accepted. Common Voice also has Punjabi in Gurmukhi (2.4 hours accepted), but no collection yet for Punjabi in Shahmukhi.
Pashto has more accepted hours than English, because Pashto speakers recorded and checked it. Sindhi is the opposite case: of its 66,263 recorded clips, 65,569 are still waiting for someone to listen, and only 366 were turned down. Bengali has 23,019 voices, more than any language here but English, and about a million clips waiting. What these languages need most is listeners, and anyone who reads the language can listen on a phone, a few minutes at a time.
Quick check
Who is building for these languages
Large general models now name more languages than ever: Qwen3, in 2025, raised its count from 29 languages to 119 languages and dialects. Alongside them, groups in many countries build models for their own languages, usually by taking an open model and training it further on local text. Here are some, as their makers describe them.
| Name (year) | Who | Languages | What to know |
|---|---|---|---|
| Aya Dataset and Collection (2024) | Cohere’s research lab, with collaborators in 119 countries | 65 written by people; 114 in the larger collection | Instructions written by fluent speakers, free to use; the collection has 513 million examples |
| Sarvam-105B and 30B (2026) | Sarvam AI, India, with government support | 22 Indian languages, Urdu and Sindhi among them | Open weights under Apache 2.0; the 105B is a mixture of experts with 10.3 billion parameters active per token |
| Fanar 2 (2026) | Qatar Computing Research Institute | Arabic, standard and dialects, and English | Gemma 3 27B trained further on about 166 billion tokens; reasons in Arabic; Apache 2.0 |
| Sahabat-AI (2024) | GoTo and Indosat, Indonesia, with AI Singapore | Indonesian, Javanese, Sundanese | Its makers say it has not been aligned for safety |
| TituLLMs (2025) | Hishab, Bangladesh | Bengali | 1B and 3B models, an extended tokenizer, and five new Bengali tests |
| InkubaLM (2024) | Lelapa AI, South Africa | Swahili, Hausa, Yoruba, isiZulu, isiXhosa, with English and French | Only 0.4 billion parameters, trained on 2.4 billion tokens, for places with little computing power |
| Qalb-1.0-8B (2026) | An Urdu project shared on Hugging Face | Urdu | Llama 3.1 8B trained further on 1.97 billion Urdu tokens; its scores are its makers’ own |
From each project’s paper or model card, checked on 21 October 2026. For Sindhi, Pashto and Punjabi in Shahmukhi, no dedicated open model with a published paper was found.
Read every row the way the reading-papers lesson taught. Most scores are reported by the makers, on tests they chose, against models they chose. So check five things: the tests (local ones, or translations?), the tokenizer (extended, or the base model’s?), the licence (Apache 2.0 allows almost any use; the Gemma and Llama licences add conditions), safety (did they align it, and test it in the language?), and the date, since a model from 2024 may already be beaten by a general model from 2026. Then run your own 30 questions.
Which of these lowers the token tax, and which can only improve the quality of answers?
-
Adding tokens for the language to the tokenizer
Answer: Lowers the token tax
-
Training the tokenizer on more text in the language from the start
Answer: Lowers the token tax
-
Choosing a model whose tokenizer splits the language into fewer pieces
Answer: Lowers the token tax
-
Training the model further on local text, with the same tokenizer
Answer: Improves quality only
-
Fine-tuning on instructions written by speakers
Answer: Improves quality only
-
Adding local exam questions to the tests
Answer: Improves quality only
Quick check
What you can do
You cannot change how much text your language has online this year, but you can choose well, work around the gaps, and help close them.
- Choose a model for your language: measure its token tax on your own text with
tokens.py, check that its card names your language, run your 30 questions, and read its licence and safety notes. For speech, use the steps in the speech-audio lesson. - Say what you want: ask for the language and the script by name, for example “Answer in Urdu, in Urdu script”, and keep the temperature low. Both reduce language confusion.
- Keep English technical words where people in your field use them, as this course does. Translated technical words that nobody uses make answers harder to read, and harder to search for.
- Check what matters: for health, law and money, ask for sources and check them, or ask the same question in English and compare the answers.
- Use a small local model for private work, as the local-ai lesson showed, but test it in your language first: small models lose more outside English.
And you can help the next model be better in your language. Each of these needs only a phone or a shared computer and some time.
- Common Voice: record sentences in your voice, and listen to and check other people’s recordings. For Sindhi and Bengali, listening is what is missing most. A community can also ask for a new language to be added; it starts by translating the website and gathering sentences that anyone may use.
- Wikipedia: write or improve articles in your language about things you know, with sources. Every careful article becomes part of what future models learn, and what people find.
- Tests and instructions: projects like Aya and IrokoBench were built by speakers who wrote and checked questions. When such a project asks for your language, join it.
- Review AI translations: every non-English text in this course is an AI draft until a speaker has checked it. Reviewers are how drafts become trustworthy.
Quick check
Remember
- Models learn languages from text, and the web is very unequal: in Common Crawl there are about 1,350 English pages for every Urdu page, and 21,000 for every Sindhi page.
- Speakers alone do not decide it: Indonesian has more than nine times Bengali’s pages. Active editors say more about a language’s online life than article counts.
- Inside, models share concepts across languages, so knowledge learned in English helps elsewhere, but the bridge is weaker for languages seen less.
- The same text takes 1.5 to 2.6 times as many tokens in Urdu as in English, and up to 5 times in Hindi and Bengali with one tokenizer: higher cost, slower answers, less room.
- Extending the tokenizer lowers the tax; more training on local text improves quality but not cost.
- Models may answer in the wrong language or script. Check the script with Unicode names, the language with a detector like GlotLID, and the content with a speaker.
- Reasoning and safety are trained mostly in English and Chinese, so test both in your language before trusting them.
- Groups in India, Qatar, Indonesia, Bangladesh and South Africa, and smaller projects for Urdu, build models for their languages; read their claims with care and run your own questions.
- Speakers can close the gap: record and check speech, write and fix articles, build tests, and review translations, giving only what is theirs to give.
Words to know
- Low-resource language
- A language with little text or speech available for training models, whatever its number of speakers.
- Common Crawl
- A free archive of billions of web pages, the starting point of most training sets.
- Active editor
- On Wikipedia, a registered user who made at least one edit in the last 30 days.
- Parallel text
- The same text in several languages, which makes fair comparisons possible.
- Token tax
- How many times as many tokens a language needs as English for the same text.
- Vocabulary extension
- Adding tokens for a language to an existing tokenizer, then training further so the model learns them.
- Logit lens
- Reading which token a layer’s hidden state is closest to, to see what the model is working with in the middle.
- Language confusion
- When a model answers in a different language from the one it was asked in, or switches language midway.
- Script
- A writing system, such as Latin, Arabic, Devanagari or Bengali. One script can serve many languages.
- Language identifier
- A small model that guesses the language of a text, such as GlotLID.
- Multilingual red-teaming
- Testing a model’s safety by trying harmful requests in many languages, with speakers of each.
- Continued pretraining
- Training an existing model further on new text, such as text in one language.
- Validated hours
- In Common Voice, recordings that other speakers have listened to and accepted.
Go to the source
This lesson is built on these papers and documents. Paper links open arxiv.org, a separate site.
-
Language Model Tokenizers Introduce Unfairness Between Languages
Up to 15 times as many tokens for the same text, measured on parallel texts.
-
Do Llamas Work in English? On the Latent Language of Multilingual Transformers
The logit lens shows a concept space closer to English in the middle layers.
-
Tracing the thoughts of a large language model (Anthropic)
Features shared across languages, more so in larger models.
-
Understanding and Mitigating Language Confusion in LLMs
The Language Confusion Benchmark, and what makes confusion better or worse.
-
Low-Resource Languages Jailbreak GPT-4
Why safety must be tested in every language.
-
GlotLID: Language Identification for Low-Resource Languages
A free language identifier for more than 2,000 languages and scripts.
-
No Language Left Behind: Scaling Human-Centered Machine Translation
Translation between 200 languages, and the FLORES-200 test set.
-
Aya Dataset: An Open-Access Collection for Multilingual Instruction Tuning
Instructions written by speakers of 65 languages.
-
Qwen3 Technical Report
From 29 to 119 languages and dialects in one model family.
-
TituLLMs: A Family of Bangla LLMs with Comprehensive Benchmarking
Vocabulary extension and new tests for Bengali.
-
InkubaLM: A small language model for low-resource African languages
A 0.4-billion-parameter model for five African languages.
-
Fanar 2.0: Arabic Generative AI Stack
Arabic data, dialects, and reasoning written in Arabic.
-
Common Crawl: statistics of languages
The share of pages per language, crawl by crawl.
-
List of Wikipedias (Wikimedia)
Articles and active editors for every language.
-
Common Voice dataset statistics (Mozilla)
Recorded and accepted hours for every language.
-
UDHR in Unicode
The declaration in hundreds of languages, the parallel text measured in this lesson.
Check yourself
6 questions. Tap the answer you think is right.
0 of 6 answered
Lesson complete
Answer every question above to complete this lesson.
Your progress is saved on this device only.
Next lessonNext steps: from this course to real expertise