Sub topic 14
Limitations: Tokenization Disparity, Low-Resource Gaps and Fairness
Assume you understand Transformer encoders, masked language modeling, Hugging Face tokenizers, and basic metrics such as accuracy and F1. This chapter focuses on where multilingual transfer breaks down and how to report those failures fairly.
Tokenization disparity
A multilingual model usually uses one shared subword vocabulary. A tokenizer splits words into tokens that the model can look up. Common words in high-resource languages may become one token, while words in less represented languages may split into many pieces.
For example, a word in English might use two tokens, while its equivalent in another language uses eight. The model then needs more computation for the same meaning. Long inputs also reach the model's maximum token limit sooner.
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("xlm-roberta-base")
texts = {
"English": "The weather is nice today.",
"German": "Das Wetter ist heute schön.",
"Hindi": "आज मौसम अच्छा है।",
}
for language, text in texts.items():
pieces = tokenizer.tokenize(text)
print(f"{language}: {len(pieces)} tokens")
print(pieces)Token count is not a complete measure of quality. It is, however, a useful warning signal. Compare token counts for equivalent sentences, not unrelated texts. Also inspect whether the tokenizer produces many unknown or very short fragments.
Low-resource performance gaps
A low-resource language has less usable training data than a high-resource language. “Less” can mean fewer web documents, fewer labeled examples, limited digital text, or inconsistent spelling and orthography.
Multilingual pretraining gives low-resource languages some benefit from shared parameters. However, transfer is not guaranteed. Performance often falls when:
- The language has little representation in pretraining data.
- Its script is poorly represented by the vocabulary.
- Its grammar differs greatly from languages seen during training.
- Fine-tuning data contains domain or dialect differences.
- Evaluation labels are noisy or culturally mismatched.
A low score may therefore reflect several causes at once. Do not describe it simply as a language problem. Check the data, labels, domain, tokenizer, and benchmark construction.
Fair evaluation and reporting
Evaluate every target language separately. Report the number of examples, the metric, and uncertainty when the test set is small. A macro average gives each language equal weight:
\text{macro-F1}=\frac{1}{L}\sum_{l=1}^{L}\text{F1}_lA micro average weights languages by their number of examples. It can hide poor performance on languages with small test sets.
| Report | Why it matters |
|---|---|
| Per-language accuracy or F1 | Shows which users receive weak predictions |
| Number of test examples | Puts scores in context |
| Token counts or fertility | Reveals vocabulary cost |
| Macro and micro averages | Separates equal-language and equal-example views |
Use matched test sets when possible. Keep the task, label definitions, and domain comparable across languages. If human translation created the test data, document that choice because translation can remove natural linguistic variation.
Fairness is more than equal scores
Equal accuracy does not automatically mean equal treatment. Error types matter. A model may be less reliable for names, dialects, code-switching, or culturally specific expressions. Harm also depends on how predictions are used. A small gap in a low-stakes search system has different consequences from the same gap in hiring or access decisions.
Before deployment, define acceptable error levels for each language, test important subgroups, and provide a fallback when confidence is low. Consider adding target-language data or a language-specific adapter instead of forcing one model to handle every case identically.
Exercise
A multilingual classifier has 90% accuracy in English and 72% in a low-resource language. What should you check before concluding that the model architecture is the cause?
Show answer
Check test-set size and label quality, domain differences, tokenization length, script and language similarity, pretraining coverage, and whether the two test sets measure the same task.