A Sharing Dial for Multilingual Subword Embeddings

Multilingual language models handle many languages with a single shared vocabulary of subwords, the word fragments produced by tokenizers such as Byte Pair Encoding (BPE). When two languages contain the same fragment, they share one embedding vector. That sharing is the main route by which knowledge moves from English to low-resource languages. It also causes harm. "Die" means different things in German and English but is stored as one vector. Meanwhile "and" and "und" get unrelated vectors even though they mean the same thing. Every existing fix chooses the amount of sharing once, before training, and fixes it for every language and task. We propose to make the degree of sharing a knob that can be turned at inference time. A single model is trained so that a scalar $\lambda$ controls how strongly each language's subword embeddings are pulled toward a shared cross-lingual anchor. Choosing $\lambda$ for a new language, dialect, or task then takes seconds on a small development set and requires no retraining.

The mechanism comes from medical image registration, the task of warping one brain scan onto another. In that field, the trade-off between fitting the images and keeping the warp smooth is set by a loss weight $\lambda$, and "conditional" networks are trained across a whole range of $\lambda$ so that clinicians can slide it after deployment. We transfer that idea from smoothness of a deformation field to sharing of subword embeddings across languages. We also test the premise that would make it worthwhile: that the best amount of sharing really differs across languages and tasks.

Core Claim

The question "how much should language $l$ share subword representations with other languages?" has no single right answer. It depends on script, relatedness, orthography, and the downstream task. A model trained over a distribution of sharing strengths can recover, at any chosen strength, the accuracy of a model trained specifically for that strength. It does so at roughly the cost of one training run, and selecting the strength per language and per task after training beats any single fixed choice.

Concretely, each token $t$ in language $l$ gets embedding $e_l(t) = s(t) + \Delta_l(t)$. Here $s(t)$ is the shared vector and $\Delta_l(t)$ is a low-rank, language-specific correction (a per-language matrix $A_l$ times shared token codes $B_t$, to keep the parameter count small). For each training batch we sample $\lambda$ and minimize

$$\mathcal{L}(\theta;\lambda) = \mathcal{L}_{\text{MLM}}\big(\theta(\lambda)\big) + \lambda\, \mathcal{R}_{\text{share}}\big(\theta(\lambda)\big),$$

where $\mathcal{L}_{\text{MLM}}$ is the masked-language-modeling loss (predicting hidden tokens) and $\theta(\lambda)$ denotes model weights modulated by $\lambda$. The regularizer $\mathcal{R}_{\text{share}}$ penalizes the distance between the full embeddings of aligned token pairs across languages. Those pairs include identical strings and, crucially, cross-script pairs found by statistical word alignment. Very large $\lambda$ approximates hard tying of anchors; $\lambda = 0$ leaves each language free. This mirrors exactly how the registration loss weight is both an input to the network and a weight in its training loss.

Relation to Prior Work

Three papers supply the method. Conditional Deformable Image Registration with Convolutional Neural Network trains a registration network over a range of loss weights. It feeds $\lambda$ through small mapping networks into per-layer scale-and-shift parameters inside normalization layers. It reports that giving each layer its own mapping beats a single central mapping or simply appending $\lambda$ to the features, and that one conditional model matches separately trained models while cutting training time about 7x across 7 settings. Neural Pre-processing and cIDIR confirm the pattern with other conditioning routes. We reuse the per-layer scale-and-shift design, applied to the normalization layers of a transformer. We also inherit its known weakness: performance collapses when $\lambda$ leaves the training range. We therefore sample $\log\lambda$ over a wide interval and report behavior at the edges.

Two papers motivate the gap. Subword Mapping and Anchoring across Languages (SMALA) aligns separately learned subword spaces and hard-ties mutual nearest neighbours. It raises zero-shot Arabic XNLI from 45.8% to 62.3%, but the tie is binary and fixed before training. Overlap-based Vocabulary Generation (OBPE) biases the vocabulary toward overlap among related languages, lifting average low-resource XNLI accuracy from 55.6% to 58.1%, again as a one-time preprocessing choice. Our proposal makes the strength of anchoring a continuous, post-hoc decision rather than an architectural commitment.

Three findings shape the design. A Systematic Analysis of Subwords and Cross-Lingual Transfer finds that the tokenizer choice that helps joint multilingual training (Unigram) differs from the one that helps transfer to a new language (BPE), and that orthographic conventions can block transfer more than linguistic distance. This is direct evidence that no single sharing level is right everywhere, and it is the hypothesis we test first. Beyond Literal Token Overlap shows that statistical alignability predicts transfer across scripts with zero surface overlap, with Spearman correlation −0.64 versus −0.45 for distributional divergence. We use alignment-derived pairs in $\mathcal{R}_{\text{share}}$ so that the dial also acts between Latin and non-Latin scripts. On the Pareto Front of Multilingual NMT shows that static weighting of languages can produce a U-shaped trade-off from low-resource overfitting. That warns us the $\lambda$-to-accuracy curve may be non-monotone, so we search it rather than assume a direction.

The closest neighbours differ in what is conditioned. Hyper-X generates adapter weights from categorical task and language embeddings and never touches the input embeddings or a continuous trade-off. HYPEROFA uses a hypernetwork only to initialize new-language embeddings, then discards it. INCLINE has a continuous inference-time strength $\alpha$, but it steers the last token's hidden state toward English using matrices fit on parallel data. It leaves the subword embeddings untouched.

Research Program

