EuroDense-435M / README.md
rafalposwiata's picture
Update README.md
98e0067 verified
|
Raw
History Blame Contribute Delete
40.8 kB
metadata
pipeline_tag: sentence-similarity
tags:
  - sentence-transformers
  - feature-extraction
  - sentence-similarity
  - transformers
license: gemma
language:
  - en
  - de
  - fr
  - es
  - it
  - pt
  - nl
  - ru
  - pl
widget:
  - source_sentence: 'zapytanie: Jak dożyć 100 lat?'
    sentences:
      - Trzeba zdrowo się odżywiać i uprawiać sport.
      - Trzeba pić alkohol, imprezować i jeździć szybkimi autami.
      - >-
        Gdy trwała kampania politycy zapewniali, że rozprawią się z zakazem
        niedzielnego handlu.

EuroDense-435M

EuroDense is an embedding model optimized for dense retrieval across nine European languages: English, German, French, Spanish, Italian, Portuguese, Dutch, Russian, and Polish. The model compares favorably to other multilingual embeddings, achieving strong results in its size class of under 1B parameters. At 435M parameters, EuroDense offers efficient text representations for search and RAG applications with a balanced performance across all supported languages.

Training

EuroDense was trained in a three-stage pipeline with two knowledge distillation stages and one fine-tuning stage.

  1. The first stage involved multilingual self-distillation based on an English embedding model Stella-400M. This stage follows the approach introduced in Making Monolingual Sentence Embeddings Multilingual using Knowledge Distillation. The core idea is to employ a strong monolingual model and extend it to other languages using a shared semantic embedding space. In practice, the method teaches models to map English texts with texts of the same meaning in the other eight languages to nearby locations in the vector space, while preserving the retrieval-oriented structure. For the purposes of distillation, we prepared a corpus consisting of approximately 20 million texts, which we translated into all nine languages using the Gemma-3-27B model, resulting in a total of 180 million texts. Model was trained on this corpus for 5 epochs with a batch size of 64.

  2. The second stage used a more advanced distillation objective inspired by Jasper and Stella: distillation of SOTA embedding models. The goal of this stage was to align the student models more closely with the teacher and extract as much retrieval quality as possible from the distillation process. The training objective combined three complementary losses: a) a cosine alignment loss; b) a pairwise similarity loss; c) a triplet-style ranking loss. Together, these losses train the student not only to imitate individual teacher vectors, but also to reproduce the teacher's local geometry and ranking behavior. This is particularly important for retrieval, where relative similarity between queries and passages matters more than isolated embedding values. The teacher model in this stage was Pplx-Embed-4B. In this stage, we used the same corpus of 180 million texts as in the first stage. Model was trained for 5 epochs with a batch size of 128.

  3. The final stage fine-tuned the models directly for retrieval using contrastive learning. This stage used 11 retrieval training datasets containing over 1.6 million queries and more than 13 million passages. No ground-truth labels were used during this stage. Instead, the training data was constructed entirely from positive and negative examples selected with the BGE-Reranker-v2.5-Gemma2-Lightweight reranker. The model was trained for 10 epochs with a batch size of 1024.

Evaluation

We dedicated significant effort to preparing a comprehensive evaluation that covers all supported languages and is diverse in terms of dataset domains and structures. The data come from numerous sources, including well-established benchmarks such as MTEB, RTEB, MMTEB, PIRB, MTEB-French, MTEB-NL, BEIR-NL, and RusBEIR. It has also been supplemented with many standalone datasets for these languages. In total, the evaluation was conducted on 156 datasets. In the table below, we present a comparison of EuroDense to other multilingual models in a similar size class of under 1B parameters. It presents results broken down by language (with the number of datasets for each language shown in parentheses), as well as the average across all datasets and the average across languages, measured using NDCG@10. For each column, the three best results are color-coded: gold for first place, silver for second, and bronze for third. EuroDense achieves the best result in 7 out of 9 languages, being outperformed by other models only for English and Portuguese. It also achieves the highest average both across datasets and across languages.

