Multilingual Pre-training and Data Balancing
Learn how multilingual language models allocate training budgets across languages using temperature-based sampling, effective epochs, capacity trade-offs, and per-language diagnostics.
Language AI HandbookAll chapters Multilingual Pre-training and Data Balancing
Multilingual language models can share some or all weights across languages. One shared model can cover training and deployment that might otherwise use several language-specific artifacts. Sharing can also help lower-resource languages. The XLM-R experiments found that adding languages improved performance for some low-resource languages in their initial comparisons. Conneau et al. (2020), section 5
When you pool languages, the model can see recurring patterns in the combined data. Whether these patterns help depends on the task and the training mixture. Test candidate donor languages under the same evaluation protocol before treating relatedness as a benefit.
The shared setup gives you several budgets to write down: parameters, vocabulary entries, optimizer updates, context tokens, and tokens per unit of text. When shares of a fixed training budget sum to one, raising one share lowers the combined share of the others. The effect on language quality requires a measurement.
This chapter is about how that allocation is done. We focus on two levers:
- Data allocation: how often each language is sampled during pre-training. The canonical mechanism is temperature-based sampling, a one-parameter reweighting of the natural corpus distribution.
- Capacity allocation: which parameters and vocabulary entries are shared or specialized. Model size and architecture are levers here. Multilingual Tokenization and Vocabulary Allocation covers the vocabulary choice.
These two levers are not interchangeable. They operate on different bottlenecks and their costs are paid at different times:
- A sampler change can keep the architecture and inference cost fixed while changing the fitted weights.
- Adding a language-specific module changes the model artifact. If you select a module per request, include that selection in the serving design.
Knowing which problem you have is therefore worth more than knowing the formulas.
These choices affect where languages can share useful patterns and where their objectives can conflict.
- Transfer. A shared model can learn patterns from one language that help another.
- Interference. When languages prefer different parameter values, one shared fit can move closer to one language and farther from another. Test exposure, capacity, and tokenization separately before deciding which to change.
The Natural Distribution and the Training Budget
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.
Temperature-Based Sampling
A common reweighting is temperature-based sampling, also called exponential smoothing of the mixture. The training recipes for XLM-R and mT5 both used an exponent of 0.3.
Take each positive natural share, raise it to an exponent strictly between zero and one, and renormalize. This gives smaller shares a larger proportional boost while preserving their order.
Let be the natural share of language in the corpus, with . Apply the transform on the support , leaving unrepresented languages at zero. For , the training mixture on that support is
reproduces the natural distribution exactly. gives the uniform distribution over the represented languages. Intermediate values compress the ratio between frequent and rare languages.
Read the formula through ratios. For two positive shares, normalization cancels and the new ratio is . A ratio above one moves toward one for , stays unchanged at , and grows for . At , a ratio of 1000:1 becomes roughly 8:1, and a ratio of 10:1 becomes roughly 2:1.
Write for and . For unequal positive shares, increasing reduces their larger-to-smaller ratio toward one. The uniform endpoint corresponds to the limit as tends to infinity.
In text generation, temperature rescales logits for possible next tokens. Here, temperature rescales a training distribution over languages. When reporting a setting, name the distribution being rescaled.
Properties worth internalizing
Work in log space and the mechanism becomes obvious:
The log-share expression says that the log of the training share is an affine function of the log of the natural share. On a log-log plot, temperature sampling is a straight line with slope and an intercept set by the normalizer. That is the cleanest mental picture of what the exponent does. It tilts the line. A slope of one reproduces the natural distribution; a slope of zero makes every language equal; intermediate slopes change both the slope and the intercept, since the normalizer depends on the exponent.
The log-log relationship is easier to see than to read in a table. The next cell computes shares for four exponents, and the figure plots them on log axes, where each exponent should appear as a straight line.
PythonIn [3]Expand
import numpy as np
doc_counts = np.array([460.0, 140.0, 80.0, 55.0, 40.0, 12.0, 6.0, 4.0])
tilt_p = doc_counts / doc_counts.sum()
tilt_alphas = np.array([1.0, 0.5, 0.3, 0.0])
tilt_q = np.power(tilt_p[None, :], tilt_alphas[:, None])
tilt_q = tilt_q / tilt_q.sum(axis=1, keepdims=True)
order = np.argsort(tilt_p)
tilt_p_sorted = tilt_p[order]
tilt_q_sorted = tilt_q[:, order]VisualizationOut [4]Expand

