Modular Sentence Encoders: Separating Language Specialization from Cross-Lingual Alignment

Yongxin Huang, Kexin Wang, Goran Glavaš, Iryna Gurevych

TL;DR

This paper introduces a modular training approach for multilingual sentence encoders (MSEs) that separates language specialization from cross-lingual alignment using parameter-efficient adapters. By isolating language-specific features and balancing paraphrase and parallel training data, the proposed method mitigates the "curse of multilinguality" and resolves performance trade-offs across diverse monolingual and cross-lingual tasks.

What Problem Does This Paper Address?

Multilingual Sentence Encoders (MSEs) like LaBSE or multilingual E5 map sentences from different languages into a single, shared semantic space. However, traditional monolithic MSEs suffer from two major limitations:

  1. The Curse of Multilinguality (CoM): When a single model shares all its parameters across dozens of languages, performance on individual languages degrades due to negative interference.
  2. Task Performance Trade-offs: Forcing cross-lingual alignment often distorts the unique semantic structure of individual languages, harming monolingual task performance. Furthermore, different cross-lingual tasks demand conflicting alignment strategies: bitext mining requires exact translation pairs to map to identical embeddings, whereas cross-lingual semantic similarity requires the model to distinguish subtle nuances between similar but non-equivalent sentences.

The authors tackle these challenges by asking: Can we decouple language-specific learning from cross-lingual alignment to get the best of both worlds?

Methods

The authors propose a modular framework that uses parameter separation via Low-Rank Adaptation (LoRA) and parallel adapters. The training pipeline consists of two primary phases:

1. Monolingual Specialization

To protect individual language structures, the model trains language-specific modules independently:

  • Language Adaptation (LA): A new, language-specific tokenizer is initialized using the FOCUS approach to retain vocabulary compatibility. The model then undergoes continued Masked Language Modeling (MLM) using language-specific LoRA adapters.
  • Sentence Encoding (SE) Training: To transition the token-level model into a sentence encoder, the authors apply contrastive learning (Multiple Negative Ranking Loss) on synthetic monolingual paraphrase data. This updates a dedicated SE adapter while keeping the rest of the model frozen.

2. Cross-Lingual Alignment (CLA)

Once the monolingual spaces are optimized, they are aligned to an English pivot space without modifying the monolingual parameters:

  • Cross-Lingual Alignment Adapters: The authors train a separate CLA adapter for each non-English language.
  • Joint Training Strategy: To resolve the conflict between cross-lingual tasks, training alternates between batches of cross-lingual paraphrase data (using contrastive loss) and parallel translation data (using cosine similarity loss).

During inference, only the modules corresponding to the input sentence's language are activated.

Figure 1: Illustration of how we apply our modular training to a pre-trained multilingual sentence encoder. In each step, only the module marked with the fire symbol is trained. In the monolingual specialization step, we train a language-specific embedding layer, a language adapter and a monolingual sentence encoding (SE) adapter for each language. In the cross-lingual alignment (CLA) step, the monolingual (e.g., German) representation is aligned to the English representation via cross-lingual paraphrase and parallel data, in alternate batches. PA: parallel adapter.

Datasets

  • Pre-training/Adaptation: Monolingual corpora from CC100 and MADLAD-400.
  • Paraphrase Training Data: Five English datasets (MNLI/XNLI, Sentence Compression, SimpleWiki, Altlex, Quora Duplicate Questions) containing ~600K sentence pairs, machine-translated into 22 languages using the NLLB-3.3B model.
  • Evaluation Benchmarks:
  • Semantic Textual Similarity/Relatedness: STS17, STSB, SICK, STR24.
  • Bitext Mining: FLORES, Tatoeba.
  • Topic Classification: SIB-200.

Key Insights and Ideas

  • Modularity Prevents Distortion: The core "aha moment" is that cross-lingual alignment doesn't have to ruin monolingual representation. By freezing the monolingual sentence encoding adapters and only training the cross-lingual alignment (CLA) adapters, the model preserves fine-grained monolingual semantic spaces.
  • Alternating Batches Solve Task Conflicts: Alternating between paraphrase and parallel data within the same CLA adapter successfully mitigates the trade-off between bitext mining and semantic similarity tasks.
  • The Power of Machine Translation for Low-Resource Languages: Training language-specific modules on noisy, machine-translated paraphrase data consistently outperforms transferring sentence-encoding capabilities directly from English. This highlights MT as a highly scalable alternative to manual data curation.

Key Results

The modular approach (denoted as Modmc-jt) was evaluated using LaBSE and mE5 base models across 23 languages.

  • Monolingual Gains: On the LaBSE base, Modmc-jt achieved a Spearman correlation score of 82.1 on monolingual STSB, compared to 80.4 for the fully-trained monolithic baseline (Fullm). The gains were even more pronounced on low-resource datasets like STR24.
  • Cross-Lingual Balance: Unlike monolithic models that sacrifice bitext mining for semantic similarity (or vice versa), the modular joint-training approach achieved top-tier or near-top-tier performance across both task types simultaneously.
  • Reduced Language Bias: The modular approach significantly lowered language bias (the tendency of a model to group sentences by language rather than meaning) and improved semantic isomorphism (RSIM scores) across language pairs.

Limitations and Future Work

  • Architecture Constraints: The current framework was only validated on encoder-based MSEs (like BERT/RoBERTa variants). Adapting this modular approach to encoder-decoder or decoder-only large language models remains an open challenge.
  • Inference Overhead & Scaling: Because the parameter size scales linearly with the number of languages, supporting hundreds of languages requires managing many adapter weights. Although only one language's modules are loaded per inference pass, the embedding layers remain large.
  • Future Directions: The authors suggest exploring smaller vocabulary sizes (e.g., 8K tokens), applying LoRA to the embedding layers to compress module sizes, or training modules shared across entire language families rather than individual languages.

Summary updated

BibTeX
@inproceedings{huang2025modular,
  author = {Yongxin Huang and Kexin Wang and Goran Glavaš and Iryna Gurevych},
  title = {{Modular Sentence Encoders: Separating Language Specialization from Cross-Lingual Alignment}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure