PurpleStatic / README.md
hanzceo's picture
Update README.md
203f742 verified
|
Raw
History Blame Contribute Delete
29.5 kB
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

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: anchor and positive
  • 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: MatryoshkaLoss with 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: anchor and positive
  • 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: MatryoshkaLoss with 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: anchor and positive
  • 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 pakistan identify the present finance minister of pakistan
    name current finance minister of pakistan who is pakistan's finance minister right now
    name current finance minister of pakistan state the name of the current pakistani minister of finance
  • Loss: MatryoshkaLoss with 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: anchor and positives
  • 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 segment submarket
  • Loss: MatryoshkaLoss with 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, and negatives_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: MatryoshkaLoss with 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: 4096
  • num_train_epochs: 20
  • learning_rate: 0.0001
  • warmup_steps: 0.1
  • bf16: True
  • batch_sampler: no_duplicates

All Hyperparameters

Click to expand
  • per_device_train_batch_size: 4096
  • num_train_epochs: 20
  • max_steps: -1
  • learning_rate: 0.0001
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: None
  • warmup_steps: 0.1
  • optim: adamw_torch_fused
  • optim_args: None
  • weight_decay: 0.0
  • 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: None
  • 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: 8
  • 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: False
  • hub_private_repo: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_always_push: False
  • hub_revision: None
  • load_best_model_at_end: False
  • 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: False
  • dataloader_num_workers: 0
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • dataloader_prefetch_factor: None
  • remove_unused_columns: True
  • label_names: None
  • train_sampling_strategy: random
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • 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
  • warmup_ratio: None
  • local_rank: -1
  • prompts: None
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional
  • router_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},
}