Sentence Similarity
sentence-transformers
Safetensors
English
feature-extraction
Generated from Trainer
dataset_size:4373977
loss:MatryoshkaLoss
loss:MultipleNegativesRankingLoss
Eval Results (legacy)
Instructions to use LocalWisdom/PurpleStatic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use LocalWisdom/PurpleStatic with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("LocalWisdom/PurpleStatic") sentences = [ "crack", "master", "Academic journals often publish both print editions and digital versions simultaneously.", "ceramic ware" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
metadata
language:
- en
license: wtfpl
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:4373977
- loss:MatryoshkaLoss
- loss:MultipleNegativesRankingLoss
datasets:
- BatuhanECB/FinModernBERT-pairs-sec-synthetic-v1
- Heliosoph/Quora-Question-Pairs
- owenkaplinsky/wildchat-paraphrases
- mjbommar/ogbert-v1-contrastive
- mjbommar/opengloss-v1.3-contrastive-examples
widget:
- source_sentence: crack
sentences:
- master
- >-
Academic journals often publish both print editions and digital versions
simultaneously.
- ceramic ware
- source_sentence: >-
An area where a specific ethnic group maintains distinctive social and
cultural institutions within the larger city.
sentences:
- foot
- >-
Policy makers study ethnic enclaves to understand immigrant
entrepreneurship.
- economic entity
- source_sentence: >-
We lease various facilities, office equipment, plant equipment and
railcars under operating leases.
sentences:
- >-
Under the ESPP, qualified employees are permitted to invest as much as
ten percent of their base pay to acquire company common stock at a
discount of 15 percent off the closing market price on the day of
purchase.
- >-
On March 1, 2006, the total number of full-time staff members across
ACGL and its subsidiary companies was roughly 980.
- >-
Our company utilizes operating leases for the rental of various types of
equipment, including railcars, plant machinery, office gear, and various
facilities.
- source_sentence: How will the ban of Rs 500 and Rs 1000 notes affect Indian economy?
sentences:
- Where can I get professional photo booths service in Sydney?
- >-
What are your views on India banning 500 and 1000 notes? In what way it
will affect Indian economy?
- What are some of your favorite sayings?
- source_sentence: How do you write a song?
sentences:
- How did Portugal become an independent country from Spain?
- Who created the "GOD"?
- How do I write a song?
pipeline_tag: sentence-similarity
library_name: sentence-transformers
model-index:
- name: PurpleStatic
results:
- task:
type: sentence-similarity
dataset:
name: STSBenchmark
type: mteb
metrics:
- name: pass@1
type: pass@1
value: 0.550741
verified: false
- task:
type: sentence-similarity
dataset:
name: STSBenchmark.v2
type: mteb
metrics:
- name: pass@1
type: pass@1
value: 0.5972485
verified: false
PurpleStatic: Static Embeddings
This is a sentence-transformers model trained on the BatuhanECB/FinModernBERT-pairs-sec-synthetic-v1, Heliosoph/Quora-Question-Pairs, owenkaplinsky/wildchat-paraphrases, mjbommar/ogbert-v1-contrastive and mjbommar/opengloss-v1.3-contrastive-examples datasets. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for retrieval.
Model Details
Model Description
- Model Type: Sentence Transformer
- Maximum Sequence Length: inf tokens
- Output Dimensionality: 1024 dimensions
- Similarity Function: Cosine Similarity
- Supported Modality: Text
- Training Datasets:
- BatuhanECB/FinModernBERT-pairs-sec-synthetic-v1
- Heliosoph/Quora-Question-Pairs
- owenkaplinsky/wildchat-paraphrases
- mjbommar/ogbert-v1-contrastive
- mjbommar/opengloss-v1.3-contrastive-examples
- Language: en
- License: wtfpl
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): StaticEmbedding({})
)
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("LocalWisdom/PurpleStatic")
# Run inference
sentences = [
'How do you write a song?',
'How do I write a song?',
'How did Portugal become an independent country from Spain?',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.8566, 0.1409],
# [0.8566, 1.0000, 0.1259],
# [0.1409, 0.1259, 1.0000]])
Training Details
Training Datasets
BatuhanECB/FinModernBERT-pairs-sec-synthetic-v1
BatuhanECB/FinModernBERT-pairs-sec-synthetic-v1
- Dataset: BatuhanECB/FinModernBERT-pairs-sec-synthetic-v1
- Size: 5,694 training samples
- Columns:
anchorandpositive - Approximate statistics based on the first 100 samples:
anchor positive type string string modality text text details - min: 47 characters
- mean: 135.34 characters
- max: 352 characters
- min: 70 characters
- mean: 146.17 characters
- max: 322 characters
- Samples:
anchor positive Of our total net revenue of $10.8 billion in the fiscal year ended October 31, 2000, we generated 44.2% in the United States and 55.8% internationally.In the fiscal year concluding October 31, 2000, the company produced 44.2% of its $10.8 billion total net revenue within the United States and 55.8% from international markets.Our sales strategy is to sell to and service our largest accounts (hospital and corporate business) directly while employing third-party distributors and manufacturer's representatives for smaller or more geographically dispersed countries.We utilize a sales approach where we directly manage and sell to our major hospital and corporate clients, while relying on external distributors and manufacturer agents to reach smaller markets or those in remote locations.In August 2000, we announced a restructuring of our healthcare solutions business.The company declared a reorganization of its healthcare solutions division in August 2000. - Loss:
MatryoshkaLosswith these parameters:{ "loss": "MultipleNegativesRankingLoss", "matryoshka_dims": [ 1024, 768, 512, 256, 128, 64, 32 ], "matryoshka_weights": [ 1, 1, 1, 1, 1, 1, 1 ], "n_dims_per_step": -1 }
Heliosoph/Quora-Question-Pairs
Heliosoph/Quora-Question-Pairs
- Dataset: Heliosoph/Quora-Question-Pairs
- Size: 149,263 training samples
- Columns:
anchorandpositive - Approximate statistics based on the first 100 samples:
anchor positive type string string modality text text details - min: 16 characters
- mean: 54.75 characters
- max: 139 characters
- min: 21 characters
- mean: 54.34 characters
- max: 127 characters
- Samples:
anchor positive Astrology: I am a Capricorn Sun Cap moon and cap rising...what does that say about me?I'm a triple Capricorn (Sun, Moon and ascendant in Capricorn) What does this say about me?How can I be a good geologist?What should I do to be a great geologist?How do I read and find my YouTube comments?How can I see all my Youtube comments? - Loss:
MatryoshkaLosswith these parameters:{ "loss": "MultipleNegativesRankingLoss", "matryoshka_dims": [ 1024, 768, 512, 256, 128, 64, 32 ], "matryoshka_weights": [ 1, 1, 1, 1, 1, 1, 1 ], "n_dims_per_step": -1 }
owenkaplinsky/wildchat-paraphrases
owenkaplinsky/wildchat-paraphrases
- Dataset: owenkaplinsky/wildchat-paraphrases
- Size: 1,383,750 training samples
- Columns:
anchorandpositive - Approximate statistics based on the first 100 samples:
anchor positive type string string modality text text details - min: 20 characters
- mean: 133.6 characters
- max: 733 characters
- min: 23 characters
- mean: 129.4 characters
- max: 639 characters
- Samples:
anchor positive name current finance minister of pakistanidentify the present finance minister of pakistanname current finance minister of pakistanwho is pakistan's finance minister right nowname current finance minister of pakistanstate the name of the current pakistani minister of finance - Loss:
MatryoshkaLosswith these parameters:{ "loss": "MultipleNegativesRankingLoss", "matryoshka_dims": [ 1024, 768, 512, 256, 128, 64, 32 ], "matryoshka_weights": [ 1, 1, 1, 1, 1, 1, 1 ], "n_dims_per_step": -1 }
mjbommar/ogbert-v1-contrastive
mjbommar/ogbert-v1-contrastive
- Dataset: mjbommar/ogbert-v1-contrastive
- Size: 2,673,774 training samples
- Columns:
anchorandpositives - Approximate statistics based on the first 100 samples:
anchor positives type string string modality text text details - min: 4 characters
- mean: 50.25 characters
- max: 178 characters
- min: 4 characters
- mean: 36.68 characters
- max: 121 characters
- Samples:
anchor positives The arrangement of halftone dots or grid that encodes tonal values in a halftone image.The halftone dot grid encodes tonal levels.A formal subset of managers designated to handle day-to-day operations and implement board decisions.The executive team meets monthly to review progress and adjust plans.niche market segmentsubmarket - Loss:
MatryoshkaLosswith these parameters:{ "loss": "MultipleNegativesRankingLoss", "matryoshka_dims": [ 1024, 768, 512, 256, 128, 64, 32 ], "matryoshka_weights": [ 1, 1, 1, 1, 1, 1, 1 ], "n_dims_per_step": -1 }
mjbommar/opengloss-v1.3-contrastive-examples
mjbommar/opengloss-v1.3-contrastive-examples
- Dataset: mjbommar/opengloss-v1.3-contrastive-examples
- Size: 161,496 training samples
- Columns:
anchor,positives,negatives_1, andnegatives_2 - Approximate statistics based on the first 100 samples:
anchor positives negatives_1 negatives_2 type string string string string modality text text text text details - min: 37 characters
- mean: 70.41 characters
- max: 145 characters
- min: 36 characters
- mean: 71.77 characters
- max: 146 characters
- min: 33 characters
- mean: 72.34 characters
- max: 145 characters
- min: 35 characters
- mean: 71.88 characters
- max: 146 characters
- Samples:
anchor positives negatives_1 negatives_2 Field interviews revealed a stony demeanor even when pressed for clarification.Field interviews revealed a stoic demeanor even when pressed for clarification.Field interviews revealed a warm demeanor even when pressed for clarification.Field interviews revealed an empathetic demeanor even when pressed for clarification.The board followed formal protocol during the review.The board followed official protocol during the review.The board followed casual protocol during the review.The board followed informal protocol during the review.The athlete carefully inspected the luge before the final run.The athlete carefully inspected the toboggan before the final run.The athlete carefully inspected the sled before the final run.The athlete carefully inspected the bobsled before the final run. - Loss:
MatryoshkaLosswith these parameters:{ "loss": "MultipleNegativesRankingLoss", "matryoshka_dims": [ 1024, 768, 512, 256, 128, 64, 32 ], "matryoshka_weights": [ 1, 1, 1, 1, 1, 1, 1 ], "n_dims_per_step": -1 }
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 4096num_train_epochs: 20learning_rate: 0.0001warmup_steps: 0.1bf16: Truebatch_sampler: no_duplicates
All Hyperparameters
Click to expand
per_device_train_batch_size: 4096num_train_epochs: 20max_steps: -1learning_rate: 0.0001lr_scheduler_type: linearlr_scheduler_kwargs: Nonewarmup_steps: 0.1optim: adamw_torch_fusedoptim_args: Noneweight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08optim_target_modules: Nonegradient_accumulation_steps: 1average_tokens_across_devices: Truemax_grad_norm: 1.0label_smoothing_factor: 0.0bf16: Truefp16: Falsebf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Nonetorch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneuse_liger_kernel: Falseliger_kernel_config: Noneuse_cache: Falseneftune_noise_alpha: Nonetorch_empty_cache_steps: Noneauto_find_batch_size: Falselog_on_each_node: Truelogging_nan_inf_filter: Trueinclude_num_input_tokens_seen: nolog_level: passivelog_level_replica: warningdisable_tqdm: Falseproject: huggingfacetrackio_space_id: Nonetrackio_bucket_id: Nonetrackio_static_space_id: Noneper_device_eval_batch_size: 8prediction_loss_only: Trueeval_on_start: Falseeval_do_concat_batches: Trueeval_use_gather_object: Falseeval_accumulation_steps: Noneinclude_for_metrics: []batch_eval_metrics: Falsesave_only_model: Falsesave_on_each_node: Falseenable_jit_checkpoint: Falsepush_to_hub: Falsehub_private_repo: Nonehub_model_id: Nonehub_strategy: every_savehub_always_push: Falsehub_revision: Noneload_best_model_at_end: Falseignore_data_skip: Falserestore_callback_states_from_checkpoint: Falsefull_determinism: Falseseed: 42data_seed: Noneuse_cpu: Falseaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedataloader_drop_last: Falsedataloader_num_workers: 0dataloader_pin_memory: Truedataloader_persistent_workers: Falsedataloader_prefetch_factor: Noneremove_unused_columns: Truelabel_names: Nonetrain_sampling_strategy: randomlength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falseddp_static_graph: Noneddp_backend: Noneddp_timeout: 1800fsdp: Nonefsdp_config: Nonedeepspeed: Nonedebug: []skip_memory_metrics: Truedo_predict: Falseresume_from_checkpoint: Nonewarmup_ratio: Nonelocal_rank: -1prompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}
Training Logs
| Epoch | Step | Training Loss |
|---|---|---|
| 0.0009 | 1 | 61.4605 |
| 0.9346 | 1000 | 45.8318 |
| 0.0009 | 1 | 60.6387 |
| 0.9346 | 1000 | 45.0978 |
| 1.8692 | 2000 | 44.8278 |
| 2.8037 | 3000 | 43.0278 |
| 3.7383 | 4000 | 41.6984 |
| 0.0009 | 1 | 55.3998 |
| 4.6729 | 5000 | 40.7913 |
| 5.6075 | 6000 | 40.1543 |
| 6.5421 | 7000 | 38.1761 |
| 7.4766 | 8000 | 38.8003 |
| 8.4112 | 9000 | 38.2068 |
| 9.3458 | 10000 | 37.4088 |
| 10.2804 | 11000 | 36.5805 |
| 11.2150 | 12000 | 37.1526 |
| 12.1495 | 13000 | 36.0028 |
| 13.0841 | 14000 | 35.2225 |
| 14.0187 | 15000 | 36.2388 |
| 14.9533 | 16000 | 35.1998 |
| 15.8879 | 17000 | 35.2619 |
| 16.8224 | 18000 | 35.1943 |
| 17.7570 | 19000 | 36.0396 |
| 18.6916 | 20000 | 34.2574 |
| 19.6262 | 21000 | 35.1139 |
Training Time
- Training: 2.1 hours
Framework Versions
- Python: 3.13.11
- Sentence Transformers: 5.6.1
- Transformers: 5.14.1
- PyTorch: 2.13.0+cu130
- Accelerate: 1.14.0
- Datasets: 5.0.0
- Tokenizers: 0.22.2
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",
}
MatryoshkaLoss
@misc{kusupati2024matryoshka,
title={Matryoshka Representation Learning},
author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
year={2024},
eprint={2205.13147},
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},
}