The training mixture is the natural distribution stretched in log-probability space with slope . Dividing the two equations also gives a clean expression for the per-language upweighting factor:
For a corpus-sized draw budget with matching units, this ratio is the expected number of effective epochs. With positive shares and , the negative exponent makes the relative boost decline as natural share rises.
Three consequences follow directly:
- For positive shares and , the multiplier decreases as rises. Whether an individual share grows depends on whether its multiplier exceeds one.
- The upweighting factor is a power law in the natural share. A language ten times rarer than another gets times more relative boost per unit share. At that factor is ; at it is .
- The single scalar is the only thing you control. It cannot say "Spanish matters more than its size suggests" or "this corpus of Swahili is machine-translated garbage." Those statements require extra machinery, which we add below.
For a nonuniform corpus and , the smallest positive shares gain and the largest shares lose. For , the smallest shares lose and the largest gain. At , or if the represented shares are already uniform, the mixture stays the same. For a middle share, compare its multiplier with one.
At a fixed , the ratio of two languages’ multipliers is . The normalizer cancels in this comparison. Each individual multiplier still depends on the full mixture through . The sampler uses corpus shares alone, so equal shares receive equal multipliers regardless of the quality of those documents.
The third consequence is the important one for practice. Because is a single scalar, it cannot encode any language-specific knowledge, such as:
- whether one language's corpus is high quality and another's is machine-translated,
- whether one language is a product priority and another is a legal obligation,
- or whether two languages are so closely related that one can serve as a donor for the other.
Those require the extensions described later.
Effective epochs
A share table tells you how the draws are divided. To estimate how heavily they reuse a corpus, measure effective epochs. Let be the number of items in the corpus and define one nominal pass as draws. Measure and in the same unit, such as documents. Language has items and an expected draws in a nominal pass, so
An effective epoch is a corpus-equivalent volume of draws. An above one means more expected draws than there are items in language . An below one means fewer. Under uniform sampling with replacement within the language, is also the expected number of draws of any given item. The number of distinct items seen depends on the sampler. A corpus-equivalent volume can include both repeats and omissions.
At in the eight-language example, the English draw volume is about 0.42 times its corpus size and the Yoruba draw volume is about 11.6 times its corpus size. The full distribution and exponent determine how these rates change in a larger mixture.
The same exponent sets both rates. With uniform draws within Yoruba, duplicate or mislabeled items are exposed at the same expected rate as other Yoruba items. Auditing that corpus matters more as the expected number of draws rises.
A budget of 40 effective epochs means 40 corpus-equivalents of draws in expectation. At that level, inspect how often the loader serves the same documents and measure memorization on held-out examples. Experiments in language modeling connect repeated training text with greater verbatim regeneration. Kandpal et al. (2022)
A threshold such as four to five effective epochs can be a useful trigger for inspecting duplicate rates, label quality, and realized document coverage before training. Treat the threshold as an audit heuristic for the pipeline.
Why not just go uniform?
With positive natural shares, gives each language the same draw probability. Check what changes in exposure, batch composition, and validation:
- Fewer draws from high-resource data. With 58% English in the corpus and a 12.5% mixture share, one corpus-sized pass draws about 22% of the English corpus size in expectation. Compare English validation performance before choosing this allocation for an English-heavy deployment.
- Repeated exposure. Consider a corpus of 2,000 documents and a budget of 400,000 draws for that language. The result is 200 expected corpus-equivalents. Compare validation performance with training performance under that amount of reuse.
- Sparse batch coverage. At per-sequence probability , a batch contains one sequence from the language in expectation. The actual batch coverage and sample gradients determine how variable the language's contribution is.
- Non-monotone benefit. In the later toy model, a share change moves the shared point. If one language already lies near that point, more mass on it can hurt another language while only modestly changing its own loss.
Compare the allocation with the corpus distribution and with the batches your loader produces.
- Draw volume. Uniform sampling redistributes draw volume from languages with above-uniform natural shares to those with below-uniform shares. Use realized reuse and held-out loss to check whether heavier reuse overfits a small corpus.
- Gradient variability. Measure batch language counts and gradient variability separately. If every sample contributes the same gradient vector, changing the language counts in a fixed-size unweighted batch leaves its mean gradient unchanged.
For example, start from preferred parameter values 0 for the head, 1 for a nearby language, and 4 for a distant language. With weights (0.8, 0.05, 0.15), the shared point is 0.65. Move 0.1 of the head weight to the nearby language. The shared point moves to 0.75. The nearby language’s squared error falls from 0.1225 to 0.0625, while the head language’s rises from 0.4225 to 0.5625 under the same comparison.
Sweep lower exponents when you want to test allocations closer to uniform. Use the same evaluation data across the sweep and compare the outcomes you care about.
Published choices of exponent
Conneau et al. (2020), section 5 and figure 5 compare in a Wikipedia-trained XLM-100 sampling study. They chose 0.3 for XLM-R based on overall XNLI classification accuracy in that sweep. XLM-R trained on Common Crawl text covering 100 languages. Xue et al. (2021), table 4 report mean zero-shot XNLI accuracy of 81.1% for the mT5-Large baseline at 0.3 and 80.7% at either 0.2 or 0.7. mT5 uses mC4 in 101 languages. These are mean XNLI scores. Check the evaluation languages separately before choosing an exponent.
Use 0.3 as a baseline for a sweep. Measure the trade-off on the languages and tasks you want to serve, using the aggregation you care about.
A different deployment profile would justify a different number.
Two usable rules of thumb:
- If your deployment is broad and no single language dominates, 0.2 to 0.3 is a sensible starting point.
- If one language makes up 80% of your traffic, include higher exponents in your sweep and compare head and tail performance. As a separate example of a reported corpus mix, the Llama 2 technical report estimates 89.70% English and 8.38% unknown language in its data. Touvron et al. (2023), table 10
Use a model’s measured language coverage and the reported counting unit when comparing corpora. Choose a deployment weighting based on your use case, and report it separately from the training mix.
Extending the Sampler Beyond One Exponent
The exponent sets a baseline mixture. Use a multiplier to express a language priority, a cap to limit its share, and a stated sampling unit to make the result interpretable.
When reproducing a mixture, check whether the paper reports source multipliers, maximum shares, or a unit conversion. An exponent gives a complete recipe only once you know its input shares and subsequent transformations.
Per-language multipliers
The natural generalization is
Here is a hand-set or learned multiplier for language . At least one language must have positive weighted mass so the denominator is nonzero. Use a multiplier when you want to express a priority for one language independently of natural share.
The multiplier is the place where everything the exponent cannot represent enters. It can upweight a language for product reasons or downweight a language whose corpus is known to be noisy. Setting excludes language from the mixture as long as some other language contributes positive mass. It can also encode a data-quality judgment: if one language's corpus has passed a stricter filter, it may deserve a higher multiplier than a language whose corpus is dirtier at the same natural share.
BLOOM provides a separate example of intentional data composition. Its authors report ROOTS as a mixture of natural-language and programming-language data. Use their published composition to read the source mix. BigScience (2024), section 3
Caps and water-filling
A common share cap limits how much mixture mass any language can receive. No language may exceed , and the excess is redistributed to uncapped languages in proportion to their current weights. This is a water-filling procedure, applied iteratively because redistribution can push another language over the cap.
In this water-filling procedure, increase a common scale factor . Languages with larger base weights reach the shared cap first. Fix capped shares at and scale the free weights to use the remaining mass.
With positive input weights and a feasible common cap such that for languages, choose the normalizer so that the resulting shares sum to one. Fix any share that would exceed and redistribute the remaining mass among the free languages:
A common cap flattens the largest shares. A repetition cap has a different purpose: it takes the size of each language's corpus into account.
A common share cap can reduce head shares and increase tail shares. To limit expected draws relative to a small corpus, set a bound on that language’s effective epochs. Check that the sum of all available share bounds is at least one before using them.
The unit of sampling: documents or tokens?
You can define over documents, tokens, or characters. The document and token distributions differ when mean tokens per document vary across represented languages. Fertility and document length can offset each other. Suppose one corpus averages 50 words per document at two tokens per word and another averages 100 words at one token per word. Both average 100 tokens per document, so their document and token shares agree.
The ambiguity is easy to miss because most mixture descriptions say "share" without specifying the unit. Two papers can report the same and produce different effective mixtures because one computed over documents and the other over tokens. When you reproduce a mixture, the first thing to check is which denominator the original used.
Suppose Yoruba needs 2.6 tokens per word and English needs 1.0. With fixed-length sequence packing and comparable compute per token, a Yoruba word consumes about 2.6 times the token budget of an English word. The average cost per document also depends on document length. For example, with 60 words in the average Yoruba document and 120 in the average English document, the ratio is .
To estimate token share from document sampling, multiply each document share by mean tokens per document and normalize. Measure mean tokenized length directly, or multiply the corpus-level ratio of total tokens to total words by mean words per document for the same set of documents. If you average per-document fertility first, this identity can fail when fertility and length covary.
Batch composition
Suppose the sequences in a batch are drawn independently and each draw has probability of selecting language . The expected count is and the probability of at least one appearance is . At , the expected count is about 0.51 and the language appears in roughly 40% of batches. At , it appears in roughly 5% of batches.
These probabilities help you interpret the training signal:
- At , the expected count is one, yet at about 37% of batches still omit the language. Use this as a coverage check. To study gradient variance, also measure what gradients the selected examples contribute.
- Language-homogeneous micro-batches can make it easier to measure per-language gradients. At fixed parameters, regrouping the same weighted examples gives the same mathematical gradient sum when each example uses the same stochastic draws and its forward computation and loss are independent of its batch companions. Batch normalization or a loss that compares examples within a micro-batch can change that sum.
Compare predicted coverage with loader logs. For example, a quota of one sequence per language in every eligible batch gives presence probability one for those languages, while independent sampling would give probabilities below one for smaller shares.
If a language’s loss changes abruptly, check the delivered exposure over the same steps. Inspect other changes, including the sampled documents and learning-rate schedule, before linking the pattern to a scarce language.
Per-batch frequency is a different view of the same mixture. The next cell computes the probability that a language appears at least once in a batch of 512 sequences, and the figure shows how that probability changes with the exponent for a head language and two tail languages.
PythonIn [5]Expand
import numpy as np
batch_p = tilt_p
batch_langs = ["English", "Swahili", "Yoruba"]
batch_idx = [0, 5, 7]
batch_alphas = np.linspace(0.0, 1.0, 51)
batch_q = np.power(batch_p[None, :], batch_alphas[:, None])
batch_q = batch_q / batch_q.sum(axis=1, keepdims=True)
batch_size = 512
batch_inclusion = 1.0 - np.power(1.0 - batch_q[:, batch_idx], batch_size)VisualizationOut [6]Expand

