Cross-Lingual Transfer and Alignment › Why Cross-Lingual Transfer Works

Michael BrenndoerferNovember 26, 20267 min read
Language AI HandbookAll chapters
Part 26 of 67Multilingual Language Models and Cross-Lingual Transfer
Chapter 186Cross-Lingual Transfer and Alignment › Why Cross-Lingual Transfer Works
Reading section 2 of 11 · Why Cross-Lingual Transfer Works · 7 minSection 2 of 11 · 7 min

Section 2 of 11 · 7 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

The shared representation hypothesis predicts that corresponding inputs can have compatible features for a task head. “Dog,” “chien,” and “Hund” are useful to the same classifier when their representations preserve the cues it reads.

The shared representation hypothesis

Shared Representation Hypothesis

For a specified encoder and task, equivalent inputs in different languages can retain features that a shared task head can read. The prediction depends on which directions in the representation the task head uses.

Let xenx^{\text{en}} be an English sentence and xfrx^{\text{fr}} its French translation. One encoder fθf_\theta produces hen=fθ(xen)h^{\text{en}} = f_\theta(x^{\text{en}}) and hfr=fθ(xfr)h^{\text{fr}} = f_\theta(x^{\text{fr}}). Even when the two vectors are close, they can fall on opposite sides of a classifier's decision boundary. For a binary linear score s(h)=w⊤h+bs(h) = w^\top h + b, the score changes by at most ∥w∥2∥hfr−hen∥2\|w\|_2 \|h^{\text{fr}} - h^{\text{en}}\|_2. If this bound is smaller than ∣s(hen)∣|s(h^{\text{en}})|, the prediction stays the same.

This gives a way to interpret zero-shot transfer. A classifier that makes the correct English prediction can reuse it on the French input when that input stays on the same side of the boundary. For a multiclass linear head, picture a boundary between the winning class and each of its competitors. A translation can move through the embedding space while leaving the winner unchanged.

What matters is how far a translation moves in the directions the task head reads. A large change in features the head ignores can leave the prediction intact. A small change along a task-relevant direction can flip a prediction that was already close to its boundary.

A small geometric sketch makes the claim concrete: each concept has a center, and its translations sit near that center with fixed language-specific offsets.

PythonIn [3]
CollapseExpand
rng = np.random.default_rng(SEED)
concept_centers = {"dog": (0.25, 0.45), "cat": (-0.25, -0.25)}
translation_offsets = {
    "English": (0.02, -0.03),
    "French": (-0.10, 0.10),
    "German": (0.14, 0.07),
}
cluster_spread = 0.18
geometry_rows = []
for concept, center in concept_centers.items():
    for language, offset in translation_offsets.items():
        jitter = rng.normal(0.0, cluster_spread, size=2)
        geometry_rows.append(
            (
                concept,
                language,
                center[0] + offset[0] + jitter[0],
                center[1] + offset[1] + jitter[1],
            )
        )
geometry_x = np.array([row[2] for row in geometry_rows])
geometry_y = np.array([row[3] for row in geometry_rows])
geometry_labels = [
    f"{concept}: {language}" for concept, language, *_ in geometry_rows
]
VisualizationOut [4]
CollapseExpand
English, French, and German points for dog and cat. The closest dog–cat pair is about 0.33 units apart, less than the dog group’s span of about 0.50.
Six synthetic points sketch translations grouped around dog and cat concept centers. The closest cross-concept points are about 0.33 units apart, while the widest within-concept span is about 0.50 units. Proximity can help transfer when the task’s decision boundaries are also preserved.

What training signals create shared representations

Shared parameters, vocabulary, and training objectives are design choices that can affect the features a task head sees. Measure their effects on the languages and tasks you care about.

Parameter sharing across languages. XLM-R Base has 12 encoder layers and XLM-R Large has 24. Each checkpoint uses a shared multilingual encoder trained with masked prediction. Shared weights leave the encoder free to specialize its representations for different inputs. Conneau et al. (2020), §3.1

A shared subword vocabulary. XLM-R uses a 250,000-token SentencePiece vocabulary. To see which input units are shared for a language pair, compare the actual token IDs for cognates, loanwords, numbers, and punctuation. Shared token IDs establish a common input embedding. Their contextual representations can still differ. Conneau et al. (2020), §§3.1, 5

Language information. XLM-R’s authors report that the model uses no language embeddings. A model can still recover cues about language from the input, including its script and vocabulary. Check whether a task head relies on language-related features with a probe or a controlled input change. Conneau et al. (2020), §3.1

Parallel data during pre-training. XLM introduced translation language modeling. It predicts masked tokens using paired translations as context. XLM-R learned by predicting masked tokens in multilingual Common Crawl text. mT5 used a denoising objective on mC4. The XLM-R and mT5 pre-training objectives did not use sentence translation pairs. In both cases, training a single model across languages lets shared parameters and a shared vocabulary contribute to alignment. XLM, XLM-R, mT5

Use an objective that matches the output you need. Paired sentences directly supervise translation ranking. Shared masked prediction supplies a different signal. Compare the candidates on the same language pairs, domains, and metric.

Evidence for shared representations

Three measurements are useful here. Sentence retrieval tests whole-input matches, word alignment tests token correspondences, and probes test what a particular readout can recover.

Sentence level. Use a multilingual sentence encoder to measure cosine similarity for matched translations and plausible mismatches from the same domain. A high score for a translation is useful only if candidate mismatches tend to score lower. Retrieval measures how often the intended match ranks ahead of other candidates. The score distributions depend on the model, language pair, and evaluation sample.

Word level. For a parallel sentence pair, score candidate word links and compare the selected links with annotated alignments. In a display sorted by known correspondences, high scores can appear in corresponding blocks. A word-level link test can inform a token-tagging experiment. Evaluate the tagging task separately.

Probing level. Fit a simple classifier on English hidden states to predict a particular feature, such as a part-of-speech label. Apply the same readout to French or German and compare it with label-frequency and lexical baselines.

Report what each result measures. Retrieval measures where a translation ranks among candidates. Word alignment estimates links between individual units. A probe measures whether its readout can recover the selected label under the test protocol.

Where the hypothesis breaks

Alignment is not universal, and the failures tell us as much as the successes. A working engineer should assume the hypothesis holds partially, check the specific conditions of their task, and design around the failure modes.

Language-specific features can coexist with shared cues. Zhao et al. analyze this possibility in mBERT by estimating and subtracting a per-language component before evaluating word alignment and sentence retrieval. Their result concerns the tested representations and tasks. Zhao et al. (2020)

Independently learned embeddings can also be mapped across languages. MUSE initializes a mapping between monolingual word embeddings adversarially, builds a synthetic dictionary, and refines the mapping with orthogonal Procrustes. Its CSLS retrieval score adjusts cosine similarity using neighboring similarities. This experiment concerns word embeddings and bilingual lexicon induction. Conneau et al. (2018), §§2.2–2.3

Compare language-pair differences with the task held fixed. Pires et al. observe transfer across some different-script language pairs in mBERT and a relationship between transfer and typological similarity on their evaluated tasks. Use script, word order, and morphology as candidate predictors in your own comparison. Pires et al. (2019)

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!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy