Sub topic 6
What Makes Cross-Lingual Transfer Work or Fail
This chapter assumes you understand Transformer encoders, masked language modeling, fine-tuning, and accuracy or F1. Cross-lingual transfer means training a model on one language and using it on another language. Transfer works when the model learns features that are useful in both languages. It fails when the source and target languages, data, task, or model representations differ too much.
The main factors
A multilingual model does not transfer equally well to every language. The most important factors are:
| Factor | Usually helps transfer | Usually hurts transfer |
|---|---|---|
| Language relationship | Similar grammar or vocabulary | Very different grammar or word order |
| Script | Shared or well-covered script | Rare or poorly represented script |
| Pretraining data | Large, varied target-language data | Very little target-language data |
| Tokenization | Short, meaningful subwords | Many fragments per word |
| Task and domain | Similar labels and text types | Different domains or label meanings |
Language similarity can help because related languages often share word roots, grammar, or sentence structure. German and Dutch, for example, may transfer more easily than German and Japanese. Similarity is not enough by itself. A language can use the same script as English but still have different grammar and word boundaries.
The model also needs enough target-language exposure during pretraining. It may transfer general concepts to a low-resource language, but it can struggle with local vocabulary, spelling patterns, names, and idioms.
Tokenization and script effects
A shared tokenizer divides text from every language into subwords. A word that is common in the training data may become one or two pieces. A rare word may become many pieces. More pieces increase the sequence length and reduce the amount of meaning that fits into the model’s context window.
Scripts affect this process. Latin-script languages may share subword pieces, while languages using Arabic, Devanagari, or other scripts need separate pieces. A shared vocabulary must divide its limited capacity among many scripts and languages.
examples = {
"English": ["weather", "international"],
"German": ["Wetter", "Internationalisierung"],
"Hindi": ["मौसम", "अंतरराष्ट्रीयकरण"],
}
for language, words in examples.items():
pieces = [max(1, (len(word) + 3) // 4) for word in words]
average = sum(pieces) / len(pieces)
print(f"{language}: pieces per word = {pieces}, average = {average:.1f}")This toy calculation is not a real tokenizer. It shows the measurement to inspect: average pieces per word. Use the model’s actual tokenizer when comparing languages.
Task and data alignment
Transfer is stronger when the source and target tasks have the same meaning. Fine-tuning XLM-R on English natural language inference can transfer to German natural language inference because the labels have the same definitions. Transfer is weaker when the target data uses different conventions, such as regional sentiment expressions or a different definition of entailment.
Domain matters too. A model trained on English news may perform poorly on Swahili medical text, even if both tasks use the same labels. Differences in topic, writing style, length, and annotation quality can create a larger problem than language differences.
Fine-tuning can also damage multilingual ability. If the training set is large and narrow, the model may overfit to source-language patterns. Lower learning rates, balanced batches, and multilingual fine-tuning data can reduce this risk.
Diagnosing a transfer failure
Report results separately for every language. An average score can hide a severe low-resource gap. Compare the target language with the source language, then inspect:
- Average tokens per word and truncation rate.
- Pretraining data size and domain coverage.
- Script and language-family differences.
- Label definitions and annotation quality.
- Performance by class, not only overall accuracy.
A useful error analysis separates language errors from task errors. Translate a sample into the source language and test it again. If the translated sample succeeds but the original fails, tokenization, vocabulary, or language coverage may be responsible. If both fail, the task or domain may be the problem.
Exercise
A model performs well on English and poorly on Thai. Name two checks that can help determine whether tokenization or domain mismatch is the main cause.
Show answer
Compare Thai’s average pieces per word and truncation rate with English, then test examples from the same domain in both languages. Many Thai pieces suggest tokenization pressure; similar tokenization with different results suggests data or domain mismatch.