SentenceTransformer

This is a sentence-transformers model trained. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for retrieval.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Maximum Sequence Length: 128 tokens
  • Output Dimensionality: 768 dimensions
  • Similarity Function: Cosine Similarity
  • Supported Modality: Text

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'ModernBertModel'})
  (1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'mean', '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

# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
    'client service specialist.',
    'Great work environment and the company overall really care about their employees. Good work life balance.',
    'service desk agent.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.2197, 0.4225],
#         [0.2197, 1.0000, 0.1708],
#         [0.4225, 0.1708, 1.0000]])

Training Details

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 128
  • warmup_steps: 0.1
  • weight_decay: 0.01
  • bf16: True
  • per_device_eval_batch_size: 256
  • load_best_model_at_end: True
  • batch_sampler: no_duplicates

All Hyperparameters

Click to expand
  • per_device_train_batch_size: 128
  • num_train_epochs: 3
  • max_steps: -1
  • learning_rate: 5e-05
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: None
  • warmup_steps: 0.1
  • optim: adamw_torch_fused
  • optim_args: None
  • weight_decay: 0.01
  • 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: 256
  • 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: True
  • 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
  • dataloader_multiprocessing_context: None
  • dataloader_in_order: True
  • 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
  • local_rank: -1
  • prompts: None
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}
  • warmup_ratio: None

Training Logs

Click to expand
Epoch Step Training Loss Validation Loss
0.0209 500 3.6895 -
0.0419 1000 2.3065 -
0.0628 1500 1.8563 -
0.0837 2000 1.6056 -
0.1047 2500 1.4109 -
0.1256 3000 1.2946 -
0.1465 3500 1.2113 -
0.1674 4000 1.1580 -
0.1884 4500 1.0953 -
0.2093 5000 1.0467 -
0.2302 5500 1.0212 -
0.2512 6000 0.9830 -
0.2721 6500 0.9593 -
0.2930 7000 0.9313 -
0.3140 7500 0.9142 -
0.3349 8000 0.8902 -
0.3558 8500 0.8603 -
0.3767 9000 0.8384 -
0.3977 9500 0.8204 -
0.4186 10000 0.8079 1.0798
0.4395 10500 0.7997 -
0.4605 11000 0.7773 -
0.4814 11500 0.7731 -
0.5023 12000 0.7582 -
0.5233 12500 0.7416 -
0.5442 13000 0.7435 -
0.5651 13500 0.7376 -
0.5860 14000 0.7251 -
0.6070 14500 0.7280 -
0.6279 15000 0.7155 -
0.6488 15500 0.7068 -
0.6698 16000 0.7080 -
0.6907 16500 0.7056 -
0.7116 17000 0.6951 -
0.7326 17500 0.6890 -
0.7535 18000 0.6936 -
0.7744 18500 0.6822 -
0.7953 19000 0.6753 -
0.8163 19500 0.6756 -
0.8372 20000 0.6706 0.9167
0.8581 20500 0.6631 -
0.8791 21000 0.6582 -
0.9000 21500 0.6601 -
0.9209 22000 0.6536 -
0.9419 22500 0.6626 -
0.9628 23000 0.6451 -
0.9837 23500 0.6555 -
1.0046 24000 0.6280 -
1.0256 24500 0.6008 -
1.0465 25000 0.5898 -
1.0674 25500 0.5943 -
1.0884 26000 0.5936 -
1.1093 26500 0.5898 -
1.1302 27000 0.5887 -
1.1512 27500 0.5859 -
1.1721 28000 0.5944 -
1.1930 28500 0.5864 -
1.2139 29000 0.5835 -
1.2349 29500 0.5867 -
1.2558 30000 0.5927 0.8757
1.2767 30500 0.5942 -
1.2977 31000 0.5787 -
1.3186 31500 0.5840 -
1.3395 32000 0.5743 -
1.3605 32500 0.5757 -
1.3814 33000 0.5678 -
1.4023 33500 0.5650 -
1.4232 34000 0.5676 -
1.4442 34500 0.5642 -
1.4651 35000 0.5533 -
1.4860 35500 0.5589 -
1.5070 36000 0.5547 -
1.5279 36500 0.5506 -
1.5488 37000 0.5542 -
1.5698 37500 0.5491 -
1.5907 38000 0.5472 -
1.6116 38500 0.5507 -
1.6326 39000 0.5444 -
1.6535 39500 0.5452 -
1.6744 40000 0.5434 0.7943
1.6953 40500 0.5374 -
1.7163 41000 0.5392 -
1.7372 41500 0.5329 -
1.7581 42000 0.5415 -
1.7791 42500 0.5339 -
1.8000 43000 0.5248 -
1.8209 43500 0.5391 -
1.8419 44000 0.5316 -
1.8628 44500 0.5304 -
1.8837 45000 0.5314 -
1.9046 45500 0.5293 -
1.9256 46000 0.5274 -
1.9465 46500 0.5293 -
1.9674 47000 0.5216 -
1.9884 47500 0.5146 -
2.0093 48000 0.5007 -
2.0302 48500 0.4781 -
2.0512 49000 0.4818 -
2.0721 49500 0.4735 -
2.0930 50000 0.4658 0.7542
2.1139 50500 0.4645 -
2.1349 51000 0.4724 -
2.1558 51500 0.4655 -
2.1767 52000 0.4682 -
2.1977 52500 0.4721 -
2.2186 53000 0.4600 -
2.2395 53500 0.4614 -
2.2605 54000 0.4708 -
2.2814 54500 0.4596 -
2.3023 55000 0.4542 -
2.3232 55500 0.4581 -
2.3442 56000 0.4616 -
2.3651 56500 0.4567 -
2.3860 57000 0.4572 -
2.4070 57500 0.4618 -
2.4279 58000 0.4557 -
2.4488 58500 0.4528 -
2.4698 59000 0.4459 -
2.4907 59500 0.4531 -
2.5116 60000 0.4445 0.7255
2.5325 60500 0.4523 -
2.5535 61000 0.4514 -
2.5744 61500 0.4512 -
2.5953 62000 0.4576 -
2.6163 62500 0.4500 -
2.6372 63000 0.4509 -
2.6581 63500 0.4408 -
2.6791 64000 0.4432 -
2.7000 64500 0.4413 -
2.7209 65000 0.4410 -
2.7418 65500 0.4352 -
2.7628 66000 0.4379 -
2.7837 66500 0.4459 -
2.8046 67000 0.4419 -
2.8256 67500 0.4411 -
2.8465 68000 0.4433 -
2.8674 68500 0.4360 -
2.8884 69000 0.4391 -
2.9093 69500 0.4399 -
2.9302 70000 0.4306 0.7062
2.9511 70500 0.4370 -
2.9721 71000 0.4339 -
2.9930 71500 0.4361 -
3.0 71667 - 0.7051
  • The bold row denotes the saved checkpoint.

Training Time

  • Training: 17.4 hours

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 5.6.0
  • Transformers: 5.16.1
  • PyTorch: 2.13.0+cu130
  • Accelerate: 1.14.0
  • Datasets: 5.0.0
  • Tokenizers: 0.23.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",
}

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},
}
Downloads last month
29
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Papers for sjmeis/skills-embedding-base-v1