antoinelouis
crossencoder-camembert-large-mmarcoFR
This is a cross-encoder model for French. It performs cross-attention between a question-passage pair and outputs a relevance score. The model should be used as a reranker for semantic search: given a query and a set of potentially relevant passages retrieved by an efficient first-stage retrieval system (e.g., BM25 or a fine-tuned dense single-vector bi-encoder), encode each query-passage pair and sort the passages in a decreasing order of relevance according to the model's predicted scores. Here are some examples for using the model with Sentence-Transformers, FlagEmbedding, or Huggingface Transformers. Start by installing the library: `pip install -U sentence-transformers`. Then, you can use the model like this: Start by installing the library: `pip install -U FlagEmbedding`. Then, you can use the model like this: Start by installing the library: `pip install -U transformers`. Then, you can use the model like this: The model is evaluated on the smaller development set of mMARCO-fr, which consists of 6,980 queries for which an ensemble of 1000 passages containing the positive(s) and ColBERTv2 hard negatives need to be reranked. We report the mean reciprocal rank (MRR) and recall at various cut-offs (R@k). To see how it compares to other neural retrievers in French, check out the DécouvrIR leaderboard. We use the French training samples from the mMARCO dataset, a multilingual machine-translated version of MS MARCO that contains 8.8M passages and 539K training queries. We do not use the BM25 negatives provided by the official dataset but instead sample harder negatives mined from 12 distinct dense retrievers, using the msmarco-hard-negatives distillation dataset. Eventually, we sample 2.6M training triplets of the form (query, passage, relevance) with a positive-to-negative ratio of 1 (i.e., 50% of the pairs are relevant and 50% are irrelevant). The model is initialized from the almanach/camembert-large checkpoint and optimized via the binary cross-entropy loss (as in monoBERT). It is fine-tuned on one 80GB NVIDIA H100 GPU for 20k steps using the AdamW optimizer with a batch size of 128 and a constant learning rate of 2e-5. We set the maximum sequence length of the concatenated question-passage pairs to 256 tokens. We use the sigmoid function to get scores between 0 and 1.
colbert-xm
🛠️ Usage | 📊 Evaluation | 🤖 Training | 🔗 Citation This is a ColBERT model that can be used for semantic search in many languages. It encodes queries and passages into matrices of token-level embeddings and efficiently finds passages that contextually match the query using scalable vector-similarity (MaxSim) operators. The model uses an XMOD backbone, which allows it to learn from monolingual fine-tuning in a high-resource language, like English, and perform zero-shot retrieval across multiple languages. Start by installing the colbert-ai and some extra requirements: - mMARCO: We evaluate our model on the small development sets of mMARCO, which consists of 6,980 queries for a corpus of 8.8M candidate passages in 14 languages. Below, we compared its multilingual performance with other retrieval models on the dataset official metrics, i.e., mean reciprocal rank at cut-off 10 (MRR@10). | | model | Type | #Samples | #Params | en | es | fr | it | pt | id | de | ru | zh | ja | nl | vi | hi | ar | Avg. | |---:|:----------------------------------------------------------------------------------------------------------------------------------------|:--------------|:--------:|:-------:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:| | 1 | BM25 (Pyserini) | lexical | - | - | 18.4 | 15.8 | 15.5 | 15.3 | 15.2 | 14.9 | 13.6 | 12.4 | 11.6 | 14.1 | 14.0 | 13.6 | 13.4 | 11.1 | 14.2 | | 2 | mono-mT5 (Bonfacio et al., 2021) | cross-encoder | 12.8M | 390M | 36.6 | 31.4 | 30.2 | 30.3 | 30.2 | 29.8 | 28.9 | 26.3 | 24.9 | 26.7 | 29.2 | 25.6 | 26.6 | 23.5 | 28.6 | | 3 | mono-mMiniLM (Bonfacio et al., 2021) | cross-encoder | 80.0M | 107M | 36.6 | 30.9 | 29.6 | 29.1 | 28.9 | 29.3 | 27.8 | 25.1 | 24.9 | 26.3 | 27.6 | 24.7 | 26.2 | 21.9 | 27.8 | | 4 | DPR-X (Yang et al., 2022) | single-vector | 25.6M | 550M | 24.5 | 19.6 | 18.9 | 18.3 | 19.0 | 16.9 | 18.2 | 17.7 | 14.8 | 15.4 | 18.5 | 15.1 | 15.4 | 12.9 | 17.5 | | 5 | mE5-base (Wang et al., 2024) | single-vector | 5.1B | 278M | 35.0 | 28.9 | 30.3 | 28.0 | 27.5 | 26.1 | 27.1 | 24.5 | 22.9 | 25.0 | 27.3 | 23.9 | 24.2 | 20.5 | 26.5 | | 6 | mColBERT (Bonfacio et al., 2021) | multi-vector | 25.6M | 180M | 35.2 | 30.1 | 28.9 | 29.2 | 29.2 | 27.5 | 28.1 | 25.0 | 24.6 | 23.6 | 27.3 | 18.0 | 23.2 | 20.9 | 26.5 | | | | | | | | | | | | | | | | | | | | | | | 7 | DPR-XM (ours) | single-vector | 25.6M | 277M | 32.7 | 23.6 | 23.5 | 22.3 | 22.7 | 22.0 | 22.1 | 19.9 | 18.1 | 18.7 | 22.9 | 18.0 | 16.0 | 15.1 | 21.3 | | 8 | ColBERT-XM (ours) | multi-vector | 6.4M | 277M | 37.2 | 28.5 | 26.9 | 26.5 | 27.6 | 26.3 | 27.0 | 25.1 | 24.6 | 24.1 | 27.5 | 22.6 | 23.8 | 19.5 | 26.2 | - Mr. TyDi: We also evaluate our model on the test set of Mr. TyDi, another multilingual open retrieval dataset including low-resource languages not present in mMARCO. Below, we compared its performance with other retrieval models on the official dataset metrics, i.e., mean reciprocal rank at cut-off 100 (MRR@100) and recall at cut-off 100 (R@100). | | model | Type | #Samples | #Params | ar | bn | en | fi | id | ja | ko | ru | sw | te | Avg. | |---:|:------------------------------------------------------------------------------|:--------------|:--------:|:-------:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:|-----:| | | | | | | | | | | MRR@100 | | | | | | | | 1 | BM25 (Pyserini) | lexical | - | - | 36.8 | 41.8 | 14.0 | 28.4 | 37.6 | 21.1 | 28.5 | 31.3 | 38.9 | 34.3 | 31.3 | | 2 | mono-mT5 (Bonfacio et al., 2021) | cross-encoder | 12.8M | 390M | 62.2 | 65.1 | 35.7 | 49.5 | 61.1 | 48.1 | 47.4 | 52.6 | 62.9 | 66.6 | 55.1 | | 3 | mColBERT (Bonfacio et al., 2021) | multi-vector | 25.6M | 180M | 55.3 | 48.8 | 32.9 | 41.3 | 55.5 | 36.6 | 36.7 | 48.2 | 44.8 | 61.6 | 46.1 | | 4 | ColBERT-XM (ours) | multi-vector | 6.4M | 277M | 55.2 | 56.6 | 36.0 | 41.8 | 57.1 | 42.1 | 41.3 | 52.2 | 56.8 | 50.6 | 49.0 | | | | | | | | | | | R@100 | | | | | | | | 5 | BM25 (Pyserini) | lexical | - | - | 79.3 | 86.9 | 53.7 | 71.9 | 84.3 | 64.5 | 61.9 | 64.8 | 76.4 | 75.8 | 72.0 | | 6 | mono-mT5 (Bonfacio et al., 2021) | cross-encoder | 12.8M | 390M | 88.4 | 92.3 | 72.4 | 85.1 | 92.8 | 83.2 | 76.5 | 76.3 | 83.8 | 85.0 | 83.5 | | 7 | mColBERT (Bonfacio et al., 2021) | multi-vector | 25.6M | 180M | 85.9 | 91.8 | 78.6 | 82.6 | 91.1 | 70.9 | 72.9 | 86.1 | 80.8 | 96.9 | 83.7 | | 8 | ColBERT-XM (ours) | multi-vector | 6.4M | 277M | 89.6 | 91.4 | 83.7 | 84.4 | 93.8 | 84.9 | 77.6 | 89.1 | 87.1 | 93.3 | 87.5 | We use the English training samples from the MS MARCO passage ranking dataset, which contains 8.8M passages and 539K training queries. We do not employ the BM25 netaives provided by the official dataset but instead sample harder negatives mined from 12 distinct dense retrievers, using the msmarco-hard-negatives distillation dataset. Our final training set consists of 6.4M (q, p+, p-) triples. The model is initialized from the xmod-base checkpoint and optimized via a combination of the pairwise softmax cross-entropy loss computed over predicted scores for the positive and hard negative passages (as in ColBERTv1) and the in-batch sampled softmax cross-entropy loss (as in ColBERTv2). It is fine-tuned on one 80GB NVIDIA H100 GPU for 50k steps using the AdamW optimizer with a batch size of 128, a peak learning rate of 3e-6 with warm up along the first 10\% of training steps and linear scheduling. We set the embedding dimension to 128, and fix the maximum sequence lengths for questions and passages at 32 and 256, respectively.