Staging and annealing
A staged sampler can vary the language mixture over training. Compare a fixed baseline with a staged schedule at the same total token budget. The two schedules below specify how to construct a comparison.
- Broad then sharp: start with a smaller and later raise it. The early mix is flatter on the original positive shares.
- Proportional then boost: start at and later increase tail-language weights, for example by lowering .
A gradual decrease in also moves the mixture toward a flatter distribution. Choose a schedule to test and record the delivered shares before and after the change.
Compare the schedule with a fixed-mixture control. Evaluate both under corpus weighting and under a weighting chosen for the deployment or product.
If the aggregate scores disagree, inspect per-language changes and their evaluation weights. The two reported scores can disagree even when evaluated on the same predictions. Use a separate sample of traffic to assess deployment generalization.
Quality and mixture interact multiplicatively
Upsampling multiplies whatever is in the corpus, including its defects. Three interactions matter most:
If you sample a language twelve times as often and sample uniformly within it, mislabeled examples from that language also appear twelve times as often in expectation. A 2% mislabel rate within the language stays at 2%. The increase is in the mislabeled examples' share of the overall mixture. Their contribution to the gradient also depends on the gradients of those examples.
- Language identification errors. Caswell et al. found that many examples in some lower-resource web-crawl language buckets were written in a different language. With the same within-language sampler, sampling the bucket twelve times as often also multiplies the expected count of mislabeled draws in that bucket by twelve.
- Quality thresholds. CCNet uses per-language language models and splits documents into three within-language perplexity groups. Those groups rank relative perplexity for a given language. Check per-language retention if you use a global threshold. Wenzek et al. (2020), section 3.4
- Deduplication thresholds. Run a duplicate audit at the scale of each language, using both raw and surviving document counts. Look for templates that still dominate the retained material.
Reweighting a fixed bucket with uniform within-language draws increases exposure to each kept item, including defects. Pair the effective-epochs check with a sample-based quality audit for the languages whose draws increase.
All three are covered in more depth in Quality Filtering and Deduplication. The reason to raise them here is that a mixture decision is partly a data-cleaning decision: the more you upweight a language, the higher the quality bar it needs to clear.
A practical implication: before increasing a language's multiplier or lowering globally, run the quality metrics for the languages that will gain the most. If their mislabeled rate or duplicate rate is high, fix that first. Otherwise you are paying to amplify noise.
Learned mixtures
Hand-tuned and are the baseline. DoReMi uses a small proxy model and group DRO to learn domain weights using excess loss. Ye et al. fit loss as a function of domain-mixture proportions and optimize the resulting curve. Their experiments concern domain mixing. A per-language multiplier can express preferences a single exponent cannot, such as giving distinct shares to languages with the same natural share. Xie et al. (2023) · Ye et al. (2024 preprint)
A proxy gives you a way to search for weights under a stated objective. Compare the candidates with a baseline under that objective before testing them at target scale.
Validate learned weights at the scale of the intended model. If the objective weights one language lightly, verify that the selected mixture still meets its evaluation targets or minimum-coverage requirements.
A small proxy can prioritize a different mixture from the final model. To check transfer, compare the learned mixture against a baseline in a shorter target-scale run and report which languages gain or lose.
Choose objective weights to reflect which outcomes matter. A language-uniform average, a worst-language criterion, and a corpus-weighted average assign different importance to the same per-language scores. You can also impose minimum language shares.
Capacity Allocation
Sampling controls how often examples reach the optimizer. The model definition controls which parameters and vocabulary entries are shared. Test a change in each when you need to distinguish their effects.
The curse of multilinguality
In Conneau et al.’s fixed-budget experiments, adding languages improved some results initially and later reduced performance. They called this the curse of multilinguality. Increasing capacity mitigated the measured degradation in their comparison. Conneau et al. (2020), section 5
Treat the observed trade-off as a reason to measure how capacity and exposure interact in your model.
Conneau et al. (2020), Figures 2 and 4 report XNLI classification accuracy for multilingual masked language models trained with different language counts. Figure 4 also compares fixed Transformer width with increased width. A separate experiment varies vocabulary size.
The toy model later in the chapter gives one explanation for how shared parameters can lead to compromises. It assigns each language a distinct optimum and restricts the fit to one shared point. A claim about feature geometry in a transformer would require separate measurements.
Test how loss responds to additional data and to a larger model independently. Extra data can improve estimates at fixed model size. In the XLM-R capacity experiment, increasing capacity mitigated some measured degradation with more languages.
A mixture change can move losses in different directions. Compare both the language-level losses and their weighted aggregate. The aggregate depends on the evaluation weights and the measured outcomes.
For an underperforming language, compare a run with more delivered exposure against a run with more parameters. Keep the other experimental settings fixed where possible and interpret the differences as evidence for which follow-up to run.
Where to put language-specific parameters
Between "everything shared" and "one model per language" there is a spectrum:
The table shows which components a design shares and what a deployment has to select or load.
| Design | Language-specific | Shared | Notes |
|---|---|---|---|
| Fully shared | No language-specific parameter blocks | Model and vocabulary | mBERT, XLM-R, and mT5 share weights across languages. |
| Language adapters | Language-specific adapter modules | Backbone | MAD-X provides language adapters. A deployment that selects one module per request must route requests to the corresponding module. |
| Language-specific embeddings or tokenizers | Separate embedding table or tokenizer | Transformer body | This design changes the embedding footprint or how text is segmented. |
| Sparse experts | Routed FFN experts | Components outside the expert layers | A sparse layer can add parameters while evaluating only selected experts per token. Measure routing and load for your mixture. |
| Specialized then merged | Separate branches during training | One resulting model or routed expert model | Branch-Train-Merge trains independent branches and merges them. Branch-Train-MiX combines expert branches into a sparse MoE. |
| Separate models | Independently trained language-specific parameters | Serving infrastructure may still be shared | Each request can use just one model. Storing all the checkpoints adds their individual storage costs. |
A shared model keeps one copy of its weights. Independent runs with disjoint parameter sets have no shared-parameter interference or transfer during those runs. Compare total checkpoint storage, loaded weights, and per-request compute separately.
When inference selects a language adapter, determine the adapter from the request or routing model. A mixed-language batch may require grouping by adapter or a runtime with per-example adapter selection.
A sparse expert layer activates only selected experts. For a multilingual mixture, inspect selections and token counts per expert by language before deciding if the load is imbalanced.
Branching allows separate training runs to start from a common checkpoint. In a comparison with merging, evaluate transfer, serving cost, and low-resource performance on the same languages.
Compare serving cost, per-language gains, and per-language regressions for each design. The outcome can depend on the parameter budget, batching, expert activation, and what languages the workload needs.
At fixed architecture, number of processed tokens, sequence lengths, and similar packing, changing language shares need not increase model FLOPs. The measured cost can change when the batches change. Adding a language adapter changes the artifact and adds a routing requirement when the service selects language-specific modules.
Test the sampler with the architecture held fixed before interpreting an adapter gain. If both the mixture and the model changed, run matched comparisons to estimate their contributions.
For example, compare a baseline sampler and a tuned sampler with and without the same adapter. Use identical evaluation sets in all four runs.
Positive transfer is the reason any of this works
Transfer can vary by language and task. Evaluate candidate donor languages with the target task held fixed.
In the quadratic example below, each separate fit can take its language’s known optimum. With distinct optima and one shared fit, at least one language incurs additional squared error. The optima can also coincide. With finite training data, measure whether sharing improves held-out results for the target language. A shared deployment can also reuse a checkpoint.
- Script overlap: compare the fraction of actual subword IDs shared between the languages. This measures a property of the chosen tokenizer.
- Typological proximity: Lin et al. used linguistic and corpus features to select donor languages in their evaluated cross-lingual tasks. Lin et al. (2019)
- Donor corpus size: vary donor volume while holding the target and evaluation constant if you want to estimate its effect.
For a simple overlap check, take one token-ID set per language and count the intersection. Shared punctuation or special IDs can contribute across scripts. Report how you handle them.
Treat typological features as candidate predictors of transfer. Select donors based on measured outcomes for the target task, and use the same test when evaluating a revised mixture.
Compare a mid-sized related donor with a larger unrelated donor at matched tokens before attributing a difference to relatedness.
Compare any donor-weighted mixture with uniform and corpus-weighted baselines on the objective you plan to report. Equal shares can be appropriate, as they are for the language-uniform objective in the toy below. Real donor effects can change which mixture works best. The next chapter examines cross-lingual transfer and alignment.
Two languages with the same natural share receive the same multiplier from the global exponent. If controlled donor comparisons favor different allocations, test them with language-specific multipliers.
Diagnosing which limit you are hitting
A short decision procedure, run after a training run of a few thousand steps:
The procedure below is deliberately short. It is meant to be run after a few thousand steps, before committing to a full training run, and it is designed to distinguish the three failure modes: attention, capacity, and tokenization.
- Measure delivered exposure. Log per-language token counts, loss weights and validation curves. If available, inspect per-language gradients before the optimizer step, since the token fraction alone gives no gradient magnitude. A flat loss curve at low exposure is a reason to test a lower in a controlled run.
- Check whether raising its share costs the head. Compare with . If head and tail results move in opposite directions, record the trade-off and test whether capacity or changing exposure explains it.
- Check whether degradation tracks language count. Compare a 10-language subset with a 100-language mix at equal total token budget. Changing the language count can alter exposure to the shared languages, so track their delivered tokens. Vary model size or vocabulary separately to test a capacity explanation.
- Check tokenizer fertility per language. At 2.5 times as many tokens per word, a fixed token budget covers 40% as many words, under comparable tokenized length assumptions. Measure effective context and document lengths before changing the vocabulary or the sampler.
A high, flat loss at low delivered exposure makes limited attention a plausible explanation. Check whether loss changes after increasing the share while holding the other training choices fixed.
A head regression concurrent with tail gains records a trade-off at the current settings. Test another model size or compare delivered per-language exposure before attributing it to capacity.
The same total token budget does not imply the same exposure per language. Report exposure differences alongside language-count ablations and use a separate capacity comparison.
Read fertility in the unit your budget constrains. With comparable word counts, high fertility increases the token cost per document. Compare changing the tokenizer and changing the sampled shares while tracking validation loss and context coverage.
Log the diagnostics for each language. Investigate a single outlier by checking the data sample, exposure, fertility, and evaluation labels before selecting a remedy.
Worked Example: One Exponent, Two Languages
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.
Implementation: Building and Inspecting a Mixture
We start with imports and an illustrative corpus. The counts are the ones in the table above, in millions of surviving documents.
The code in this section is deliberately minimal. The sampler itself is three lines; everything else is diagnostics, because the diagnostics are where the understanding lives. The goal is not to provide a production data loader but to make the quantities in the equations visible and manipulable.
PythonIn [7]Expand
import numpy as np
import pandas as pd
rng = np.random.default_rng(7)
languages = [
"English",
"Chinese",
"Spanish",
"Arabic",
"Hindi",
"Swahili",
"Welsh",
"Yoruba",
]
# Millions of documents surviving filtering. Skewed, but less skewed than raw crawl.
p = tilt_pThese illustrative counts define a large head and small tail. All language shares in the fixture are positive, so the code’s zero-exponent endpoint is unambiguous on this input.
The sampling function is three lines. Everything else in this section is diagnostics.
PythonIn [8]Expand
def temperature_mixture(p, alpha):
"""Renormalised mixture weights q_i proportional to p_i ** alpha."""
w = np.power(p, alpha)
return w / w.sum()
alphas = [1.0, 0.5, 0.3, 0.1, 0.0]This helper only normalizes the exponentiated shares. The chapter gives a separate cap function, shows document-to-token conversion inline, and specifies language multipliers in an equation.
Now build the comparison table. At the column is just the natural share; at every language is at 0.125.
PythonIn [9]Expand
table = pd.DataFrame({"p (natural)": p}, index=languages)
for a in alphas:
table[f"alpha={a}"] = temperature_mixture(p, a)
mixture_shares = table.iloc[:, 1:].to_numpy().T
print(table.round(4).to_string())ConsoleOut [9]Expand
p (natural) alpha=1.0 alpha=0.5 alpha=0.3 alpha=0.1 alpha=0.0 English 0.5772 0.5772 0.3358 0.2410 0.1591 0.125 Chinese 0.1757 0.1757 0.1852 0.1687 0.1413 0.125 Spanish 0.1004 0.1004 0.1400 0.1426 0.1336 0.125 Arabic 0.0690 0.0690 0.1161 0.1275 0.1287 0.125 Hindi 0.0502 0.0502 0.0990 0.1158 0.1247 0.125 Swahili 0.0151 0.0151 0.0542 0.0807 0.1105 0.125 Welsh 0.0075 0.0075 0.0383 0.0656 0.1031 0.125 Yoruba 0.0050 0.0050 0.0313 0.0581 0.0990 0.125
Reading the table from left to right shows the compression directly. At the columns are the natural shares. At the ratio between English and Yoruba has fallen from roughly 115:1 to roughly 11:1. At it is roughly 4:1. At it is 1:1. The head never disappears until the exponent hits zero, which is why temperature sampling is described as compression rather than balancing.
The table also shows a subtlety that is easy to miss: the middle-tier languages move relatively little compared to the extremes. Spanish at 10% goes to about 14% at , while English falls from 57.7% to 24.1% and Yoruba's share rises nearly twelvefold. Temperature sampling is most active at the extremes; the middle is comparatively stable.
At , English falls from 57.7% to about 24.1% of the mixture while Yoruba rises from 0.50% to about 5.8%. Note that the head is still larger than the tail: temperature sampling compresses the distribution, it does not flatten it.
The share alone hides the repetition cost, so let us compute effective epochs directly.
PythonIn [10]Expand
q03 = temperature_mixture(p, 0.3)
epochs = q03 / p
print(f"{'Language':<10}{'share p':>10}{'share q':>10}{'epochs/pass':>14}")
for lang, pi, qi, ei in zip(languages, p, q03, epochs):
print(f"{lang:<10}{pi:>10.4f}{qi:>10.4f}{ei:>14.2f}")ConsoleOut [10]Expand
Language share p share q epochs/pass English 0.5772 0.2410 0.42 Chinese 0.1757 0.1687 0.96 Spanish 0.1004 0.1426 1.42 Arabic 0.0690 0.1275 1.85 Hindi 0.0502 0.1158 2.31 Swahili 0.0151 0.0807 5.36 Welsh 0.0075 0.0656 8.71 Yoruba 0.0050 0.0581 11.57
English receives about 0.42 effective epochs per pass and Yoruba about 11.6. The second number measures the expected volume of draws from the existing Yoruba corpus.
English at 0.42 means fewer than half as many draws as there are English documents per pass. Yoruba at 11.6 means the expected number of draws is nearly twelve times its corpus size. The loader determines which documents account for those draws.
Figure @fig-temperature-shares shows the same numbers across the exponent grid.
VisualizationOut [11]Expand

