SentenceTransformer

This model was finetuned with Unsloth.

based on unsloth/Qwen3-Embedding-4B

This is a sentence-transformers model finetuned from unsloth/Qwen3-Embedding-4B on the technical dataset. It maps sentences & paragraphs to a 2560-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, classification, clustering, and more.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: unsloth/Qwen3-Embedding-4B
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 2560 dimensions
  • Similarity Function: Cosine Similarity
  • Supported Modality: Text
  • Training Dataset:
  • Language: en

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', 'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'PeftModelForFeatureExtraction'})
  (1): Pooling({'embedding_dimension': 2560, 'pooling_mode': 'lasttoken', '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

# Download from the 🤗 Hub
model = SentenceTransformer("sentence_transformers_model_id")
# Run inference
sentences = [
    'adult learning',
    'The course was designed using adult learning best practices.',
    'Solar developers calculate AEP, or annual energy production.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 2560]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.6937, 0.0531],
#         [0.6937, 1.0000, 0.0692],
#         [0.0531, 0.0692, 1.0000]])

Training Details

Training Dataset

technical

  • Dataset: technical at 05eeb90
  • Size: 106,628 training samples
  • Columns: anchor and positive
  • Approximate statistics based on the first 100 samples:
    anchor positive
    type string string
    modality text text
    details
    • min: 3 tokens
    • mean: 4.58 tokens
    • max: 7 tokens
    • min: 12 tokens
    • mean: 16.08 tokens
    • max: 23 tokens
  • Samples:
    anchor positive
    .308 The .308 Winchester is a popular rifle cartridge used for hunting and target shooting.
    .308 Many precision rifles are chambered in .308 for its excellent long-range accuracy.
    .308 The sniper selected a .308 caliber round for the mission.
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false,
        "directions": [
            "query_to_doc"
        ],
        "partition_mode": "joint",
        "hardness_mode": null,
        "hardness_strength": 0.0
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 256
  • learning_rate: 3e-05
  • max_steps: 300
  • lr_scheduler_type: constant_with_warmup
  • warmup_ratio: 0.03
  • bf16: True
  • batch_sampler: no_duplicates

All Hyperparameters

Click to expand
  • overwrite_output_dir: False
  • do_predict: False
  • prediction_loss_only: True
  • per_device_train_batch_size: 256
  • 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: 3e-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: 300
  • lr_scheduler_type: constant_with_warmup
  • lr_scheduler_kwargs: None
  • warmup_ratio: 0.03
  • 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
  • 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}
  • parallelism_config: None
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch_fused
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • project: huggingface
  • trackio_space_id: trackio
  • 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
  • hub_revision: None
  • 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
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: no
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • liger_kernel_config: None
  • eval_use_gather_object: False
  • average_tokens_across_devices: True
  • prompts: None
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Click to expand
Epoch Step Training Loss
0.0024 1 1.9356
0.0048 2 2.2638
0.0072 3 2.0225
0.0096 4 2.2113
0.0120 5 2.1095
0.0144 6 2.2684
0.0168 7 2.099
0.0192 8 2.2709
0.0216 9 2.1799
0.0240 10 2.0661
0.0264 11 2.1748
0.0288 12 1.9079
0.0312 13 1.8066
0.0336 14 1.811
0.0360 15 1.7142
0.0384 16 1.5274
0.0408 17 1.4678
0.0432 18 1.3983
0.0456 19 1.1987
0.0480 20 1.425
0.0504 21 1.1967
0.0528 22 1.0813
0.0552 23 1.1156
0.0576 24 0.9311
0.0600 25 1.1323
0.0624 26 0.9392
0.0647 27 0.9496
0.0671 28 1.0705
0.0695 29 1.0274
0.0719 30 1.0138
0.0743 31 0.7935
0.0767 32 0.9786
0.0791 33 0.9157
0.0815 34 0.7338
0.0839 35 0.8625
0.0863 36 0.9144
0.0887 37 0.7674
0.0911 38 0.7878
0.0935 39 0.7664
0.0959 40 0.648
0.0983 41 0.7133
0.1007 42 0.8242
0.1031 43 0.6908
0.1055 44 0.764
0.1079 45 0.6367
0.1103 46 0.7701
0.1127 47 0.6897
0.1151 48 0.6837
0.1175 49 0.6279
0.1199 50 0.8012
0.1223 51 0.7636
0.1247 52 0.5825
0.1271 53 0.877
0.1295 54 0.5288
0.1319 55 0.6125
0.1343 56 0.631
0.1367 57 0.6344
0.1391 58 0.7878
0.1415 59 0.6648
0.1439 60 0.8663
0.1463 61 0.6946
0.1487 62 0.6053
0.1511 63 0.6937
0.1535 64 0.5446
0.1559 65 0.6462
0.1583 66 0.6901
0.1607 67 0.6959
0.1631 68 0.5044
0.1655 69 0.67
0.1679 70 0.8315
0.1703 71 0.5533
0.1727 72 0.7447
0.1751 73 0.6871
0.1775 74 0.6991
0.1799 75 0.9441
0.1823 76 0.4905
0.1847 77 0.5115
0.1871 78 0.604
0.1894 79 0.6326
0.1918 80 0.5251
0.1942 81 0.6672
0.1966 82 0.5414
0.1990 83 0.5195
0.2014 84 0.6906
0.2038 85 0.6052
0.2062 86 0.602
0.2086 87 0.5168
0.2110 88 0.7237
0.2134 89 0.6563
0.2158 90 0.5744
0.2182 91 0.638
0.2206 92 0.7049
0.2230 93 0.504
0.2254 94 0.5769
0.2278 95 0.6411
0.2302 96 0.4227
0.2326 97 0.5207
0.2350 98 0.63
0.2374 99 0.5781
0.2398 100 0.4366
0.2422 101 0.6079
0.2446 102 0.6564
0.2470 103 0.4411
0.2494 104 0.6098
0.2518 105 0.3855
0.2542 106 0.5667
0.2566 107 0.5143
0.2590 108 0.447
0.2614 109 0.6439
0.2638 110 0.4011
0.2662 111 0.5667
0.2686 112 0.5356
0.2710 113 0.474
0.2734 114 0.5583
0.2758 115 0.47
0.2782 116 0.5501
0.2806 117 0.411
0.2830 118 0.5144
0.2854 119 0.2708
0.2878 120 0.5639
0.2902 121 0.4637
0.2926 122 0.5009
0.2950 123 0.4313
0.2974 124 0.5494
0.2998 125 0.6557
0.3022 126 0.5336
0.3046 127 0.3674
0.3070 128 0.4566
0.3094 129 0.5863
0.3118 130 0.4347
0.3141 131 0.566
0.3165 132 0.5051
0.3189 133 0.394
0.3213 134 0.4707
0.3237 135 0.4485
0.3261 136 0.6121
0.3285 137 0.539
0.3309 138 0.4903
0.3333 139 0.5342
0.3357 140 0.5453
0.3381 141 0.4407
0.3405 142 0.4799
0.3429 143 0.4706
0.3453 144 0.4702
0.3477 145 0.5704
0.3501 146 0.3264
0.3525 147 0.5735
0.3549 148 0.4548
0.3573 149 0.5788
0.3597 150 0.5322
0.3621 151 0.5159
0.3645 152 0.5028
0.3669 153 0.6109
0.3693 154 0.4546
0.3717 155 0.4589
0.3741 156 0.5333
0.3765 157 0.6362
0.3789 158 0.5857
0.3813 159 0.5252
0.3837 160 0.3299
0.3861 161 0.3672
0.3885 162 0.5292
0.3909 163 0.5153
0.3933 164 0.5064
0.3957 165 0.4117
0.3981 166 0.4178
0.4005 167 0.456
0.4029 168 0.4565
0.4053 169 0.525
0.4077 170 0.5066
0.4101 171 0.4532
0.4125 172 0.4321
0.4149 173 0.4451
0.4173 174 0.4256
0.4197 175 0.4965
0.4221 176 0.4022
0.4245 177 0.3614
0.4269 178 0.5388
0.4293 179 0.4855
0.4317 180 0.4277
0.4341 181 0.4711
0.4365 182 0.5819
0.4388 183 0.3921
0.4412 184 0.5782
0.4436 185 0.5254
0.4460 186 0.4376
0.4484 187 0.5278
0.4508 188 0.5399
0.4532 189 0.4326
0.4556 190 0.2888
0.4580 191 0.5251
0.4604 192 0.4748
0.4628 193 0.4202
0.4652 194 0.6006
0.4676 195 0.4758
0.4700 196 0.5041
0.4724 197 0.5009
0.4748 198 0.5549
0.4772 199 0.4023
0.4796 200 0.4686
0.4820 201 0.426
0.4844 202 0.3458
0.4868 203 0.4515
0.4892 204 0.5244
0.4916 205 0.4502
0.4940 206 0.4723
0.4964 207 0.4075
0.4988 208 0.4178
0.5012 209 0.4591
0.5036 210 0.3349
0.5060 211 0.5255
0.5084 212 0.4475
0.5108 213 0.4225
0.5132 214 0.4111
0.5156 215 0.4242
0.5180 216 0.4974
0.5204 217 0.4926
0.5228 218 0.4217
0.5252 219 0.4579
0.5276 220 0.5591
0.5300 221 0.5679
0.5324 222 0.5118
0.5348 223 0.4182
0.5372 224 0.3443
0.5396 225 0.4294
0.5420 226 0.4199
0.5444 227 0.5637
0.5468 228 0.3991
0.5492 229 0.4185
0.5516 230 0.4792
0.5540 231 0.3947
0.5564 232 0.4141
0.5588 233 0.5873
0.5612 234 0.311
0.5635 235 0.3762
0.5659 236 0.2938
0.5683 237 0.4671
0.5707 238 0.3186
0.5731 239 0.5186
0.5755 240 0.5359
0.5779 241 0.4796
0.5803 242 0.3922
0.5827 243 0.2182
0.5851 244 0.3576
0.5875 245 0.4597
0.5899 246 0.5807
0.5923 247 0.4149
0.5947 248 0.4119
0.5971 249 0.3892
0.5995 250 0.4527
0.6019 251 0.3477
0.6043 252 0.4343
0.6067 253 0.5379
0.6091 254 0.4285
0.6115 255 0.5437
0.6139 256 0.4197
0.6163 257 0.5732
0.6187 258 0.4399
0.6211 259 0.4252
0.6235 260 0.3433
0.6259 261 0.4018
0.6283 262 0.4364
0.6307 263 0.3921
0.6331 264 0.3905
0.6355 265 0.4955
0.6379 266 0.3608
0.6403 267 0.455
0.6427 268 0.528
0.6451 269 0.305
0.6475 270 0.4868
0.6499 271 0.483
0.6523 272 0.3086
0.6547 273 0.4097
0.6571 274 0.4003
0.6595 275 0.4059
0.6619 276 0.4003
0.6643 277 0.3686
0.6667 278 0.4048
0.6691 279 0.5653
0.6715 280 0.4593
0.6739 281 0.3424
0.6763 282 0.4893
0.6787 283 0.483
0.6811 284 0.4266
0.6835 285 0.4066
0.6859 286 0.437
0.6882 287 0.3615
0.6906 288 0.406
0.6930 289 0.4281
0.6954 290 0.4613
0.6978 291 0.3132
0.7002 292 0.3874
0.7026 293 0.4827
0.7050 294 0.445
0.7074 295 0.4509
0.7098 296 0.4577
0.7122 297 0.3843
0.7146 298 0.3758
0.7170 299 0.4043
0.7194 300 0.4074

Training Time

  • Training: 9.0 minutes

Framework Versions

  • Python: 3.13.15
  • Sentence Transformers: 5.7.0
  • Transformers: 4.57.6
  • PyTorch: 2.11.0+cu130
  • Accelerate: 1.15.0
  • Datasets: 4.3.0
  • Tokenizers: 0.22.2

Additional Resources

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
11
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for aliRafik/Qwen3_Embedding_4B_finetuned_16bit

Finetuned
(9)
this model

Dataset used to train aliRafik/Qwen3_Embedding_4B_finetuned_16bit

Papers for aliRafik/Qwen3_Embedding_4B_finetuned_16bit