Qwen/Qwen3-Embedding-0.6B
This is a sentence-transformers model finetuned from Qwen/Qwen3-Embedding-0.6B. 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: Qwen/Qwen3-Embedding-0.6B
- Maximum Sequence Length: 192 tokens
- Output Dimensionality: 1024 dimensions
- Similarity Function: Cosine Similarity
- Language: multilingual
- License: apache-2.0
Model Sources
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 192, 'do_lower_case': False, 'architecture': 'Qwen3Model'})
(1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': False, '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': True, '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
model = SentenceTransformer("sentence_transformers_model_id")
queries = [
"\u0645\u0627 \u0647\u064a \u0627\u0644\u0623\u0645\u0627\u0643\u0646 \u0627\u0644\u0623\u062e\u0631\u0649 \u0627\u0644\u0645\u0647\u0645\u0629 \u062f\u0627\u062e\u0644 \u062d\u062f\u0648\u062f \u0627\u0644\u062d\u0631\u0645 \u0627\u0644\u0645\u0643\u064a \u0627\u0644\u0634\u0631\u064a\u0641\u061f",
]
documents = [
'نظيفا»() وذكر القاضي في حديث ابن عباس في «غسل النبي قال فجففوه بثوب»(). \\n\\nوللتفصيل ينظر (ر: تكفين). \\n\\nالتنعيم \\n\\nالتعريف: \\n\\n1 - التنعيم موضع في الحل في شمال مكة الغربي، وهو حد الحرم من جهة المدينة المنورة. \\n\\nقال الفاسي: المسافة بين باب العمرة وبين أعلام الحرم في هذه الجهة التي في الأرض لا التي على الجبل اثنا عشر ألف ذراع وأربعمائة ذراع وعشرون ذراعا بذراع اليد(). \\n\\nوإنما سمي التنعيم بهذا الاسم لأن الجبل الذي عن يمين الداخل يقال له ناعم والذي عن اليسار يقال له منعم أو نعيم والوادي نعمان(). \\n\\nالأحكام المتعلقة بالتنعيم: \\n\\n2 - أجمع الفقهاء على أن المعتمر المكي لا بد له من',
'الملك. \\n\\nونقل القاضي زكريا عن النووي في الروضة قوله: المختار أن كون الإبراء تمليكا أو إسقاطا من المسائل التي لا يطلق فيها ترجيح، بل يختلف الراجح بحسب المسائل، لقوة الدليل وضعفه؛ لأن الإبراء إنما يكون تمليكا باعتبار أن الدين مال، وهو إنما يكون مالا في حق من له الدين، فإن أحكام المالية إنما تظهر في حقه. \\n\\nومما غلب فيه معنى التمليك عند المالكية ترجيحهم اشتراط القبول في الإبراء، كما سيأتي(). \\n\\nعلى أن هناك ما يصلح بالاعتبارين (الإسقاط والتمليك بالتساوي). ومنه ما نص عليه الحنفية أنه لو أبرأ الوارث مدين مورثه غير عالم بموته، ثم بان ميتا، فبالنظر إلى أنه إسقاط يصح، وكذا بالنظر',
'كفارا، ولم ينكر النبي ذلك عليه(). \\n\\nأخذ الأجرة على التعاويذ والرقى: \\n\\n28 - ذهب جمهور الفقهاء إلى جواز أخذ الأجرة على التعاويذ والرقى، وإليه ذهب عطاء، وأبو قلابة، وأبو ثور، وإسحاق، واستدلوا بحديث أبي سعيد الخدري الذي سبق ذكره (ف - 14) واستدل الطحاوي للجواز وقال: يجوز أخذ الأجر على الرقى، لأنه ليس على الناس أن يرقي بعضهم بعضا؛ لأن في ذلك تبليغا عن الله تعالى. وكره الزهري أخذ الأجرة على القرآن مطلقا، سواء أكان للتعليم أو للرقية(). \\n\\n\\n\\nتعويض \\n\\nالتعريف: \\n\\n1 - أصل التعويض لغة: العوض، وهو البدل تقول: عوضته تعويضا إذا أعطيته بدل ما ذهب منه. وتعوض منه واعتاض: أخذ العوض()',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
Evaluation
Metrics
Information Retrieval
| Metric |
Value |
| cosine_accuracy@1 |
0.3421 |
| cosine_accuracy@3 |
0.4979 |
| cosine_accuracy@5 |
0.562 |
| cosine_accuracy@10 |
0.6452 |
| cosine_precision@1 |
0.3421 |
| cosine_precision@3 |
0.166 |
| cosine_precision@5 |
0.1124 |
| cosine_precision@10 |
0.0645 |
| cosine_recall@1 |
0.3421 |
| cosine_recall@3 |
0.4979 |
| cosine_recall@5 |
0.562 |
| cosine_recall@10 |
0.6452 |
| cosine_ndcg@10 |
0.4867 |
| cosine_mrr@10 |
0.4367 |
| cosine_map@100 |
0.4445 |
Information Retrieval
| Metric |
Value |
| cosine_accuracy@1 |
0.2872 |
| cosine_accuracy@3 |
0.4339 |
| cosine_accuracy@5 |
0.5003 |
| cosine_accuracy@10 |
0.5771 |
| cosine_precision@1 |
0.2872 |
| cosine_precision@3 |
0.1446 |
| cosine_precision@5 |
0.1001 |
| cosine_precision@10 |
0.0577 |
| cosine_recall@1 |
0.2872 |
| cosine_recall@3 |
0.4339 |
| cosine_recall@5 |
0.5003 |
| cosine_recall@10 |
0.5771 |
| cosine_ndcg@10 |
0.4253 |
| cosine_mrr@10 |
0.3774 |
| cosine_map@100 |
0.3862 |
Training Details
Training Dataset
Unnamed Dataset
- Size: 73,994 training samples
- Columns:
anchor and positive
- Approximate statistics based on the first 1000 samples:
|
anchor |
positive |
| type |
string |
string |
| details |
- min: 3 tokens
- mean: 24.27 tokens
- max: 52 tokens
|
- min: 192 tokens
- mean: 192.0 tokens
- max: 192 tokens
|
- Samples:
| anchor |
positive |
What specific practices did this group of followers engage in according to the given text? |
هذا الصنف من المتبعين قد كثر في العصور الأخيرة، فهم يعكفون على عبارات الكتب، لا يتجهون إلا إلى الالتقاط منها، من غير قصد لتعرف دليل ما \n\nيلتقطون، ويبنون عليه، بل يكتمون بأن يقولوا: هناك قول بهذا، وإن لم يكن له دليل قوي(). \n\nولقد كان لهذا الفريق أثران مختلفان: أحدهما خير، وهو ما يتعلق بالقضاء، فإنه إذا كان القضاء لا يصح إلا بالراجح من المذهب، فإن هؤلاء عملهم الاتباع لهذا الراجح، وفي ذلك ضبط للقضاء من غير أن يكون الأمر فرطا. وتقييد القضاء في الأزمان التي تنحرف فيها الأفكار واجب، بل إن الاتباع لا يكون حسنا إلا في الأحكام القضائية. \n\nالأثر الثاني: أن هذا فيه تقديس لأقوال |
How does this group's approach to understanding religious texts impact legal rulings, particularly in matters related to judicial decisions? |
هذا الصنف من المتبعين قد كثر في العصور الأخيرة، فهم يعكفون على عبارات الكتب، لا يتجهون إلا إلى الالتقاط منها، من غير قصد لتعرف دليل ما \n\nيلتقطون، ويبنون عليه، بل يكتمون بأن يقولوا: هناك قول بهذا، وإن لم يكن له دليل قوي(). \n\nولقد كان لهذا الفريق أثران مختلفان: أحدهما خير، وهو ما يتعلق بالقضاء، فإنه إذا كان القضاء لا يصح إلا بالراجح من المذهب، فإن هؤلاء عملهم الاتباع لهذا الراجح، وفي ذلك ضبط للقضاء من غير أن يكون الأمر فرطا. وتقييد القضاء في الأزمان التي تنحرف فيها الأفكار واجب، بل إن الاتباع لا يكون حسنا إلا في الأحكام القضائية. \n\nالأثر الثاني: أن هذا فيه تقديس لأقوال |
Can you explain the two contrasting effects mentioned for this group's methodology? |
هذا الصنف من المتبعين قد كثر في العصور الأخيرة، فهم يعكفون على عبارات الكتب، لا يتجهون إلا إلى الالتقاط منها، من غير قصد لتعرف دليل ما \n\nيلتقطون، ويبنون عليه، بل يكتمون بأن يقولوا: هناك قول بهذا، وإن لم يكن له دليل قوي(). \n\nولقد كان لهذا الفريق أثران مختلفان: أحدهما خير، وهو ما يتعلق بالقضاء، فإنه إذا كان القضاء لا يصح إلا بالراجح من المذهب، فإن هؤلاء عملهم الاتباع لهذا الراجح، وفي ذلك ضبط للقضاء من غير أن يكون الأمر فرطا. وتقييد القضاء في الأزمان التي تنحرف فيها الأفكار واجب، بل إن الاتباع لا يكون حسنا إلا في الأحكام القضائية. \n\nالأثر الثاني: أن هذا فيه تقديس لأقوال |
- Loss:
MatryoshkaLoss with these parameters:{
"loss": "MultipleNegativesRankingLoss",
"matryoshka_dims": [
1024,
256
],
"matryoshka_weights": [
1,
1
],
"n_dims_per_step": -1
}
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: steps
per_device_train_batch_size: 128
per_device_eval_batch_size: 64
gradient_accumulation_steps: 2
learning_rate: 2e-05
num_train_epochs: 2
lr_scheduler_type: cosine
warmup_ratio: 0.1
bf16: True
tf32: True
load_best_model_at_end: True
gradient_checkpointing: True
batch_sampler: no_duplicates
All Hyperparameters
Click to expand
overwrite_output_dir: False
do_predict: False
eval_strategy: steps
prediction_loss_only: True
per_device_train_batch_size: 128
per_device_eval_batch_size: 64
per_gpu_train_batch_size: None
per_gpu_eval_batch_size: None
gradient_accumulation_steps: 2
eval_accumulation_steps: None
torch_empty_cache_steps: None
learning_rate: 2e-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: 2
max_steps: -1
lr_scheduler_type: cosine
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
bf16: True
fp16: False
fp16_opt_level: O1
half_precision_backend: auto
bf16_full_eval: False
fp16_full_eval: False
tf32: True
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: True
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: True
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
| Epoch |
Step |
Training Loss |
dim_1024_cosine_ndcg@10 |
dim_256_cosine_ndcg@10 |
| -1 |
-1 |
- |
0.3765 |
0.3060 |
| 0.0345 |
10 |
3.2088 |
- |
- |
| 0.0691 |
20 |
2.879 |
- |
- |
| 0.1036 |
30 |
2.4085 |
- |
- |
| 0.1382 |
40 |
2.0405 |
- |
- |
| 0.1727 |
50 |
1.8785 |
0.4311 |
0.3651 |
| 0.2073 |
60 |
1.7366 |
- |
- |
| 0.2418 |
70 |
1.6183 |
- |
- |
| 0.2763 |
80 |
1.5751 |
- |
- |
| 0.3109 |
90 |
1.3818 |
- |
- |
| 0.3454 |
100 |
1.4648 |
0.4636 |
0.3970 |
| 0.3800 |
110 |
1.4749 |
- |
- |
| 0.4145 |
120 |
1.4677 |
- |
- |
| 0.4491 |
130 |
1.3521 |
- |
- |
| 0.4836 |
140 |
1.302 |
- |
- |
| 0.5181 |
150 |
1.3315 |
0.4675 |
0.4084 |
| 0.5527 |
160 |
1.3341 |
- |
- |
| 0.5872 |
170 |
1.3045 |
- |
- |
| 0.6218 |
180 |
1.3123 |
- |
- |
| 0.6563 |
190 |
1.2239 |
- |
- |
| 0.6908 |
200 |
1.2158 |
0.4755 |
0.4160 |
| 0.7254 |
210 |
1.286 |
- |
- |
| 0.7599 |
220 |
1.207 |
- |
- |
| 0.7945 |
230 |
1.1968 |
- |
- |
| 0.8290 |
240 |
1.2546 |
- |
- |
| 0.8636 |
250 |
1.1038 |
0.4827 |
0.4226 |
| 0.8981 |
260 |
1.1658 |
- |
- |
| 0.9326 |
270 |
1.1338 |
- |
- |
| 0.9672 |
280 |
1.0918 |
- |
- |
| 1.0 |
290 |
1.0354 |
- |
- |
| 1.0345 |
300 |
0.9816 |
0.4879 |
0.427 |
| 1.0691 |
310 |
0.9749 |
- |
- |
| 1.1036 |
320 |
0.9743 |
- |
- |
| 1.1382 |
330 |
0.905 |
- |
- |
| 1.1727 |
340 |
0.9706 |
- |
- |
| 1.2073 |
350 |
0.9017 |
0.4866 |
0.4252 |
| 1.2418 |
360 |
0.9318 |
- |
- |
| 1.2763 |
370 |
0.9577 |
- |
- |
| 1.3109 |
380 |
0.9529 |
- |
- |
| 1.3454 |
390 |
0.9866 |
- |
- |
| 1.3800 |
400 |
0.9696 |
0.4863 |
0.4243 |
| 1.4145 |
410 |
0.9322 |
- |
- |
| 1.4491 |
420 |
0.9313 |
- |
- |
| 1.4836 |
430 |
0.9352 |
- |
- |
| 1.5181 |
440 |
0.9885 |
- |
- |
| 1.5527 |
450 |
0.873 |
0.4864 |
0.4254 |
| 1.5872 |
460 |
0.9204 |
- |
- |
| 1.6218 |
470 |
0.9117 |
- |
- |
| 1.6563 |
480 |
0.8663 |
- |
- |
| 1.6908 |
490 |
0.9397 |
- |
- |
| 1.7254 |
500 |
0.8624 |
0.4873 |
0.4259 |
| 1.7599 |
510 |
0.91 |
- |
- |
| 1.7945 |
520 |
0.9202 |
- |
- |
| 1.8290 |
530 |
0.9903 |
- |
- |
| 1.8636 |
540 |
0.8564 |
- |
- |
| 1.8981 |
550 |
0.9594 |
0.4867 |
0.4253 |
| 1.9326 |
560 |
0.9858 |
- |
- |
| 1.9672 |
570 |
0.9477 |
- |
- |
| 2.0 |
580 |
0.9216 |
- |
- |
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.12.0
- Sentence Transformers: 5.1.2
- Transformers: 4.57.1
- PyTorch: 2.8.0+cu128
- Accelerate: 1.11.0
- Datasets: 4.4.1
- Tokenizers: 0.22.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",
}
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{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}
}