The bar heights show English losing share and Yoruba gaining it as the mixture approaches uniform. Middle languages can change direction across the sweep. The ordering of languages is preserved for positive exponents even when an individual language's share rises and then falls.
Figure @fig-effective-epochs plots expected repetition on a log scale. An audit can use these expected rates alongside measured corpus coverage and held-out performance.
VisualizationOut [12]Expand

Above the dashed line, the expected draw volume exceeds the corresponding corpus size. Yoruba is close to 11.6 effective epochs.
The log scale keeps values visible across more than an order of magnitude. The dashed line marks expected draws equal to corpus size.
A mixture table shows Yoruba at 5.8% of the draws. That share gives the loader a budget approaching twelve times the size of the Yoruba corpus per nominal pass.
Capping a language's mixture share
A common share cap limits how much mixture mass any single language can receive. For eight languages, the cap must be at least 12.5% because the shares must sum to one. The algorithm fixes languages that would exceed the cap and divides the remaining mass among the free languages in proportion to their original weights.
PythonIn [13]Expand
def capped_mixture(p, alpha, cap):
"""Return capped shares for a corpus with positive language weights."""
if not p.size or not 1.0 / p.size <= cap <= 1:
raise ValueError(
"The cap must allow all language shares to sum to one."
)
if cap == 1.0 / p.size:
return np.full(p.size, cap)
weights = temperature_mixture(p, alpha)
shares = np.zeros_like(weights)
free = np.ones(p.size, dtype=bool)
while free.any():
remaining = 1.0 - shares.sum()
free_weights = weights[free]
proposed = remaining * free_weights / free_weights.sum()
over = proposed > cap + 1e-12
if not over.any():
shares[free] = proposed
break
fixed = np.flatnonzero(free)[over]
shares[fixed] = cap
free[fixed] = False
return sharesAt the minimum cap, every share must equal the cap. The helper returns that uniform vector directly. Above the minimum, each iteration either finishes or fixes at least one additional language. The tolerance in the loop accounts for small roundoff in candidate shares.
PythonIn [14]Expand
for n_languages in (49, 98):
uniform_cap = 1.0 / n_languages
positive_weights = np.arange(1, n_languages + 1)
np.testing.assert_array_equal(
capped_mixture(positive_weights, 0.3, uniform_cap),
np.full(n_languages, uniform_cap),
)
share_cap = 0.13
capped_shares = capped_mixture(p, 0.3, share_cap)
capped = pd.DataFrame(
{
"alpha=0.3 (uncapped)": q03,
"alpha=0.3, cap=0.15": capped_mixture(p, 0.3, 0.15),
f"alpha=0.3, cap={share_cap:.2f}": capped_shares,
},
index=languages,
)
print(capped.round(4).to_string())ConsoleOut [14]Expand
alpha=0.3 (uncapped) alpha=0.3, cap=0.15 alpha=0.3, cap=0.13 English 0.2410 0.1500 0.1300 Chinese 0.1687 0.1500 0.1300 Spanish 0.1426 0.1500 0.1300 Arabic 0.1275 0.1500 0.1300 Hindi 0.1158 0.1447 0.1300 Swahili 0.0807 0.1008 0.1300 Welsh 0.0656 0.0819 0.1167 Yoruba 0.0581 0.0725 0.1033
At 15%, English falls from 24.1% and Chinese from 16.87% to the cap. A cap of 13% redistributes more mass to the languages that remain below it. A common cap limits absolute mixture share. To limit a particular language to at most effective epochs, use a language-specific bound .
The next figure compares effective epochs before and after applying the 13% share cap. Redistribution increases the expected draw volume for Welsh and Yoruba even though both remain below the cap.
PythonIn [15]Expand
cap_epochs = capped_shares / p
uncapped_epochs = q03 / p
cap_x = np.arange(len(languages))VisualizationOut [16]Expand

The unit question, in code
Fertility changes what a share means. Suppose we sample documents at with the fertility values below. The resulting token shares can differ from the document shares.
The fertility values below are illustrative. Assume equal mean word counts per document across languages so that fertility ratios also give the ratios of mean tokenized document lengths.
PythonIn [17]Expand
# Tokens per whitespace-separated word, illustrative but in the realistic range
fertility = np.array([1.0, 1.6, 1.2, 1.4, 1.8, 2.2, 1.7, 2.6])
expected_tokens_per_word = q03 @ fertility
compute_share = q03 * fertility / expected_tokens_per_wordThis calculation uses token share as a compute proxy under comparable cost per token. Replace the fertility vector by mean tokens per document if average document lengths differ. If processing one group includes extra padding, count those processed positions separately when estimating its compute.
PythonIn [18]Expand
unit_check = pd.DataFrame(
{
"document share": q03,
"tokens per word": fertility,
"token share (compute proxy)": compute_share,
},
index=languages,
)
print(unit_check.round(4).to_string())
print(
f"\nMean tokens per word under this mixture: {expected_tokens_per_word:.2f}"
)ConsoleOut [18]Expand
document share tokens per word token share (compute proxy) English 0.2410 1.0 0.1597 Chinese 0.1687 1.6 0.1789 Spanish 0.1426 1.2 0.1134 Arabic 0.1275 1.4 0.1182 Hindi 0.1158 1.8 0.1382 Swahili 0.0807 2.2 0.1177 Welsh 0.0656 1.7 0.0739 Yoruba 0.0581 2.6 0.1000 Mean tokens per word under this mixture: 1.51
With equal mean document lengths in words, Yoruba’s token share divided by its document share is its fertility divided by the mixture-weighted average fertility, about . With comparable cost per token, this ratio serves as a compute proxy. For a FLOP budget, also account for processing factors such as padding and sequence length.
The lesson is not that one unit is correct. It is that the unit must be stated. A mixture reported in documents and a mixture reported in tokens can look identical in a table and behave very differently in training. When you compare two published mixtures, or when you hand a mixture to an engineer, specify the unit, the fertility assumption, and whether the shares are before or after capping.
The next cell divides each language’s token share by its document share. Bars above one show languages with a larger share of tokens than documents in this example.
PythonIn [19]Expand
unit_ratio = compute_share / q03
unit_x = np.arange(len(languages))VisualizationOut [20]Expand

