NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Plug-In Language Modules for Cross-Lingual Demonstration Retrieval

Large language models do markedly better on a new input when the prompt contains a few worked examples that resemble it. For most of the world's languages, though, no labeled examples exist. The practical recipe is to take a query in, say, Tigrinya and retrieve helpful labeled examples from an English pool. The retriever that does this is trained on English only and is expected to work in hundreds of other languages because it sits on a multilingual encoder. That encoder is a single shared network, and it is the weak point. It is least reliable in exactly the languages that most need help, and training it on English-only feedback can erode what little alignment it has for those languages.

We propose a different split of labor. Each language gets its own small add-on module, trained only on unlabeled monolingual text, that maps the language into a shared representation. A shared component, trained only on English feedback from the language model, learns which examples actually help. Because the English training never touches a language's module, whatever the retriever learns about "helpfulness" should carry over to any language that has a module. A new language can then be added later by training one module on raw text, with no labels and no retraining of the retriever. The central experimental question is whether this arrangement preserves the retriever's English ranking behavior when the query arrives in a low-resource language. It must preserve that behavior better than a shared encoder trained the same way, and better than simply translating the query into English.

Core Claim

The closest existing system is XAMPLER. It scores English candidate examples by how much they help the MaLA500 model on English queries, then fine-tunes the shared multilingual encoder Glot500 contrastively on those labels and applies it zero-shot to queries in 500+ languages. On SIB-200 topic classification it reports 75.91% macro-accuracy, against 74.61% for multilingual E5 and 61.68% for random examples. MLT-DR scales the same shared-encoder idea to 130+ languages, relying on machine-translated training data rather than architecture. Both papers update every encoder weight on utility signals that come almost entirely from English.

We claim that this is where cross-lingual transfer is lost. Two strands of the modularity literature point the same way. Separating monolingual specialization from cross-lingual alignment in sentence encoders gives large gains over shared encoders, +9.2 points over LaBSE on STR24 and nearly 10 over full-parameter mE5 on cross-lingual STSB, as shown in Modular Sentence Encoders. Separately, mmT5 shows that fine-tuning shared parameters around language modules causes representation drift unless the right parts are frozen.

What would be new here is not a modular retriever in general. ColBERT-XM already freezes language adapters and trains passage retrieval on English. The new part is the claim that language-model utility, a noisier and more task-specific signal than passage relevance, can be learned in a language-agnostic component and transferred through frozen language modules. A second claim is that this transfer can be measured directly, without running the language model, by checking how well the retriever reproduces its own English rankings on translated queries.

Research Program

The retriever scores a query $q$ in language $\ell$ against an English candidate example $c$ as

$$ s(q, c) = \cos\big(g(A_{\ell}(q)),\; g(A_{\mathrm{en}}(c))\big), $$

where $A_{\ell}$ is the frozen encoder passed through language $\ell$'s module, and $g$ is a small shared utility head trained only on English. Candidates are encoded from instruction and input alone, following MLT-DR's finding that including gold outputs in candidate vectors hurts transfer to new label spaces.

For languages that an XMOD-style backbone already covers, $A_\ell$ is its pre-trained per-layer adapter, as in ColBERT-XM. For other languages, we train a new adapter by masked language modeling on monolingual text, following the recipe in Modular Sentence Encoders. A separate cross-lingual alignment adapter, trained on parallel data that excludes all evaluation sentences, sits below $g$. Utility labels are produced exactly as in XAMPLER, using one-shot MaLA500 scoring on English SIB-200 and MasakhaNEWS training data. This keeps the supervision identical and makes architecture the only variable.

The analytical core is a transfer-fidelity metric that exploits SIB-200's multi-way parallelism, since every test sentence exists in 205 languages. For a query $q_\ell$ with English translation $q_{\mathrm{en}}$, we define

$$ F_\ell@k = \frac{|\mathrm{top}_k(q_\ell) \cap \mathrm{top}_k(q_{\mathrm{en}})|}{k}, $$

which measures how much of the retriever's English top-$k$ it recovers when the same content arrives in language $\ell$. This separates retrieval transfer from the language model's own weakness in $\ell$.

The metric also gives a direct test of drift. We compute $F_\ell$ before and after utility training, once with modules frozen and once with them unfrozen. The prediction is that shared-encoder training lowers $F_\ell$ most in languages with poor pre-trained alignment, and that frozen modules prevent this.

