Multilingual Pre-training and Data Balancing › Capacity Allocation
Language AI HandbookAll chapters 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.
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!