SentenceTransformer based on Alibaba-NLP/gte-large-en-v1.5
This is a sentence-transformers model finetuned from Alibaba-NLP/gte-large-en-v1.5 on the mathstackexchange, socratic and stackexchange datasets. 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: Alibaba-NLP/gte-large-en-v1.5
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 1024 tokens
- Similarity Function: Cosine Similarity
- Training Datasets:
- mathstackexchange
- socratic
- stackexchange
Model Sources
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: NewModel
(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})
)
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("mrm8488/gte-large-ft-webinstruct")
sentences = [
"What should I do if I'm not satisfied with the answers to a question for which I've offered a bounty?\n\nIn my case, I've put a bounty on a question, but the two responses I received don't address the issue effectively. I requested the original poster (OP) to provide an answer so I could reward them for the interesting question, but they haven't done so. \n\nAre there any acceptable actions in this scenario? For instance, can I post my own non-answer, award myself the bounty, and then start a new bounty on a different question? Or are there alternative suggestions?",
"If all the provided answers do not adequately address your question, it's advisable to let the bounty expire. The system will handle the distribution of the bounty in such situations according to predefined rules.\n\nBounties carry a risk, as there is no guarantee that you will receive a satisfactory answer, even with the incentive. It's important to understand that you cannot reclaim your bounty once it's been offered. \n\nInstead of posting a non-answer, you might consider editing and clarifying your original question to attract better responses, or seeking assistance from the community through comments or chat. If needed, you can also start a new bounty on a different question, but ensure that it's clear and well-defined to increase the likelihood of receiving quality answers.",
'The issue you\'re experiencing with your 40kHz crystal oscillator might be due to insufficient drive strength and an incorrect load capacitance. Here are two potential causes and solutions:\n\n1. High Series Resistance: The 150 kΩ series resistance in your circuit might be too high, which results in a low drive strength for the crystal. This can lead to a reduced overall loop gain and prevents the oscillator from properly starting. To resolve this, try using a lower resistance value as recommended in the crystal\'s datasheet.\n\n2. Incorrect Load Capacitance: Ensure that the 33 pF load capacitors you\'re using are compatible with your crystal. Some low-power "watch" crystals require only 5-10 pF load capacitors. Always refer to the crystal\'s datasheet to verify the appropriate load capacitance value.\n\nIn summary, carefully review the crystal\'s datasheet to determine the correct series resistance and load capacitance values, and make the necessary adjustments to your circuit. By doing so, you should be able to resolve the issue and get your oscillator functioning properly.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
Evaluation
Metrics
Semantic Similarity
Metric |
Value |
pearson_cosine |
0.8518 |
spearman_cosine |
0.859 |
pearson_manhattan |
0.8627 |
spearman_manhattan |
0.8594 |
pearson_euclidean |
0.8616 |
spearman_euclidean |
0.8584 |
pearson_dot |
0.8523 |
spearman_dot |
0.8596 |
pearson_max |
0.8627 |
spearman_max |
0.8596 |
Training Details
Training Datasets
mathstackexchange
socratic
stackexchange
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: steps
per_device_train_batch_size
: 16
per_device_eval_batch_size
: 16
max_steps
: 8000
warmup_ratio
: 0.1
bf16
: True
batch_sampler
: no_duplicates
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
: 16
per_device_eval_batch_size
: 16
per_gpu_train_batch_size
: None
per_gpu_eval_batch_size
: None
gradient_accumulation_steps
: 1
eval_accumulation_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.0
num_train_epochs
: 3.0
max_steps
: 8000
lr_scheduler_type
: linear
lr_scheduler_kwargs
: {}
warmup_ratio
: 0.1
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
: True
fp16
: False
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
: False
hub_always_push
: False
gradient_checkpointing
: False
gradient_checkpointing_kwargs
: None
include_inputs_for_metrics
: False
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
batch_sampler
: no_duplicates
multi_dataset_batch_sampler
: round_robin
Training Logs
Epoch |
Step |
Training Loss |
sts-dev_spearman_cosine |
0.0017 |
100 |
0.0398 |
- |
0.0034 |
200 |
0.017 |
- |
0.0050 |
300 |
0.0079 |
- |
0.0067 |
400 |
0.0067 |
- |
0.0084 |
500 |
0.0115 |
- |
0.0101 |
600 |
0.0201 |
- |
0.0118 |
700 |
0.0247 |
- |
0.0135 |
800 |
0.0343 |
- |
0.0151 |
900 |
0.0287 |
- |
0.0168 |
1000 |
0.052 |
0.8661 |
0.0185 |
1100 |
0.056 |
- |
0.0202 |
1200 |
0.0372 |
- |
0.0219 |
1300 |
0.0292 |
- |
0.0235 |
1400 |
0.032 |
- |
0.0252 |
1500 |
0.0358 |
- |
0.0269 |
1600 |
0.0429 |
- |
0.0286 |
1700 |
0.0398 |
- |
0.0303 |
1800 |
0.0446 |
- |
0.0319 |
1900 |
0.0618 |
- |
0.0336 |
2000 |
0.1387 |
0.8709 |
0.0353 |
2100 |
0.0847 |
- |
0.0370 |
2200 |
0.1316 |
- |
0.0387 |
2300 |
0.0963 |
- |
0.0404 |
2400 |
0.105 |
- |
0.0420 |
2500 |
0.1171 |
- |
0.0437 |
2600 |
0.1561 |
- |
0.0454 |
2700 |
0.1622 |
- |
0.0471 |
2800 |
0.0963 |
- |
0.0488 |
2900 |
0.1014 |
- |
0.0504 |
3000 |
0.0882 |
0.8579 |
0.0521 |
3100 |
0.1318 |
- |
0.0538 |
3200 |
0.0999 |
- |
0.0555 |
3300 |
0.0519 |
- |
0.0572 |
3400 |
0.0239 |
- |
0.0588 |
3500 |
0.0322 |
- |
0.0605 |
3600 |
0.0184 |
- |
0.0622 |
3700 |
0.0142 |
- |
0.0639 |
3800 |
0.021 |
- |
0.0656 |
3900 |
0.0228 |
- |
0.0673 |
4000 |
0.0253 |
0.8570 |
0.0689 |
4100 |
0.0151 |
- |
0.0706 |
4200 |
0.0178 |
- |
0.0723 |
4300 |
0.0284 |
- |
0.0740 |
4400 |
0.0155 |
- |
0.0757 |
4500 |
0.0188 |
- |
0.0773 |
4600 |
0.0079 |
- |
0.0790 |
4700 |
0.0209 |
- |
0.0807 |
4800 |
0.0111 |
- |
0.0824 |
4900 |
0.0212 |
- |
0.0841 |
5000 |
0.0101 |
0.8581 |
0.0857 |
5100 |
0.0183 |
- |
0.0874 |
5200 |
0.0115 |
- |
0.0891 |
5300 |
0.0098 |
- |
0.0908 |
5400 |
0.0116 |
- |
0.0925 |
5500 |
0.0167 |
- |
0.0942 |
5600 |
0.012 |
- |
0.0958 |
5700 |
0.0118 |
- |
0.0975 |
5800 |
0.0093 |
- |
0.0992 |
5900 |
0.0098 |
- |
0.1009 |
6000 |
0.0066 |
0.8575 |
0.1026 |
6100 |
0.0101 |
- |
0.1042 |
6200 |
0.0126 |
- |
0.1059 |
6300 |
0.0101 |
- |
0.1076 |
6400 |
0.0059 |
- |
0.1093 |
6500 |
0.0081 |
- |
0.1110 |
6600 |
0.0176 |
- |
0.1126 |
6700 |
0.0088 |
- |
0.1143 |
6800 |
0.0087 |
- |
0.1160 |
6900 |
0.0075 |
- |
0.1177 |
7000 |
0.0082 |
0.8549 |
0.1194 |
7100 |
0.0101 |
- |
0.1211 |
7200 |
0.006 |
- |
0.1227 |
7300 |
0.0099 |
- |
0.1244 |
7400 |
0.0097 |
- |
0.1261 |
7500 |
0.0045 |
- |
0.1278 |
7600 |
0.0092 |
- |
0.1295 |
7700 |
0.0066 |
- |
0.1311 |
7800 |
0.006 |
- |
0.1328 |
7900 |
0.0094 |
- |
0.1345 |
8000 |
0.0051 |
0.8590 |
Framework Versions
- Python: 3.10.12
- Sentence Transformers: 3.0.1
- Transformers: 4.42.4
- PyTorch: 2.4.0+cu121
- Accelerate: 0.34.0
- Datasets: 2.21.0
- Tokenizers: 0.19.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}
}