A Toy Model of Transfer-Interference
Sampling shares do not tell you what happens to accuracy. To see the trade-off, we need a model with shared capacity. The smallest one that exhibits interference is a single linear map trained on data from several languages whose optimal maps differ slightly.
The toy is deliberately minimal. It strips away tokenization, optimization, and architecture, and keeps only the part of the problem that produces interference: multiple languages with different optima sharing one set of weights. If the trade-off appears here, it is not an artifact of scale or training instability; it is a property of sharing.
Let language have optimum (we drop the shared component because it cancels out of the risk expression below), and let inputs satisfy . A model must choose one weight vector for all languages. Under mixture , the population objective is
The identity raw second moment gives each language an isotropic squared-distance penalty. If all languages share an invertible second moment , the normal equations cancel and the weighted mean still holds. For different per-language moments , the equation becomes .
A shared fit must compromise when the participating languages have distinct unique optima. With singular moments, the minimizing sets can intersect. If one language constrains only the first coordinate and another only the second, the shared vector can satisfy both. For the identity case used in this toy, set the gradient to zero:
The result is worth pausing on. The model does not learn a compromise that is equally bad for everyone; it learns the mixture-weighted average of the optima. Languages whose optima are close to that average are well served. Languages whose optima are far from it are poorly served, and the farther they are, the worse the quadratic penalty. This is why interference is not uniform: it falls hardest on the languages that are most different from the weighted consensus.
The model learns the mixture-weighted average of the per-language optima. Its risk on language is therefore
Here is a common noise floor. The toy assumes known optima and fits one shared point, so it omits estimation error from finite samples and any positive transfer between languages.
With the other languages kept in fixed relative proportions, the shared optimum follows the segment from their weighted centroid toward the target language’s optimum as its share rises. The target’s squared-distance loss decreases if those points differ and stays constant if they coincide. If several relative shares change simultaneously, check how the shared point actually moves.
A fuller model could add a term for estimation error that declines with exposure. An interior optimum then depends on the shape of that term and the interference loss. For example, for one share variable between zero and one, adding to gives an interior minimum.
PythonIn [21]Expand
n_lang = len(languages)
dim = 8
# Synthetic scale factors for the language-specific deviations.
distance = np.array([0.4, 0.5, 0.6, 0.9, 0.8, 1.4, 1.6, 1.5])
delta = rng.normal(0, 1, (n_lang, dim)) * distance[:, None]
sigma2 = 0.25
def interference_risk(p, alpha, delta, sigma2):
"""Per-language risk when a shared linear model is trained on mixture q."""
q = temperature_mixture(p, alpha)
w_star = q @ delta
return ((delta - w_star) ** 2).sum(axis=1) + sigma2
alpha_grid = np.linspace(0.0, 1.0, 51)
R = np.array([interference_risk(p, a, delta, sigma2) for a in alpha_grid])
macro = R.mean(axis=1) # every language weighted equally
micro = R @ p # weighted by natural corpus shareThe distance vector scales the random deviations in the fixture. The scales are synthetic. The realized distances from the shared optimum depend on the random directions and the mixture. The common noise floor shifts every risk by the same amount.
The macro average weights each language equally. The micro average in this fixture weights by natural corpus share. Use an independently measured user distribution if you want an average-user metric. The next printout gives the grid minimum for each of the two plotted objectives.
PythonIn [22]Expand
print(f"alpha minimising micro average: {alpha_grid[np.argmin(micro)]:.2f}")
print(f"alpha minimising macro average: {alpha_grid[np.argmin(macro)]:.2f}")
print(
f"risk at alpha=1.0 -> micro {micro[np.argmin(np.abs(alpha_grid - 1.0))]:.3f}, "
f"macro {macro[np.argmin(np.abs(alpha_grid - 1.0))]:.3f}"
)
print(
f"risk at alpha=0.3 -> micro {micro[np.argmin(np.abs(alpha_grid - 0.3))]:.3f}, "
f"macro {macro[np.argmin(np.abs(alpha_grid - 0.3))]:.3f}"
)
print(f"risk at alpha=0.0 -> micro {micro[0]:.3f}, macro {macro[0]:.3f}")
alpha03_index = np.argmin(np.abs(alpha_grid - 0.3))
for objective, risks in (("Micro", micro), ("Macro", macro)):
minimum = risks.min()
excess = risks[alpha03_index] - minimum
print(
f"{objective} excess at alpha=0.3: {excess:.3f} ({excess / minimum:.1%})"
)ConsoleOut [22]Expand
alpha minimising micro average: 1.00 alpha minimising macro average: 0.00 risk at alpha=1.0 -> micro 1.729, macro 7.252 risk at alpha=0.3 -> micro 1.873, macro 6.896 risk at alpha=0.0 -> micro 2.246, macro 6.735 Micro excess at alpha=0.3: 0.144 (8.3%) Macro excess at alpha=0.3: 0.161 (2.4%)
Weighted least squares minimizes the risk measured with its own weights. Here gives a micro-risk minimizer because the fit uses natural corpus shares. Setting gives a macro-risk minimizer because the fit gives every language equal weight.
In this seeded fixture, the intermediate exponents on the grid have higher micro risk than the micro minimum and higher macro risk than the macro minimum. The general least-squares result allows ties. If the two weighted means coincide, both objectives can share a minimizer.
At in this fixture, the micro risk exceeds its own minimum at by 0.144 MSE, about 8.3%. The macro risk exceeds its own minimum at by 0.161 MSE, about 2.4%. The percentages divide each excess by that objective’s own minimum.
Figure @fig-per-language-risk shows why the compromise is not a simple "everyone moves together."
VisualizationOut [23]Expand

