Abstract
We introduce a novel suite of state-of-the-art bilingual text embedding models that are designed to support English and another target language. These models are capable of processing lengthy text inputs with up to 8192 tokens, making them highly versatile for a range of natural language processing tasks such as text retrieval, clustering, and semantic textual similarity (STS) calculations. By focusing on bilingual models and introducing a unique multi-task learning objective, we have significantly improved the model performance on STS tasks, which outperforms the capabilities of existing multilingual models in both target language understanding and cross-lingual evaluation tasks. Moreover, our bilingual models are more efficient, requiring fewer parameters and less memory due to their smaller vocabulary needs. Furthermore, we have expanded the Massive Text Embedding Benchmark (MTEB) to include benchmarks for German and Spanish embedding models. This integration aims to stimulate further research and advancement in text embedding technologies for these languages.
Introduction
In the field of text embeddings, researchers often face a trade-off between monolingual models, which excel in a single language but lack versatility, and multilingual models, which support over 100 languages but often fall victim to the "curse of multilinguality." This phenomenon occurs when a model's capacity is diluted across too many languages, leading to degraded performance in any specific one. Additionally, multilingual models typically require massive vocabularies (often exceeding 250,000 tokens), dedicating a significant portion of parameters to tokens that may rarely be used in specific contexts.
Jina AI researchers have addressed these challenges by introducing a new suite of bilingual text embedding models (English paired with German, Chinese, or Spanish). These models support massive context windows of up to 8192 tokens, allowing them to process entire documents, technical manuals, or legal texts without truncation.
Methodology
The development of these bilingual models follows a rigorous three-stage training paradigm:
- Pre-training (JinaBERT): The foundation is a modified BERT architecture called JinaBERT. It incorporates ALiBi (Attention with Linear Biases) to enable sequence handling up to 8192 tokens. Specialized tokenizers for each language pair keep the vocabulary size lean, directly improving parameter efficiency.
- Fine-tuning with Text Pairs: Models are trained on a massive collection of query-target pairs using a bi-directional InfoNCE loss to establish baseline semantic similarity.
- Multi-task Fine-tuning: To stabilize joint training of retrieval and Semantic Textual Similarity (STS) tasks, the researchers introduced a Pearson correlation-based loss. This scale-invariant loss function prevents the volatility often seen when mixing standard Mean Squared Error (MSE) with contrastive learning objectives.
Architectural Efficiency
By narrowing the linguistic focus to bilingual pairs, the models avoid capacity dilution. A significant advantage is the reduction in vocabulary size; while multilingual models like e5-multilingual utilize a 250k token vocabulary, Jina’s bilingual models operate with approximately 60k tokens. This ensures that a higher percentage of the model's parameters are actively utilized during inference, leading to lower memory requirements and higher computational efficiency.
Evaluation and Key Results
The bilingual models were evaluated against the popular multilingual-e5-base and other established baselines across several benchmarks, including an expanded version of the Massive Text Embedding Benchmark (MTEB) featuring new Spanish and German tasks.
- Performance vs. Size: As shown in the evaluation data, the bilingual JinaBERT models (161M parameters) consistently outperform larger multilingual models like XLM-RoBERTa (279M parameters) across various NLU tasks.
- German and Spanish Excellence:
jina-de-baseachieved an average score of 0.601 on German MTEB tasks, significantly higher than the 0.551 achieved by the multilingual baseline. Similarly,jina-es-baseled in retrieval and clustering tasks for Spanish. - Cross-Lingual Strength: The bilingual training approach strengthens the semantic bridge between English and the target language, resulting in superior performance in English-to-German and English-to-Spanish STS tasks.
Conclusion
The JinaBERT bilingual suite demonstrates that specialized, parameter-efficient models can outperform general-purpose multilingual giants when focused on specific language pairs. While currently limited to German, Chinese, and Spanish, the success of this multi-task contrastive learning approach provides a blueprint for future high-impact language pairs. Future work will explore non-English anchors and the inclusion of more diverse tasks like classification and summarization to further enhance the models' general-purpose utility.
Summary updated