Multilingual Pre-training and Data Balancing › The Natural Distribution and the Training Budget
Language AI HandbookAll chapters A language share describes a particular crawl or processed corpus. Common Crawl has documented overrepresentation of English-language content in its archive. Common Crawl, Web Languages Project
- Check the largest language share, and specify whether it counts pages, documents, or tokens.
- Record the largest non-head languages in the particular snapshot and pipeline you use.
- Inspect the smallest shares and the volume of available, usable documents before choosing which languages to upsample.
Crawler coverage, language identification, filtering, and deduplication are separate stages. Compare the language counts before and after each stage. Caswell et al. found low human-judged precision in many of the lower-resource language buckets produced by their web-crawl pipeline. Caswell et al. (2020)
A concrete illustration, which we will use throughout the chapter, is a corpus with the following surviving document counts in millions:
| Language | Documents (M) | Share |
|---|---|---|
| English | 460 | 57.7% |
| Chinese | 140 | 17.6% |
| Spanish | 80 | 10.0% |
| Arabic | 55 | 6.9% |
| Hindi | 40 | 5.0% |
| Swahili | 12 | 1.5% |
| Welsh | 6 | 0.75% |
| Yoruba | 4 | 0.50% |
The table is a synthetic eight-language example with a large head and a small tail. Use a real pipeline report for the language count, the minimum document volume, or the share of any individual language.
Treat the crawl share as a measurement of the selected corpus. To allocate training for a deployment, record separate measures of user demand, language coverage, and usable text.
For example, suppose a language with 100 million speakers contributes 10 million indexed pages and one with 10 million speakers contributes 20 million pages. By page count the smaller population contributes twice as much training material. Estimate how much remains after filtering before drawing conclusions about exposure.
A multilingual corpus is imbalanced when its token counts are uneven across languages. Some corpora differ by orders of magnitude. Even smaller differences can matter for exposure, shared capacity, and token cost:
- Optimization attention. A language contributing 0.05% of the tokens supplies 0.05% of the terms in an equally weighted token-average loss. Its contribution to the gradient also depends on the size and direction of those token gradients. A training step can include several languages.
- Representational capacity. In the quadratic model later in the chapter, incompatible language optima remain separated even if we estimate each one perfectly. A single shared point must compromise.
- Tokenizer economics. If two documents have the same word count, the one with higher tokens per word uses more of a fixed token budget. How much compute it uses also depends on batching and the cost per processed token.
Each of the three mechanisms is a different kind of scarcity. The first is scarcity of optimization signal, the second is scarcity of representational space, and the third is scarcity of compute efficiency. A language can suffer from one, two, or all three at once, and the remedies do not overlap cleanly.
Wu and Dredze studied mBERT on tasks trained and evaluated in the same language. They found that mBERT’s performance relative to their baselines was poorer for many lower-resource languages and analyzed how results correlated with the amount of data. In the XLM-R paper’s Wikipedia-trained XLM-100 sampling experiment, the high- and low-resource groups had different XNLI classification accuracies. Wu and Dredze (2020) · Conneau et al. (2020)
Wu and Dredze also studied zero-shot transfer in a separate experiment across five tasks, fine-tuning on one language and testing on another. Those experiments ask different questions about a shared model. To estimate what changing your mixture can fix, compare corpus size and script overlap in controlled experiments on your own tasks. Wu and Dredze (2019)
Imbalance hurts in three different ways
It helps to keep the mechanisms separate, because each has a different fix:
Not enough attention. If the loader delivers 0.5% Yoruba tokens, Yoruba contributes about five out of every thousand token-level observations. Its frequency across optimizer steps also depends on batching and packing. When exposure is the bottleneck, increasing the share gives the model more chances to see Yoruba examples. The deployed architecture can stay the same.
Track the token fraction, the fraction of batches containing the language, and how many distinct documents those batches cover. Increasing the draw rate can surface useful contexts or show the model more copies of examples it has already seen.
Not enough room. In a two-language example with different preferred parameter values, moving the shared solution toward Yoruba can move it away from the other language. Measure that trade-off with a fixed-architecture mixture change. A second run with a larger model or a specialized module can test whether capacity helps.
The worked quadratic model below makes the trade-off explicit. A change in its mixture can move the shared optimum toward one language and away from another. Treat this as a model of interference when interpreting results from an actual training run.
More tokens for the same content. Suppose a tokenizer uses 2.6 tokens per Yoruba word and 1.0 per English word. For the same word count, the Yoruba example takes 2.6 times the context budget. Petrov et al. reported differences of up to roughly 15× in some same-content comparisons. Petrov et al. (2023)
A document-balanced loader can still allocate different token shares. Measure fertility in each supported language before setting document weights. Changing the sampling weights leaves the tokenizer’s mapping of a given text unchanged.
The chapter starts with sampling, then turns to capacity. If exposure is a plausible bottleneck, sweep the mixture at a fixed architecture and token budget. With the same corpus and loader, restoring the sampler configuration restores the planned mixture. Keep the earlier checkpoint if you need to recover the model trained with it.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!