Add Mixed-Distill en-fa ColBERT-XLMR model (MiLQ, arXiv:2505.16631)
Browse files- .gitattributes +1 -0
- README.md +79 -0
- added_tokens.json +4 -0
- artifact.metadata +92 -0
- config.json +28 -0
- model.safetensors +3 -0
- sentencepiece.bpe.model +3 -0
- special_tokens_map.json +15 -0
- tokenizer.json +3 -0
- tokenizer_config.json +70 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
- fa
|
| 5 |
+
license: apache-2.0
|
| 6 |
+
library_name: colbert
|
| 7 |
+
base_model: FacebookAI/xlm-roberta-large
|
| 8 |
+
pipeline_tag: feature-extraction
|
| 9 |
+
tags:
|
| 10 |
+
- colbert
|
| 11 |
+
- late-interaction
|
| 12 |
+
- dense-retrieval
|
| 13 |
+
- cross-lingual
|
| 14 |
+
- code-switching
|
| 15 |
+
- information-retrieval
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# Mixed-Distill enfa-fa (English–Persian)
|
| 19 |
+
|
| 20 |
+
A cross-lingual **ColBERT** late-interaction retriever (XLM-RoBERTa-large backbone) for
|
| 21 |
+
**English ⇄ Persian (Farsi)** web search. The model is **distilled** from a strong reranker and trained on
|
| 22 |
+
**code-switched (mixed-language) queries**, following the *Mixed-Distill* recipe from the MiLQ paper.
|
| 23 |
+
|
| 24 |
+
The repo name encodes the training direction: **`enfa-fa`** = code-switched **en+fa queries → fa documents**.
|
| 25 |
+
It is designed to be robust when bilingual users issue **mixed English+Persian queries** against
|
| 26 |
+
Persian (Farsi)-language documents.
|
| 27 |
+
|
| 28 |
+
## What "Mixed-Distill" means
|
| 29 |
+
|
| 30 |
+
- **Mixed** — queries are *code-switched* (English tokens randomly mixed into Persian queries, MUSE-based,
|
| 31 |
+
~0.5 mixing ratio), so the model handles native, English, and mixed-language queries.
|
| 32 |
+
- **Distill** — trained with knowledge distillation (KL-divergence) from teacher relevance scores
|
| 33 |
+
(mT5-XXL / monoT5 over mMARCO), 6-way passage scoring.
|
| 34 |
+
|
| 35 |
+
## Intended use
|
| 36 |
+
|
| 37 |
+
- **Queries:** English, Persian, or **code-switched English+Persian**.
|
| 38 |
+
- **Documents:** Persian (Farsi)-language passages.
|
| 39 |
+
- **Scoring:** ColBERT late interaction (MaxSim over per-token embeddings).
|
| 40 |
+
|
| 41 |
+
## Specs
|
| 42 |
+
|
| 43 |
+
| | |
|
| 44 |
+
|---|---|
|
| 45 |
+
| Base model | `xlm-roberta-large` |
|
| 46 |
+
| Architecture | ColBERT (late interaction) |
|
| 47 |
+
| Projection dim | 128 |
|
| 48 |
+
| Similarity | cosine |
|
| 49 |
+
| Query max length | 32 |
|
| 50 |
+
| Doc max length | 180 |
|
| 51 |
+
| Training | KD (KLD), n-way 6, teacher: mT5-XXL/monoT5 on mMARCO |
|
| 52 |
+
|
| 53 |
+
## Usage
|
| 54 |
+
|
| 55 |
+
Load with the [ColBERT](https://github.com/stanford-futuredata/ColBERT) library:
|
| 56 |
+
|
| 57 |
+
```python
|
| 58 |
+
from colbert.modeling.checkpoint import Checkpoint
|
| 59 |
+
from colbert.infra import ColBERTConfig
|
| 60 |
+
|
| 61 |
+
ckpt = Checkpoint("<your-username>/ColBERT-XLMR-Mixed-Distill-enfa-fa",
|
| 62 |
+
colbert_config=ColBERTConfig())
|
| 63 |
+
Q = ckpt.queryFromText(["mixed English+Persian query ..."])
|
| 64 |
+
D = ckpt.docFromText(["Persian (Farsi) document passage ..."])
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
## Citation
|
| 68 |
+
|
| 69 |
+
```bibtex
|
| 70 |
+
@misc{kim2025milqbenchmarkingirmodels,
|
| 71 |
+
title={MiLQ: Benchmarking IR Models for Bilingual Web Search with Mixed Language Queries},
|
| 72 |
+
author={Jonghwi Kim and Deokhyung Kang and Seonjeong Hwang and Yunsu Kim and Jungseul Ok and Gary Lee},
|
| 73 |
+
year={2025},
|
| 74 |
+
eprint={2505.16631},
|
| 75 |
+
archivePrefix={arXiv},
|
| 76 |
+
primaryClass={cs.IR},
|
| 77 |
+
url={https://arxiv.org/abs/2505.16631},
|
| 78 |
+
}
|
| 79 |
+
```
|
added_tokens.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"[unused0]": 250002,
|
| 3 |
+
"[unused1]": 250003
|
| 4 |
+
}
|
artifact.metadata
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"query_token_id": "[unused0]",
|
| 3 |
+
"doc_token_id": "[unused1]",
|
| 4 |
+
"query_token": "[Q]",
|
| 5 |
+
"doc_token": "[D]",
|
| 6 |
+
"ncells": null,
|
| 7 |
+
"centroid_score_threshold": null,
|
| 8 |
+
"ndocs": null,
|
| 9 |
+
"only_approx": false,
|
| 10 |
+
"index_path": null,
|
| 11 |
+
"nbits": 1,
|
| 12 |
+
"kmeans_niters": 4,
|
| 13 |
+
"resume": false,
|
| 14 |
+
"max_sampled_pid": -1,
|
| 15 |
+
"max_num_partitions": -1,
|
| 16 |
+
"use_lagacy_build_ivf": false,
|
| 17 |
+
"reuse_centroids_from": null,
|
| 18 |
+
"similarity": "cosine",
|
| 19 |
+
"bsize": 16,
|
| 20 |
+
"accumsteps": 1,
|
| 21 |
+
"lr": 5e-6,
|
| 22 |
+
"maxsteps": 200000,
|
| 23 |
+
"save_every": null,
|
| 24 |
+
"resume_optimizer": false,
|
| 25 |
+
"fix_broken_optimizer_state": false,
|
| 26 |
+
"warmup": null,
|
| 27 |
+
"warmup_bert": null,
|
| 28 |
+
"relu": false,
|
| 29 |
+
"nway": 6,
|
| 30 |
+
"n_query_alternative": 1,
|
| 31 |
+
"use_ib_negatives": false,
|
| 32 |
+
"kd_loss": "KLD",
|
| 33 |
+
"reranker": false,
|
| 34 |
+
"distillation_alpha": 1.0,
|
| 35 |
+
"ignore_scores": false,
|
| 36 |
+
"model_name": "xlm-roberta-large",
|
| 37 |
+
"force_resize_embeddings": true,
|
| 38 |
+
"shuffle_passages": true,
|
| 39 |
+
"sampling_max_beta": 1.0,
|
| 40 |
+
"over_one_epoch": true,
|
| 41 |
+
"multilang": false,
|
| 42 |
+
"nolangreg": false,
|
| 43 |
+
"listwise_loss": null,
|
| 44 |
+
"max_epoch": 5,
|
| 45 |
+
"multiresource": false,
|
| 46 |
+
"num_parallel_queries": 0,
|
| 47 |
+
"num_parallel_collections": 0,
|
| 48 |
+
"run_tag": "enfa-fa_run1",
|
| 49 |
+
"maxsim_force": false,
|
| 50 |
+
"switching_prob": 0.5,
|
| 51 |
+
"switching_lang": null,
|
| 52 |
+
"softmax_temperature": 1.0,
|
| 53 |
+
"kld_weight": 1.0,
|
| 54 |
+
"mse_weight": 0.0,
|
| 55 |
+
"align_loss_weight": 1.0,
|
| 56 |
+
"only_exact_match": false,
|
| 57 |
+
"on_the_fly_switching": false,
|
| 58 |
+
"doc_lang": null,
|
| 59 |
+
"entropy_regularization": false,
|
| 60 |
+
"entropy_beta": 0.1,
|
| 61 |
+
"multi_query": false,
|
| 62 |
+
"query_contrastive_loss": false,
|
| 63 |
+
"query_contrastive_loss_weight": 0.1,
|
| 64 |
+
"query_maxlen": 32,
|
| 65 |
+
"attend_to_mask_tokens": false,
|
| 66 |
+
"interaction": "colbert",
|
| 67 |
+
"dim": 128,
|
| 68 |
+
"doc_maxlen": 180,
|
| 69 |
+
"mask_punctuation": true,
|
| 70 |
+
"checkpoint": "xlm-roberta-large",
|
| 71 |
+
"triples": "\/home\/jhkim980112\/workspace\/dataset\/msmarco\/mt5xxl-monot5-mmarco-engeng.jsonl",
|
| 72 |
+
"collection": "\/home\/jhkim980112\/workspace\/dataset\/mMARCO\/google_translations\/collections\/fa_collection_sockeye2-tm1.tsv",
|
| 73 |
+
"queries": "\/home\/jhkim980112\/workspace\/dataset\/cs_marco\/queries\/MUSE\/en_fa_queries_random_0.5.tsv",
|
| 74 |
+
"index_name": null,
|
| 75 |
+
"parallel_queries": null,
|
| 76 |
+
"parallel_collections": null,
|
| 77 |
+
"maxsim_mapping": null,
|
| 78 |
+
"lexicon": null,
|
| 79 |
+
"debug": false,
|
| 80 |
+
"overwrite": false,
|
| 81 |
+
"root": "\/home\/jhkim980112\/workspace\/final_model_checkpoint\/",
|
| 82 |
+
"experiment": "CSD_xlmr",
|
| 83 |
+
"index_root": null,
|
| 84 |
+
"name": "enfa-fa_run1\/64bat.6way",
|
| 85 |
+
"rank": 0,
|
| 86 |
+
"nranks": 4,
|
| 87 |
+
"amp": true,
|
| 88 |
+
"ivf_num_processes": 20,
|
| 89 |
+
"ivf_use_tempdir": false,
|
| 90 |
+
"ivf_merging_ways": 2,
|
| 91 |
+
"gpus": 4
|
| 92 |
+
}
|
config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "xlm-roberta-large",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"HF_ColBERT"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"eos_token_id": 2,
|
| 10 |
+
"hidden_act": "gelu",
|
| 11 |
+
"hidden_dropout_prob": 0.1,
|
| 12 |
+
"hidden_size": 1024,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 4096,
|
| 15 |
+
"layer_norm_eps": 1e-05,
|
| 16 |
+
"max_position_embeddings": 514,
|
| 17 |
+
"model_type": "xlm-roberta",
|
| 18 |
+
"num_attention_heads": 16,
|
| 19 |
+
"num_hidden_layers": 24,
|
| 20 |
+
"output_past": true,
|
| 21 |
+
"pad_token_id": 1,
|
| 22 |
+
"position_embedding_type": "absolute",
|
| 23 |
+
"torch_dtype": "float32",
|
| 24 |
+
"transformers_version": "4.41.1",
|
| 25 |
+
"type_vocab_size": 1,
|
| 26 |
+
"use_cache": true,
|
| 27 |
+
"vocab_size": 250004
|
| 28 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c216924c7b986033fa1f5195579bf5888c2ee294a72c55dc116daa9847a5359d
|
| 3 |
+
size 2240142872
|
sentencepiece.bpe.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
|
| 3 |
+
size 5069051
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": "<s>",
|
| 3 |
+
"cls_token": "<s>",
|
| 4 |
+
"eos_token": "</s>",
|
| 5 |
+
"mask_token": {
|
| 6 |
+
"content": "<mask>",
|
| 7 |
+
"lstrip": true,
|
| 8 |
+
"normalized": false,
|
| 9 |
+
"rstrip": false,
|
| 10 |
+
"single_word": false
|
| 11 |
+
},
|
| 12 |
+
"pad_token": "<pad>",
|
| 13 |
+
"sep_token": "</s>",
|
| 14 |
+
"unk_token": "<unk>"
|
| 15 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:410ff101f2c7d6eb4f670a9410e9e27063dc10cd0c82fb1925ee779788d3036d
|
| 3 |
+
size 17083106
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "<s>",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "<pad>",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "</s>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"3": {
|
| 28 |
+
"content": "<unk>",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"250001": {
|
| 36 |
+
"content": "<mask>",
|
| 37 |
+
"lstrip": true,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
},
|
| 43 |
+
"250002": {
|
| 44 |
+
"content": "[unused0]",
|
| 45 |
+
"lstrip": false,
|
| 46 |
+
"normalized": true,
|
| 47 |
+
"rstrip": false,
|
| 48 |
+
"single_word": false,
|
| 49 |
+
"special": false
|
| 50 |
+
},
|
| 51 |
+
"250003": {
|
| 52 |
+
"content": "[unused1]",
|
| 53 |
+
"lstrip": false,
|
| 54 |
+
"normalized": true,
|
| 55 |
+
"rstrip": false,
|
| 56 |
+
"single_word": false,
|
| 57 |
+
"special": false
|
| 58 |
+
}
|
| 59 |
+
},
|
| 60 |
+
"bos_token": "<s>",
|
| 61 |
+
"clean_up_tokenization_spaces": true,
|
| 62 |
+
"cls_token": "<s>",
|
| 63 |
+
"eos_token": "</s>",
|
| 64 |
+
"mask_token": "<mask>",
|
| 65 |
+
"model_max_length": 512,
|
| 66 |
+
"pad_token": "<pad>",
|
| 67 |
+
"sep_token": "</s>",
|
| 68 |
+
"tokenizer_class": "XLMRobertaTokenizer",
|
| 69 |
+
"unk_token": "<unk>"
|
| 70 |
+
}
|