A third component is post-hoc extension. We hold out a set of low-resource languages, including unseen-script languages such as N'Ko and Tifinagh that SIB-200 flags as hard. We then add their modules only after the utility head is finished. Finally, because routing needs a language label, we replace gold labels with an automatic language identifier. When the identifier is wrong or unsure, the system falls back to the module of the nearest related language, and we report the accuracy cost of both behaviors.

Baselines

The naive reference is random English examples, which XAMPLER reports at 61.68% SIB-200 macro-accuracy with MaLA500. Zero-shot prompting with no examples is also reported.

The strongest existing method is XAMPLER itself at 75.91% SIB-200 macro-accuracy. For MasakhaNEWS, the file gives no exact figure ("no reported result found on Lacuna for XAMPLER on MasakhaNEWS"), so we rerun it ourselves. We retrain XAMPLER from its released recipe on the same utility labels, with the same number of contrastive steps and the same learning-rate sweep, and use its SIB-200 number to confirm our reproduction. Beating it means a statistically reliable macro-accuracy gain on SIB-200 and macro-F1 gain on MasakhaNEWS. More importantly, the gain must be concentrated in the bottom third of languages ranked by Glot500 bitext retrieval accuracy on FLORES-200. A uniform gain of about one point would suggest a better backbone rather than a better design.

Because Glot500 and an XMOD-style backbone differ in pre-training data, we add a size-matched monolithic control. This is the same XMOD-style network with its adapters merged into a shared network, trained on identical utility labels, which separates architecture from pre-training corpus. Multilingual E5 with utility training is added as a stronger shared encoder.

ColBERT-XM, used zero-shot as a demonstration retriever, is the strongest existing modular competitor. It tests whether passage-relevance training already captures example utility.

Three ablations isolate the key ingredient. The first uses the same modular retriever with language modules unfrozen during utility training, which tests drift. The second removes the utility head and uses the off-the-shelf modular sentence encoder, which tests whether utility learning is needed at all. The third drops the alignment adapter, which tests whether monolingual modules alone suffice. All systems share the candidate pool, the language model, one example per prompt (plus a three-example setting), and an equal hyperparameter-search budget.

Why not just…?

Why not just use an off-the-shelf multilingual encoder such as SONAR or mE5? Zebaze et al. show such encoders help low-resource translation a great deal, up to +10 laCOMET points for Swahili and Wolof, yet leave Wolof weak. XAMPLER shows utility training adds over mE5 on SIB-200. The gap it reports is small, 75.91 versus 74.61, so this alternative is a real threat. Our mE5 baselines, with and without utility training, will show whether the modular design earns more than utility training alone.

Why not just use the Modular Sentence Encoder without any utility training? This is the most dangerous alternative. It may already carry most of the benefit through better alignment alone. We test it directly as an ablation. If it matches the full system, the honest conclusion is that modularity helps alignment and that English utility adds nothing across languages, and we would report exactly that.

Why not just translate the query into English with NLLB-200 and use an English retriever? Translation errors compound for low-resource and non-Latin-script languages. Translation also adds an inference call before any retrieval can happen. On SIB-200, however, this baseline has a hidden advantage. The test sentences come from FLORES, which NLLB was built around, so near-perfect translations may partly reflect exposure to that data. We therefore run translate-test on SIB-200 but give more weight to MasakhaNEWS, where the sentences are native news text. We also report translate-test with a smaller, less-exposed translation model.

Proposed Experiments

The main experiment covers cross-lingual one-shot and three-shot classification on SIB-200 (205 languages) and MasakhaNEWS (16 African languages). The language model is MaLA500, with a second instruction-tuned model used to check that learned utility transfers across models, as UDR and MLT-DR found it does. We report macro-accuracy (or macro-F1) overall and by resource tier and script, plus $F_\ell@k$ per language.

The decisive checks are four, and all are needed.

First, frozen-module training must retain higher $F_\ell@k$ than both the monolithic control and the unfrozen ablation in low-alignment languages.

Second, higher $F_\ell@k$ must track downstream accuracy gains across languages. We test this with a per-language rank correlation, with the confirmation criterion fixed in advance. Without this link, the fidelity metric would be a curiosity rather than a diagnostic.

Third, languages whose modules are added after training must perform within a small margin of languages present during training. This would show that extension needs no utility relabeling.

Fourth, the full system must beat the no-utility modular encoder. If it does not, the proposal's central claim fails.

A secondary stress test replaces gold language labels with automatic identification on code-mixed and dialectal SIB-200 variants. It measures how much of the gain survives realistic routing errors, which is the main known weakness of language-specific modules.