As decreases from 1 to 0, English and Chinese risk rise throughout the sweep. Spanish risk first falls and then rises, with a grid minimum at . The shared fit can pass closer to a language's optimum at an intermediate mixture. Welsh and Yoruba each end with lower risk than they started with, despite a brief rise near . Report per-language validation results alongside the aggregate so you can spot these different responses.
The aggregate view is Figure @fig-macro-micro.
VisualizationOut [24]Expand

On this fixture’s grid, as increases from 0 to 1, corpus-weighted risk falls from 2.25 to 1.73 and language-uniform risk rises from 6.73 to 7.25. At , the objectives are about 1.87 and 6.90, respectively. Compare movements along each curve to judge the effect of a mixture change.
The two controls in this fixture are the synthetic deviation scales and the common noise floor. For a transfer experiment, compare whether access to a donor language improves held-out outcomes in the target language.
Compare real sweeps against their own controls. With three different optima, a language’s share can rise while a redistribution of the other weights moves the shared point away from that language. Log the other shares before attributing a tail regression to data quality or tokenization.
Limitations and Impact
A single exponent expresses one reweighting of the natural corpus. If product coverage, corpus quality, or evaluation priorities matter, add an explicit target or constraint. When reporting an exponent, name the corpus and the objective you used to select it.
A benchmark average gives weight to the scores it includes. A population-weighted average gives a language more weight when its measured speaker population is larger. If higher scores are better, a worst-language objective targets the lowest measured score, which can belong to a language with a large corpus. Record the objective and its weights alongside per-language results in the model card.
An exposure change may improve some languages and degrade others. Report the per-language changes and the aggregate under your chosen evaluation weights. Check a capacity or vocabulary change before attributing the trade-off to shared parameters.
Use short runs at two exponents to probe sensitivity. Follow up with separate exposure, capacity, tokenizer, and quality interventions when those explanations remain plausible.
Two limitations matter in practice. First, sampling from a fixed bucket gives its label errors and duplicates more draws when its weight rises. Second, benchmark construction varies. XNLI translated English source material. Belebele uses FLORES-200 passages and human translations of English questions and answer options across 122 language variants, including English. TyDi QA collected questions directly in each language. XNLI · Belebele · TyDi QA
Check memorization or overfitting before carrying a high-reuse mixture forward. Compare duplicate exposure, training behavior, and held-out per-language quality.
If the evaluation covers only ten languages, report that scope. Add separate checks for languages that the deployment needs and the benchmark omits.
XLM-R’s large model has 550M parameters, as listed in Appendix Table 7 of the ACL paper. It trained on 2.5 TB of filtered Common Crawl text covering 100 languages. Its stated pretraining used multilingual masked language modeling on monolingual text and omitted the explicit aligned-bitext translation language modeling objective. The authors report gains over earlier multilingual baselines on cross-lingual benchmarks. mT5 uses an encoder–decoder and a 101-language corpus. BLOOM reports natural-language and programming-language training sources in ROOTS.
Report performance per language. An aggregate can conceal which languages gain from the shared model and which still need a different mix or design.
The next chapters discuss cross-lingual transfer and low-resource language modeling. Use per-language results and data-quality measures alongside the mixture when describing how well the model serves each language.
The next two chapters extend this argument. Cross-lingual transfer and alignment is where the tail borrows structure it cannot collect, and low-resource and endangered languages is where the constraints stop being purely statistical. The mixture decisions made here set the stage for both.
Summary
A multilingual model shares one budget across many languages, and training it is mostly a question of how to divide that budget.
The chapter's argument can be compressed into a handful of claims. Each is a decision point, and each has a default that is defensible but not universal.
- The natural corpus distribution is an artifact of crawling, not a statement of need. Rebalance deliberately, and state which objective you are optimizing.
- Temperature-based sampling sets . It is monotone in the natural share, easy to reason about in log space (), and free at inference. XLM-R and mT5 both used after sampling experiments. Use it as a baseline and select the exponent against your own validation criteria.
- Effective epochs, , measure expected draws relative to corpus size in a corpus-sized nominal pass. At , the expected draw volume is about 11.6 Yoruba corpus-equivalents and 0.42 English corpus-equivalents. Inspect actual coverage and quality where reuse is high.
- Beyond one exponent: multipliers set individual priorities, and caps bound shares or expected draws under their stated interpretation. Name the unit of share.
- Capacity is the other half of the problem. In the XLM-R comparisons, model size and the number of training languages affected performance. Test both capacity and exposure before attributing changes to one of them.
- Diagnose before you dial. Check delivered exposure, per-language validation results, and tokenizer fertility. Use controlled changes to the mixture and model to test the likely bottleneck.
- Evaluate the mixture against your target objective. In this toy, minimizes corpus-weighted risk and minimizes language-uniform risk. For an intermediate setting, compare each objective with its own baseline and report per-language results.
The through-line is that multilingual training is an allocation problem with two levers and three failure modes. The levers are sampling and capacity; the failure modes are attention, representation, and tokenization. Matching the lever to the failure mode is the skill, and the diagnostics in this chapter are designed to make that match visible before a full training run commits to the wrong setting.
Quiz
Ready to test your understanding? Take this quick quiz to reinforce what you've learned about multilingual pre-training and data balancing.
Multilingual Pre-training and Data Balancing
Join the discussionAsk a question or share what you learned.
Keep exploring
Reference
Citation details
Cite or share this article.


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!