Multilingual Pre-training and Data Balancing › Worked Example: One Exponent, Two Languages
Language AI HandbookAll chapters Before writing code, compute one case by hand so the arithmetic is concrete. Take a two-language corpus with : one dominant language and one small one.
The point of doing this by hand is to build intuition for the magnitudes before trusting a library function. The formula is simple enough that the results can be surprising, and the surprises are easier to absorb with a pencil than with a plot.
At the mixture stays at . The small language receives 2% of the expected draws in the unit used for . That is also its share of the expected token count if the sampler draws individual tokens.
At (square-root sampling):
The small language jumps from 2% to 12.5% of the mixture, an upweighting factor of . The dominant language's mixture share drops to 87.5%. Its effective epochs per pass are .
The tail receives more than six corpus-equivalents of draws per nominal pass. The head's expected volume is below one corpus-equivalent. Distinct coverage depends on how the loader chooses items within each language.
At , the value XLM-R and mT5 used:
The small language is now at 23.7% of the mixture, upweighted by . Its expected draw volume per nominal pass is roughly twelve corpus-equivalents, compared with for the head. At the small language reaches 40% of the mixture and roughly twenty expected effective epochs.
At 0.3, a language with 2% of the corpus supplies nearly a quarter of the draws. At 0.1, that language supplies about 40%. As the expected repetitions rise, check whether the available corpus is clean and varied enough to justify the draw budget.
Two lessons follow:
- is not a gentle dial. Small changes near zero move the tail enormously.
- Use the full distribution to compute . The same exponent can give different absolute shares when the set of languages or their natural shares changes.
In a two-language mixture, one language's gain equals the other's loss. Adding languages changes the normalizer, but a single dominant language can still account for all the lost share.
The worked example also shows why effective epochs communicate better than shares:
- "The small language is at 23.7% of the mixture" invites the question "is that enough?"
- “We expect twelve corpus-equivalents of draws per pass” prompts an audit of whether the corpus is clean and varied enough for that much reuse.
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!