Model name PL
(41)
DE
(6)
FR
(9)
ES
(6)
IT
(7)
PT
(8)
NL
(25)
RU
(26)
EN
(28)
Avg. by
tasks (156)
Avg. by
langs (9)
EuroDense-435M 61.2 68.9 63.4 64.6 71.4 66.4 58.1 61.4 60.6 61.9 64.0
pplx-embed-v1-0.6b 59.1 66.9 62.0 63.0 69.7 68.1 56.9 61.3 64.0 61.5 63.5
voyage-4-nano 55.1 68.8 63.1 63.8 70.5 67.6 52.3 58.5 61.8 59.1 62.4
jina-embeddings-v5-text-small 57.2 65.2 61.1 61.9 68.9 66.7 56.2 60.9 63.3 60.5 62.4
jina-embeddings-v5-text-nano 56.7 64.7 60.9 63.2 69.1 67.4 55.4 60.1 61.6 59.9 62.1
snowflake-arctic-embed-l-v2.0 59.2 67.3 60.3 61.6 69.5 68.1 55.7 59.8 55.0 59.4 61.8
embeddinggemma-300m 55.2 64.4 60.8 61.0 68.1 66.5 53.3 60.1 60.6 58.7 61.1
harrier-oss-v1-0.6b 56.5 64.9 60.2 60.3 68.2 64.3 54.1 59.8 61.4 59.1 61.1
jina-embeddings-v3 57.6 63.4 58.0 59.2 66.0 63.9 53.8 58.0 55.3 56.9 59.5
snowflake-arctic-embed-m-v2.0 57.3 62.8 59.4 60.0 68.2 66.6 49.9 54.3 56.5 57.6 59.4
bge-m3 56.0 63.1 57.5 60.0 68.0 65.9 51.2 58.0 51.4 56.3 59.0
Qwen3-Embedding-0.6B 50.7 61.7 57.0 59.1 64.0 62.3 50.0 56.0 61.9 55.8 58.1
multilingual-e5-large 57.3 56.9 52.7 57.2 66.7 63.0 51.6 57.7 53.5 56.2 57.4
gte-multilingual-base 51.6 60.6 55.8 58.9 65.5 61.0 48.8 55.1 53.3 54.0 56.7
multilingual-e5-base 53.1 56.6 50.4 54.2 64.8 59.7 48.1 54.2 50.2 52.9 54.6

Table 1. Evaluation results for multilingual models with fewer than 1B parameters on 156 retrieval datasets across 9 languages (NDCG@10).

Usage

The model utilizes prefixes for retrieval and semantic similarity tasks. For retrieval, queries should be prefixed with "Instruct: Given a web search query, retrieve relevant passages that answer the query.\nQuery: ". For symmetric tasks such as semantic similarity, both texts should be prefixed with "Instruct: Retrieve semantically similar text.\nQuery: ". Please note that the model uses a custom implementation, so you should add trust_remote_code=True argument when loading it. The model can be used with sentence-transformers:

from sentence_transformers import SentenceTransformer
from sentence_transformers.util import cos_sim

model = SentenceTransformer(
    "OPI-PIB/EuroDense-435M",
    trust_remote_code=True,
    device="cuda",
    model_kwargs={"dtype": "bfloat16"}
)

# Retrieval example
query_prefix = "Instruct: Given a web search query, retrieve relevant passages that answer the query.\nQuery: "
queries = [query_prefix + "Jak dożyć 100 lat?"]
answers = [
    "Trzeba zdrowo się odżywiać i uprawiać sport.",
    "Trzeba pić alkohol, imprezować i jeździć szybkimi autami.",
    "Gdy trwała kampania politycy zapewniali, że rozprawią się z zakazem niedzielnego handlu."
]
queries_emb = model.encode(queries, convert_to_tensor=True, show_progress_bar=False)
answers_emb = model.encode(answers, convert_to_tensor=True, show_progress_bar=False)
best_answer = cos_sim(queries_emb, answers_emb).argmax().item()
print(answers[best_answer])

# Semantic similarity example
sim_prefix = "Instruct: Retrieve semantically similar text.\nQuery: "
sentences = [
    sim_prefix + "Trzeba zdrowo się odżywiać i uprawiać sport.",
    sim_prefix + "Warto jest prowadzić zdrowy tryb życia, uwzględniający aktywność fizyczną i dietę.",
    sim_prefix + "One should eat healthy and engage in sports.",
    sim_prefix + "Zakupy potwierdzasz PINem, który bezpiecznie ustalisz podczas aktywacji."
]
emb = model.encode(sentences, convert_to_tensor=True, show_progress_bar=False)
print(cos_sim(emb, emb))

Acknowledgements

The research was supported by the project Large Language Models for the European Union (LLMs4EU). This project is co-funded by the Digital Europe Programme under Grant Agreement 101198470.

The research was supported [in part] by project “Cloud Artificial Intelligence Service Engineering (CAISE) platform to create universal and smart services for various application areas”, No. KPOD.05.10-IW.10-0005/24, as part of the European IPCEI-CIS program, financed by NRRP (National Recovery and Resilience Plan) funds. Computations were carried out using the computers of Centre of Informatics Tricity Academic Supercomputer & Network at Gdansk University of Technology.