SentenceTransformer based on BAAI/bge-m3

This is a sentence-transformers model finetuned from BAAI/bge-m3. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: BAAI/bge-m3
  • Maximum Sequence Length: 8192 tokens
  • Output Dimensionality: 1024 dimensions
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 8192, 'do_lower_case': False}) with Transformer model: XLMRobertaModel 
  (1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
  (2): Normalize()
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

pip install -U sentence-transformers

Then you can load this model and run inference.

from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
    'ELR(Emergency Locking Retractor) 3점식 안전벨트는 어떤 상황에서 작동하여 안전벨트를 고정하게 되나요?',
    '3점식 안전벨트: • ELR(Emergency Locking Retractor): 모든 좌석에는 ELR 3점식 안전벨트가 장착되어 있습니다. 정상 주행 중에는 안전벨트를 착용해도 어느 정도 움직일 수 있고, 급정차, 급회전, 충돌과 같은 갑작스러운 변화가 발생하면 관성 잠금 장치가 작동해 안전벨트를 고정합니다.',
    '사이드 에어백: 사이드 에어백은 앞좌석 바깥쪽에 내장되어 있습니다. 에어백 작동 조건(측면 충돌, 전복 사고 등)에 해당하면 탑승자의 측면을 보호하기 위해 작동합니다. 앞좌석 센터 에어백은 운전석 오른쪽에 내장되어 있습니다. 사고가 났을 때 운전자와 동승자가 부딪히는 것을 방지하고 차량 내장 부품과의 충돌도 줄이기 위해 작동합니다.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

Evaluation

Metrics

Information Retrieval

Metric Value
cosine_accuracy@1 0.0256
cosine_accuracy@3 0.7926
cosine_accuracy@5 0.8917
cosine_accuracy@10 0.9645
cosine_precision@1 0.0256
cosine_precision@3 0.2642
cosine_precision@5 0.1783
cosine_precision@10 0.0964
cosine_recall@1 0.0256
cosine_recall@3 0.7926
cosine_recall@5 0.8917
cosine_recall@10 0.9645
cosine_ndcg@10 0.5756
cosine_mrr@10 0.4433
cosine_map@100 0.4449

Training Details

Training Dataset

Unnamed Dataset

  • Size: 1,634 training samples
  • Columns: sentence_0 and sentence_1
  • Approximate statistics based on the first 1000 samples:
    sentence_0 sentence_1
    type string string
    details
    • min: 12 tokens
    • mean: 23.84 tokens
    • max: 43 tokens
    • min: 14 tokens
    • mean: 203.19 tokens
    • max: 2889 tokens
  • Samples:
    sentence_0 sentence_1
    좌석을 작동할 때 안전벨트를 착용하면 어떤 문제가 발생할 수 있나요? 경고: • 좌석이 작동 중일 때에 신체나 물건이 끼이지 않도록 주의하십시오. • 프리미엄 릴렉션 좌석 및 레그레스트(종아리 지지대)가 작동된 상태에서 충돌 시 부상의 위험이 증가할 수 있으므로 가급적 주정차 시 또는 휴식 중일 때만 사용하십시오. • 안전벨트를 착용한 채로 좌석을 작동할 경우 가슴 쪽 안전벨트가 몸에 완전히 밀착되지 않을 수 있으므로 가급적 주정차 시 또는 휴식 중일 때만 사용하십시오.
    타임랩스 녹화 중 버튼 표시등의 깜빡임 주기는 몇 초인가요? 빌트인 캠 수동 녹화 및 표시등: • 빌트인 캠 수동 녹화 버튼을 통해 운전자가 원하는 시점의 영상을 저장할 수 있습니다. • 표시등이 켜짐, 깜빡임 등의 상태로 작동 상태를 알려줍니다. 상시 저장은 버튼 표시등 켜짐. 수동 버튼 이벤트 녹화 중은 버튼 표시등 깜빡임 (1초 주기). 충격 감지 이벤트 녹화 중은 버튼 표시등 깜빡임 (1초 주기.) 타임랩스 녹화 중은 버튼 표시등 깜빡임 (2초 주기) • 타임랩스 녹화는 최대 20분/40분/100분 동안 저장 가능합니다.
    경음기의 작동영역에 대해 주의해야 하는 이유는 무엇인가요? 경음기: 경음기의 작동영역을 누르면 경적음이 납니다. 과도한 사용은 피하고, 강한 힘으로 누르지 마십시오. 경음기를 주먹으로 내려치거나 뾰족한 물체로 누르는 경우 오작동할 수 있습니다. 주의사항: 경음기 작동 영역을 정확히 숙지하여 필요한 순간에 사용할 수 있도록 하십시오.
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 5
  • per_device_eval_batch_size: 5
  • num_train_epochs: 20
  • fp16: True
  • multi_dataset_batch_sampler: round_robin

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 5
  • per_device_eval_batch_size: 5
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 5e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1
  • num_train_epochs: 20
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.0
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: False
  • fp16: True
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: None
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • eval_use_gather_object: False
  • average_tokens_across_devices: False
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: round_robin

Training Logs

Epoch Step Training Loss cosine_ndcg@10
0.4587 50 - 0.5775
0.9174 100 - 0.5800
1.0 109 - 0.5788
1.3761 150 - 0.5807
1.8349 200 - 0.5892
2.0 218 - 0.5856
2.2936 250 - 0.5838
2.7523 300 - 0.5862
3.0 327 - 0.5887
3.2110 350 - 0.5822
3.6697 400 - 0.5953
4.0 436 - 0.5902
4.1284 450 - 0.5924
4.5872 500 0.0556 0.5794
5.0 545 - 0.5848
5.0459 550 - 0.5841
5.5046 600 - 0.5831
5.9633 650 - 0.5766
6.0 654 - 0.5798
6.4220 700 - 0.5717
6.8807 750 - 0.5770
7.0 763 - 0.5767
7.3394 800 - 0.5708
7.7982 850 - 0.5774
8.0 872 - 0.5756
8.2569 900 - 0.5805
8.7156 950 - 0.5863
9.0 981 - 0.5757
9.1743 1000 0.0244 0.5751
9.6330 1050 - 0.5712
10.0 1090 - 0.5810
10.0917 1100 - 0.5711
10.5505 1150 - 0.5741
11.0 1199 - 0.5805
11.0092 1200 - 0.5797
11.4679 1250 - 0.5791
11.9266 1300 - 0.5817
12.0 1308 - 0.5764
12.3853 1350 - 0.5694
12.8440 1400 - 0.5818
13.0 1417 - 0.5811
13.3028 1450 - 0.5773
13.7615 1500 0.0183 0.5747
14.0 1526 - 0.5679
14.2202 1550 - 0.5771
14.6789 1600 - 0.5764
15.0 1635 - 0.5618
15.1376 1650 - 0.5701
15.5963 1700 - 0.5692
16.0 1744 - 0.5698
16.0550 1750 - 0.5678
16.5138 1800 - 0.5697
16.9725 1850 - 0.5696
17.0 1853 - 0.5699
17.4312 1900 - 0.5763
17.8899 1950 - 0.5720
18.0 1962 - 0.5695
18.3486 2000 0.0127 0.5695
18.8073 2050 - 0.5721
19.0 2071 - 0.5737
19.2661 2100 - 0.5662
19.7248 2150 - 0.5705
20.0 2180 - 0.5756

Framework Versions

  • Python: 3.10.16
  • Sentence Transformers: 4.1.0
  • Transformers: 4.52.3
  • PyTorch: 2.7.0+cu126
  • Accelerate: 1.7.0
  • Datasets: 3.6.0
  • Tokenizers: 0.21.1

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",
}

MultipleNegativesRankingLoss

@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply},
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}
Downloads last month
8
Safetensors
Model size
568M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for JLee0/rag-embedder-staria-20epochs

Base model

BAAI/bge-m3
Finetuned
(299)
this model

Evaluation results