SentenceTransformer based on intfloat/multilingual-e5-large-instruct
This is a sentence-transformers model finetuned from intfloat/multilingual-e5-large-instruct on the json dataset. It maps inputs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, classification, clustering, and more.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: intfloat/multilingual-e5-large-instruct
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 1024 dimensions
- Similarity Function: Cosine Similarity
- Supported Modality: Text
- Training Dataset:
Model Sources
Full Model Architecture
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'XLMRobertaModel'})
(1): Pooling({'embedding_dimension': 1024, 'pooling_mode': 'mean', 'include_prompt': True})
(2): Normalize({'module_input_name': 'sentence_embedding', 'module_output_name': 'sentence_embedding'})
)
Evaluation
Metrics
Rank Zero IR
- Dataset:
legal-val
- Evaluated with main.RankZeroIREvaluator
| Metric | Value |
|---|
| cosine_accuracy@1 | 0.346 |
| cosine_accuracy@5 | 0.652 |
| cosine_accuracy@10 | 0.73 |
| cosine_precision@1 | 0.346 |
| cosine_precision@10 | 0.1218 |
| cosine_recall@1 | 0.1765 |
| cosine_recall@10 | 0.4794 |
| cosine_ndcg@10 | 0.3937 |
| cosine_mrr@10 | 0.4747 |
| cosine_map@100 | 0.3202 |
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 1024
num_train_epochs: 1.0
learning_rate: 1e-05
lr_scheduler_type: cosine
warmup_steps: 82
weight_decay: 0.01
bf16: True
tf32: True
per_device_eval_batch_size: 1024
push_to_hub: True
hub_private_repo: True
hub_model_id: Ehsanl/me5-large-inst-nlr-mp
hub_strategy: checkpoint
load_best_model_at_end: True
dataloader_num_workers: 2
dataloader_pin_memory: False
ddp_find_unused_parameters: False
All Hyperparameters
per_device_train_batch_size: 1024
num_train_epochs: 1.0
max_steps: -1
learning_rate: 1e-05
lr_scheduler_type: cosine
lr_scheduler_kwargs: None
warmup_steps: 82
optim: adamw_torch_fused
optim_args: None
weight_decay: 0.01
adam_beta1: 0.9
adam_beta2: 0.999
adam_epsilon: 1e-08
optim_target_modules: None
gradient_accumulation_steps: 1
average_tokens_across_devices: True
max_grad_norm: 1.0
label_smoothing_factor: 0.0
bf16: True
fp16: False
bf16_full_eval: False
fp16_full_eval: False
tf32: True
gradient_checkpointing: False
gradient_checkpointing_kwargs: None
torch_compile: False
torch_compile_backend: None
torch_compile_mode: None
use_liger_kernel: False
liger_kernel_config: None
use_cache: False
neftune_noise_alpha: None
torch_empty_cache_steps: None
auto_find_batch_size: False
log_on_each_node: True
logging_nan_inf_filter: True
include_num_input_tokens_seen: no
log_level: passive
log_level_replica: warning
disable_tqdm: False
project: huggingface
trackio_space_id: None
trackio_bucket_id: None
trackio_static_space_id: None
per_device_eval_batch_size: 1024
prediction_loss_only: True
eval_on_start: False
eval_do_concat_batches: True
eval_use_gather_object: False
eval_accumulation_steps: None
include_for_metrics: []
batch_eval_metrics: False
save_only_model: False
save_on_each_node: False
enable_jit_checkpoint: False
push_to_hub: True
hub_private_repo: True
hub_model_id: Ehsanl/me5-large-inst-nlr-mp
hub_strategy: checkpoint
hub_always_push: False
hub_revision: None
load_best_model_at_end: True
ignore_data_skip: False
restore_callback_states_from_checkpoint: False
full_determinism: False
seed: 42
data_seed: None
use_cpu: False
accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
parallelism_config: None
dataloader_drop_last: True
dataloader_num_workers: 2
dataloader_pin_memory: False
dataloader_persistent_workers: False
dataloader_prefetch_factor: None
dataloader_multiprocessing_context: None
dataloader_in_order: True
remove_unused_columns: True
label_names: None
train_sampling_strategy: random
length_column_name: length
ddp_find_unused_parameters: False
ddp_bucket_cap_mb: None
ddp_broadcast_buffers: False
ddp_static_graph: None
ddp_backend: None
ddp_timeout: 1800
fsdp: None
fsdp_config: None
deepspeed: None
debug: []
skip_memory_metrics: True
do_predict: False
resume_from_checkpoint: None
local_rank: -1
prompts: None
batch_sampler: batch_sampler
multi_dataset_batch_sampler: proportional
router_mapping: {}
learning_rate_mapping: {}
warmup_ratio: None
Training Logs
| Epoch | Step | Training Loss | Validation Loss | legal-val_cosine_ndcg@10 |
|---|
| 0.0012 | 1 | 8.5131 | - | - |
| 0.0122 | 10 | 8.3247 | - | - |
| 0.0244 | 20 | 8.1516 | - | - |
| 0.0366 | 30 | 7.5765 | - | - |
| 0.0488 | 40 | 6.8633 | - | - |
| 0.0611 | 50 | 6.2996 | - | - |
| 0.0733 | 60 | 5.9615 | - | - |
| 0.0855 | 70 | 5.7080 | - | - |
| 0.0977 | 80 | 5.5448 | - | - |
| 0.1099 | 90 | 5.4287 | - | - |
| 0.1221 | 100 | 5.3660 | - | - |
| 0.1343 | 110 | 5.2617 | - | - |
| 0.1465 | 120 | 5.2213 | - | - |
| 0.1587 | 130 | 5.1572 | - | - |
| 0.1709 | 140 | 5.1400 | - | - |
| 0.1832 | 150 | 5.1231 | - | - |
| 0.1954 | 160 | 5.0084 | - | - |
| 0.2076 | 170 | 5.0263 | - | - |
| 0.2198 | 180 | 5.0142 | - | - |
| 0.2320 | 190 | 4.9915 | - | - |
| 0.2442 | 200 | 4.9448 | 5.4663 | 0.3522 |
| 0.2564 | 210 | 4.9054 | - | - |
| 0.2686 | 220 | 4.9004 | - | - |
| 0.2808 | 230 | 4.8801 | - | - |
| 0.2930 | 240 | 4.8064 | - | - |
| 0.3053 | 250 | 4.8584 | - | - |
| 0.3175 | 260 | 4.7657 | - | - |
| 0.3297 | 270 | 4.8093 | - | - |
| 0.3419 | 280 | 4.7967 | - | - |
| 0.3541 | 290 | 4.7735 | - | - |
| 0.3663 | 300 | 4.7757 | - | - |
| 0.3785 | 310 | 4.7083 | - | - |
| 0.3907 | 320 | 4.7798 | - | - |
| 0.4029 | 330 | 4.7107 | - | - |
| 0.4151 | 340 | 4.6429 | - | - |
| 0.4274 | 350 | 4.6906 | - | - |
| 0.4396 | 360 | 4.6840 | - | - |
| 0.4518 | 370 | 4.6699 | - | - |
| 0.4640 | 380 | 4.6691 | - | - |
| 0.4762 | 390 | 4.6349 | - | - |
| 0.4884 | 400 | 4.6295 | 5.2110 | 0.3902 |
| 0.5006 | 410 | 4.5531 | - | - |
| 0.5128 | 420 | 4.5581 | - | - |
| 0.5250 | 430 | 4.5763 | - | - |
| 0.5372 | 440 | 4.5832 | - | - |
| 0.5495 | 450 | 4.5696 | - | - |
| 0.5617 | 460 | 4.5750 | - | - |
| 0.5739 | 470 | 4.5655 | - | - |
| 0.5861 | 480 | 4.5153 | - | - |
| 0.5983 | 490 | 4.6157 | - | - |
| 0.6105 | 500 | 4.5785 | - | - |
| 0.6227 | 510 | 4.5265 | - | - |
| 0.6349 | 520 | 4.5775 | - | - |
| 0.6471 | 530 | 4.5415 | - | - |
| 0.6593 | 540 | 4.5220 | - | - |
| 0.6716 | 550 | 4.4978 | - | - |
| 0.6838 | 560 | 4.5658 | - | - |
| 0.6960 | 570 | 4.5681 | - | - |
| 0.7082 | 580 | 4.4876 | - | - |
| 0.7204 | 590 | 4.5197 | - | - |
| 0.7326 | 600 | 4.5186 | 5.1290 | 0.3937 |
Training Time
- Training: 21.5 hours
- Evaluation: 44.6 minutes
- Total: 22.3 hours
Framework Versions
- Python: 3.12.14
- Sentence Transformers: 6.1.0
- Transformers: 5.19.0
- PyTorch: 2.11.0+cu128
- Accelerate: 1.15.0
- Datasets: 5.1.0
- Tokenizers: 0.23.3
Additional Resources
Citation
BibTeX
Sentence Transformers
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
CachedMultipleNegativesRankingLoss
@misc{gao2021scaling,
title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
year={2021},
eprint={2101.06983},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
MultipleNegativesRankingLoss
@misc{oord2019representationlearningcontrastivepredictive,
title={Representation Learning with Contrastive Predictive Coding},
author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
year={2019},
eprint={1807.03748},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1807.03748},
}