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.35 |
| cosine_accuracy@5 | 0.636 |
| cosine_accuracy@10 | 0.724 |
| cosine_precision@1 | 0.35 |
| cosine_precision@10 | 0.116 |
| cosine_recall@1 | 0.1904 |
| cosine_recall@10 | 0.4938 |
| cosine_ndcg@10 | 0.4009 |
| cosine_mrr@10 | 0.4739 |
| cosine_map@100 | 0.3293 |
Training Details
Training Dataset
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 1536
num_train_epochs: 1.0
learning_rate: 5e-06
lr_scheduler_type: cosine
warmup_steps: 34
weight_decay: 0.01
bf16: True
tf32: True
per_device_eval_batch_size: 1536
push_to_hub: True
hub_private_repo: True
hub_model_id: Ehsanl/me5-large-inst-nlr-mp_v2
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: 1536
num_train_epochs: 1.0
max_steps: -1
learning_rate: 5e-06
lr_scheduler_type: cosine
lr_scheduler_kwargs: None
warmup_steps: 34
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: 1536
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_v2
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.0029 | 1 | 8.8770 | - | - |
| 0.0294 | 10 | 8.6678 | - | - |
| 0.0588 | 20 | 8.4536 | - | - |
| 0.0882 | 30 | 7.7698 | - | - |
| 0.1176 | 40 | 7.0578 | - | - |
| 0.1471 | 50 | 6.4900 | - | - |
| 0.1765 | 60 | 6.2059 | - | - |
| 0.2059 | 70 | 6.0703 | - | - |
| 0.2353 | 80 | 5.9877 | 5.8602 | 0.3413 |
| 0.2647 | 90 | 5.8773 | - | - |
| 0.2941 | 100 | 5.8115 | - | - |
| 0.3235 | 110 | 5.7587 | - | - |
| 0.3529 | 120 | 5.7053 | - | - |
| 0.3824 | 130 | 5.6798 | - | - |
| 0.4118 | 140 | 5.6232 | - | - |
| 0.4412 | 150 | 5.6265 | - | - |
| 0.4706 | 160 | 5.5893 | 5.4981 | 0.3870 |
| 0.5 | 170 | 5.5305 | - | - |
| 0.5294 | 180 | 5.5274 | - | - |
| 0.5588 | 190 | 5.5227 | - | - |
| 0.5882 | 200 | 5.5207 | - | - |
| 0.6176 | 210 | 5.4751 | - | - |
| 0.6471 | 220 | 5.4842 | - | - |
| 0.6765 | 230 | 5.4665 | - | - |
| 0.7059 | 240 | 5.4251 | 5.3733 | 0.401 |
| 0.7353 | 250 | 5.4641 | - | - |
| 0.7647 | 260 | 5.4441 | - | - |
| 0.7941 | 270 | 5.4411 | - | - |
| 0.8235 | 280 | 5.4264 | - | - |
| 0.8529 | 290 | 5.4292 | - | - |
| 0.8824 | 300 | 5.4692 | - | - |
| 0.9118 | 310 | 5.4271 | - | - |
| 0.9412 | 320 | 5.4174 | 5.3474 | 0.4002 |
| 0.9706 | 330 | 5.4161 | - | - |
| 1.0 | 340 | 5.4045 | 5.3473 | 0.4009 |
- The bold row denotes the saved checkpoint.
Training Time
- Training: 17.2 hours
- Evaluation: 38.9 minutes
- Total: 17.9 hours
Framework Versions
- Python: 3.12.15
- Sentence Transformers: 6.1.0
- Transformers: 5.20.1
- 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",
}
WeightedMultiPositiveCachedLoss
@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},
}