SentenceTransformer based on BAAI/bge-base-en-v1.5
This is a sentence-transformers model finetuned from BAAI/bge-base-en-v1.5 on the reason_ccnews, reason_reddit and reason_s2orc datasets. It maps sentences & paragraphs to a 768-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-base-en-v1.5
- Maximum Sequence Length: 256 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity
- Training Datasets:
Model Sources
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 256, 'do_lower_case': True}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 768, '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
model = SentenceTransformer("bwang0911/reasoning-bge")
sentences = [
'Crossover and multicriticality due to the Dzyaloshinsky-Moriya interaction',
'We show that the addition of a Dzyaloshinsky-Moriya interaction to a Heisenberg ferromagnet introduces only one crossover exponent, which is the same as for the usual uniaxial anisotropy. This result is in contrast to a previous report by Liu.',
'The second text elaborates on the first by specifying the impact of the Dzyaloshinsky-Moriya interaction on a Heisenberg ferromagnet. It highlights a key finding: the introduction of only one crossover exponent, contrasting with a prior study. This directly addresses the topic introduced in the title.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
Evaluation
Metrics
Information Retrieval
| Metric |
mteb/nfcorpus |
mteb/trec-covid |
mteb/fiqa |
mteb/quora |
| cosine_accuracy@1 |
0.5046 |
0.86 |
0.358 |
0.8112 |
| cosine_accuracy@3 |
0.6347 |
1.0 |
0.5231 |
0.9258 |
| cosine_accuracy@5 |
0.6966 |
1.0 |
0.5849 |
0.9553 |
| cosine_accuracy@10 |
0.7678 |
1.0 |
0.6744 |
0.9773 |
| cosine_precision@1 |
0.5046 |
0.86 |
0.358 |
0.8112 |
| cosine_precision@3 |
0.3994 |
0.88 |
0.2325 |
0.3724 |
| cosine_precision@5 |
0.3573 |
0.856 |
0.1694 |
0.2455 |
| cosine_precision@10 |
0.2867 |
0.832 |
0.1065 |
0.1341 |
| cosine_recall@1 |
0.0652 |
0.0007 |
0.1851 |
0.7047 |
| cosine_recall@3 |
0.1139 |
0.0022 |
0.318 |
0.8691 |
| cosine_recall@5 |
0.1396 |
0.0036 |
0.372 |
0.9145 |
| cosine_recall@10 |
0.1869 |
0.0069 |
0.4559 |
0.9525 |
| cosine_ndcg@10 |
0.3825 |
0.8435 |
0.3827 |
0.8812 |
| cosine_mrr@10 |
0.5875 |
0.9233 |
0.4577 |
0.873 |
| cosine_map@100 |
0.196 |
0.5214 |
0.3237 |
0.8502 |
Training Details
Training Datasets
reason_ccnews
reason_reddit
reason_s2orc
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: steps
per_device_train_batch_size: 128
learning_rate: 5e-06
num_train_epochs: 1
warmup_ratio: 0.2
fp16: True
batch_sampler: no_duplicates
All Hyperparameters
Click to expand
overwrite_output_dir: False
do_predict: False
eval_strategy: steps
prediction_loss_only: True
per_device_train_batch_size: 128
per_device_eval_batch_size: 8
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-06
weight_decay: 0.0
adam_beta1: 0.9
adam_beta2: 0.999
adam_epsilon: 1e-08
max_grad_norm: 1.0
num_train_epochs: 1
max_steps: -1
lr_scheduler_type: linear
lr_scheduler_kwargs: {}
warmup_ratio: 0.2
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}
tp_size: 0
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
dispatch_batches: None
split_batches: 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: no_duplicates
multi_dataset_batch_sampler: proportional
Training Logs
| Epoch |
Step |
Training Loss |
mteb/nfcorpus_cosine_ndcg@10 |
mteb/trec-covid_cosine_ndcg@10 |
mteb/fiqa_cosine_ndcg@10 |
mteb/quora_cosine_ndcg@10 |
| -1 |
-1 |
- |
0.3714 |
0.8385 |
0.3831 |
0.8889 |
| 0.0070 |
10 |
0.9492 |
- |
- |
- |
- |
| 0.0140 |
20 |
0.9799 |
- |
- |
- |
- |
| 0.0210 |
30 |
0.84 |
- |
- |
- |
- |
| 0.0280 |
40 |
0.9555 |
- |
- |
- |
- |
| 0.0350 |
50 |
0.9292 |
0.3695 |
0.8401 |
0.3840 |
0.8892 |
| 0.0420 |
60 |
1.1549 |
- |
- |
- |
- |
| 0.0490 |
70 |
0.8573 |
- |
- |
- |
- |
| 0.0559 |
80 |
0.5784 |
- |
- |
- |
- |
| 0.0629 |
90 |
0.7275 |
- |
- |
- |
- |
| 0.0699 |
100 |
0.4792 |
0.3766 |
0.8457 |
0.3886 |
0.8887 |
| 0.0769 |
110 |
0.6293 |
- |
- |
- |
- |
| 0.0839 |
120 |
0.5167 |
- |
- |
- |
- |
| 0.0909 |
130 |
0.3838 |
- |
- |
- |
- |
| 0.0979 |
140 |
0.3458 |
- |
- |
- |
- |
| 0.1049 |
150 |
0.4897 |
0.3739 |
0.8494 |
0.3866 |
0.8876 |
| 0.1119 |
160 |
0.3124 |
- |
- |
- |
- |
| 0.1189 |
170 |
0.4367 |
- |
- |
- |
- |
| 0.1259 |
180 |
0.3565 |
- |
- |
- |
- |
| 0.1329 |
190 |
0.2646 |
- |
- |
- |
- |
| 0.1399 |
200 |
0.2 |
0.3757 |
0.8508 |
0.3852 |
0.8860 |
| 0.1469 |
210 |
0.2051 |
- |
- |
- |
- |
| 0.1538 |
220 |
0.1248 |
- |
- |
- |
- |
| 0.1608 |
230 |
0.2398 |
- |
- |
- |
- |
| 0.1678 |
240 |
0.1599 |
- |
- |
- |
- |
| 0.1748 |
250 |
0.3251 |
0.3743 |
0.8527 |
0.3840 |
0.8840 |
| 0.1818 |
260 |
0.263 |
- |
- |
- |
- |
| 0.1888 |
270 |
0.2523 |
- |
- |
- |
- |
| 0.1958 |
280 |
0.2156 |
- |
- |
- |
- |
| 0.2028 |
290 |
0.1587 |
- |
- |
- |
- |
| 0.2098 |
300 |
0.1977 |
0.3777 |
0.8557 |
0.3859 |
0.8830 |
| 0.2168 |
310 |
0.1544 |
- |
- |
- |
- |
| 0.2238 |
320 |
0.1301 |
- |
- |
- |
- |
| 0.2308 |
330 |
0.1178 |
- |
- |
- |
- |
| 0.2378 |
340 |
0.1084 |
- |
- |
- |
- |
| 0.2448 |
350 |
0.1784 |
0.3800 |
0.8540 |
0.3860 |
0.8821 |
| 0.2517 |
360 |
0.1541 |
- |
- |
- |
- |
| 0.2587 |
370 |
0.0982 |
- |
- |
- |
- |
| 0.2657 |
380 |
0.1897 |
- |
- |
- |
- |
| 0.2727 |
390 |
0.117 |
- |
- |
- |
- |
| 0.2797 |
400 |
0.1806 |
0.3785 |
0.8458 |
0.3861 |
0.8818 |
| 0.2867 |
410 |
0.1258 |
- |
- |
- |
- |
| 0.2937 |
420 |
0.1249 |
- |
- |
- |
- |
| 0.3007 |
430 |
0.1987 |
- |
- |
- |
- |
| 0.3077 |
440 |
0.1512 |
- |
- |
- |
- |
| 0.3147 |
450 |
0.1646 |
0.3817 |
0.8422 |
0.3829 |
0.8814 |
| 0.3217 |
460 |
0.1322 |
- |
- |
- |
- |
| 0.3287 |
470 |
0.1464 |
- |
- |
- |
- |
| 0.3357 |
480 |
0.1488 |
- |
- |
- |
- |
| 0.3427 |
490 |
0.1033 |
- |
- |
- |
- |
| 0.3497 |
500 |
0.1209 |
0.3825 |
0.8435 |
0.3827 |
0.8812 |
Framework Versions
- Python: 3.10.12
- Sentence Transformers: 3.5.0.dev0
- Transformers: 4.50.0
- PyTorch: 2.6.0+cu124
- Accelerate: 1.5.2
- Datasets: 2.21.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",
}