We start from a pretrained multilingual encoder (an XLM-R-sized model). We add the low-rank language-specific corrections and the per-layer $\lambda$-modulation, then continue masked-language-model pretraining on monolingual text for the 12 languages in 3 families used by OBPE, plus several non-Latin-script languages. Aligned token pairs are extracted with a statistical word aligner on FLORES-200 and other available bitext, filtered by alignment probability. This gives cross-script anchors without hand-made dictionaries. During pretraining, $\lambda$ is resampled per batch.

At deployment, the user fine-tunes once on English task data, with $\lambda$ still sampled so the task head works across the dial. The user then picks a $\lambda$ for each target language and task by sweeping it on 100–500 development examples. Each sweep point costs one forward pass over the development set.

The analysis asks three questions. First, does the best $\lambda$ vary systematically, for example by script, by relatedness to English, or by task (syntax-heavy part-of-speech tagging versus meaning-heavy inference)? Second, does the conditional model at each $\lambda$ match a model trained statically at that $\lambda$? Third, do false-friend tokens like "die" end up carrying their divergent meaning in the language-specific correction at low $\lambda$? We test the third by probing word-sense separation on bilingual lexicon induction (MUSE).

Baselines

The naive reference point is the same encoder continued-pretrained on the same text for the same number of tokens, with its ordinary shared vocabulary and no corrections or dial. It shows whether anything beyond extra pretraining matters.

The strongest existing methods are SMALA-style hard tying of aligned anchors and OBPE vocabulary construction. Each is re-implemented on our language set and given the same pretraining token budget. SMALA is the most direct competitor because it is the best static answer to the same question of which subwords should share. Its reported Arabic XNLI jump from 45.8% to 62.3% (Subword Mapping and Anchoring across Languages) comes from a bilingual setup, so we compare against our reproduction, not that number. For OBPE, the reported reference is 58.1% average low-resource XNLI accuracy (Overlap-based Vocabulary Generation).

The strongest baseline on the "tunable" axis is a grid of five static models, each trained at one fixed $\lambda$, with the best one chosen per language and task on the same development examples. This grid is given five times our training compute. Beating it means matching its per-language best within about half a point of accuracy at one fifth of the cost. Exceeding it would suggest that conditioning shares useful structure across settings.

A cheaper interpolation baseline trains only the two endpoints (fully tied and free) and linearly blends their weights, choosing the blend per language.

The key ablation removes the per-layer $\lambda$-modulation while keeping $\lambda$-sampled training. The dial then only scales the correction term. This isolates whether the network must "know" the setting, which Mok and Chung's comparison suggests it must.

We count the proposal as beating the field only if per-language selected $\lambda$ beats the best single fixed $\lambda$, SMALA, and OBPE on low-resource and cross-script languages without losing English accuracy.

Why not just…?

Why not just train a few static models and pick one per language? This is the honest competitor, and it is run directly as the five-model grid with a 5x budget. If the grid matches us and five checkpoints are affordable, the advantage reduces to compute and storage. That is real but modest; Mok and Chung report 7x savings in registration. The conditional model wins clearly only if the best $\lambda$ falls between grid points for many languages, or if a single deployable model serving many languages at different settings matters. Our sweep shows how often the first is true.

Why not just interpolate between a tied and an untied checkpoint? Weight blending is nearly free and can mimic a dial. It fails if the intermediate optima are not on the straight line between the endpoints. This is plausible given the U-shaped trade-offs reported in On the Pareto Front of Multilingual NMT. It is a live threat, and the interpolation baseline settles it. If it matches us, we would report that the cheaper method suffices.

Why not just steer hidden states at inference like INCLINE? INCLINE gains 4.96 points on XStoryCloze and 3.50 on MGSM (Bridging the Language Gaps). However, it needs about 500 parallel sentences per language, acts only on the last token, and cannot separate a false friend's meanings inside the embedding table. We apply INCLINE-style steering to our encoder's pooled representation as an additional comparison on XNLI. We also test the combination, since the two act at different depths and may add up.

Why not just fine-tune on the target language's development data? With a few hundred examples, full fine-tuning often overfits. Picking one scalar is a far smaller search. We nonetheless include few-shot fine-tuning on the same examples, and also our dial followed by that fine-tuning, to see whether $\lambda$ selection is a substitute or a good starting point.

Proposed Experiments

Evaluation uses zero-shot XNLI, Universal Dependencies part-of-speech tagging and CoNLL-style named-entity recognition (the Hyper-X setting, where Hyper-X beat mBERT by 9.0 F1 on NER in mixed supervision), MUSE lexicon induction, and DIALECTBENCH (DIALECTBENCH) for varieties never seen in pretraining. DIALECTBENCH is where post-hoc selection should matter most, because nobody knows the right sharing level for a dialect in advance.

The first decisive check is the premise. We plot development accuracy against $\lambda$ for every language–task pair from the static grid alone. If the best $\lambda$ is essentially the same everywhere, there is nothing to tune and the dial idea fails, whatever the conditional model achieves.

The second check is fidelity. At each grid value, the conditional model's test accuracy should be within noise (three seeds) of the matching static model. A clear gap would mean conditioning sacrifices quality, the interference problem the registration literature warns about.

The third check is the payoff. Per-language, per-task selected $\lambda$ should beat the best single fixed $\lambda$, SMALA, and OBPE on non-Latin-script and dialect targets, and it should beat endpoint interpolation where the accuracy curve is non-monotone.

We also report the edges of the training range to measure extrapolation collapse. Finally, we report how many development examples are needed before the selected $\lambda$ stabilizes, because a dial that requires large labeled sets in the target language loses its main practical advantage.