Sub topic 10
The Curse of Multilinguality
Assume you know Transformer encoders, masked language modeling, and fine-tuning with Hugging Face. The curse of multilinguality is the tendency for a fixed-capacity model to perform worse on one or more languages as more languages are added. A multilingual model shares parameters, vocabulary, and training updates across languages. That sharing can enable transfer, but it also creates competition.
Why languages compete
A model has limited parameters and training time. Each language needs capacity for its vocabulary, word order, morphology, writing system, and cultural conventions. When many languages use the same parameters, the model must represent more patterns without growing proportionally.
Competition appears in several ways:
- High-resource languages contribute many more training examples.
- Low-resource languages receive fewer updates.
- A shared tokenizer may split some languages into many inefficient pieces.
- Similar languages can help one another, but unrelated languages can produce conflicting patterns.
- The model may learn behaviors that work well for dominant languages and poorly for others.
Adding a language can therefore improve the model's coverage while lowering the quality of an existing language. This is a capacity problem, not simply a question of whether the model has seen the language.
Data imbalance and language sampling
Suppose language l has n_l examples. Sampling directly in proportion to dataset size makes dominant languages control most updates. Multilingual systems often use temperature sampling, which changes the probability of selecting each language:
p_l = \frac{(n_l)^\alpha}{\sum_j (n_j)^\alpha}Here, α controls the balance:
α = 1follows the raw data distribution.α = 0samples every language equally.0 < α < 1gives low-resource languages more probability than their raw size would provide.
The following example compares sampling choices.
languages = {
"English": 1_000_000,
"Swahili": 10_000,
"Icelandic": 1_000,
}
def probabilities(counts, alpha):
weights = {
language: count ** alpha
for language, count in counts.items()
}
total = sum(weights.values())
return {
language: weight / total
for language, weight in weights.items()
}
for alpha in [1.0, 0.5, 0.0]:
print(f"alpha={alpha}")
for language, probability in probabilities(languages, alpha).items():
print(f" {language}: {probability:.3f}")Equal sampling protects small languages from starvation, but it may oversample noisy or tiny datasets. The best value depends on dataset quality, target languages, and the desired balance between average and worst-language performance.
How model builders reduce the curse
Increasing model size gives languages more shared capacity, but it increases memory, training cost, and serving cost. Sampling changes the number of updates without changing the architecture. Other approaches isolate some language-specific knowledge:
- Language adapters add small trainable modules for individual languages or groups of languages.
- Parameter-efficient fine-tuning updates a small portion of the model, reducing interference with existing languages.
- Language-specific output heads separate task decisions while keeping most representations shared.
- Improved tokenizers reduce the number of pieces required by underrepresented scripts.
- Balanced evaluation prevents strong performance in high-resource languages from hiding regressions elsewhere.
These choices involve trade-offs. Full sharing is cheaper and can transfer knowledge broadly. Separate adapters improve control but make deployment more complex. Larger models may help, but they do not automatically fix poor data quality or harmful tokenization.
Diagnosing capacity pressure
Compare a multilingual model with language-specific baselines. If a language performs well alone but poorly in the multilingual model, parameter interference or sampling imbalance may be responsible. Also compare token counts, training-example counts, and performance by language family and script.
A useful diagnostic table includes:
| Measurement | What it reveals |
|---|---|
| Examples per language | Whether training data is imbalanced |
| Tokens per sentence | Whether tokenization is inefficient |
| Per-language accuracy or F1 | Which languages lose performance |
| Macro average | Performance with every language weighted equally |
| Worst-language score | The size of the largest practical gap |
Exercise
A model is trained on 90% English data and 10% data from five low-resource languages. Which change directly reduces the chance that English dominates the updates: increasing the English dataset or applying temperature sampling with alpha below 1?
Show answer
Applying temperature sampling with alpha below 1. It flattens the data distribution and gives smaller languages a larger share of training updates.