multilingual-e5-large base Matryoshka
This is a sentence-transformers model finetuned from Qwen/Qwen3-Embedding-4B on the json dataset. It maps sentences & paragraphs to a 2560-dimensional dense vector space and can be used for retrieval.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: Qwen/Qwen3-Embedding-4B
- Maximum Sequence Length: 40960 tokens
- Output Dimensionality: 2560 dimensions
- Similarity Function: Cosine Similarity
- Supported Modality: Text
- Training Dataset:
- json
- Language: en
- License: apache-2.0
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
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': 'Qwen3Model'})
(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("IoannisKat1/Qwen3-Embedding-4b-matryoshka")
# Run inference
queries = [
'Ποιες είναι οι δύο τύποι τροφοδοσίας που αναφέρονται;',
]
documents = [
'. Ελεγκτές μεταβλητών στροφών και σχεδίαση σειριακού ελεγκτή με εσωτερικό βρόχο ρεύματος: ΑΜ διπλής τροφοδοσίας, ΑΜ ή ΣΜ με διασύνδεση συνεχούς ρεύματος, Γεννήτρια ΑΜ με ηλεκτρονικά μεταβαλλόμενη αντίσταση ρότορα. Έλεγχος πραγματικής και άεργου ισχύος. Έλεγχος βήματος πτερυγίου. Περιβαλλοντικές επιπτώσεις από την εγκατάσταση αιολικών συστημάτων και λοιπών ΑΠΕ. Σύνδεση με το δίκτυο',
'. Τα υποχρεωτικά είναι συγκεκριμένα βασικά μαθήματα της επιστήμης του Ηλεκτρολόγου Μηχανικού και Μηχανικού Υπολογιστών, τα οποία πρέπει να παρακολουθήσει και εξεταστεί επιτυχώς κάθε φοιτητής. Τα κατ’ επιλογήν υποχρεωτικά είναι μαθήματα εμβάθυνσης σε διάφορους ειδικούς τομείς',
'Η σελίδα παρουσιάζει τους Τομείς του Τμήματος Ηλεκτρολόγων Μηχανικών και Τεχνολογίας Υπολογιστών: Τηλεπικοινωνιών και Τεχνολογίας Πληροφορίας (Τ&ΤΠ), Συστημάτων Ηλεκτρικής Ενέργειας (ΣΗΕ), Ηλεκτρονικής και Υπολογιστών (Η&Υ) και Συστήματα και Αυτόματου Ελέγχου (Σ&ΑΕ)',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 2560] [3, 2560]
# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[0.3725, 0.0346, 0.0624]])
Evaluation
Metrics
Information Retrieval
- Dataset:
dim_2560 - Evaluated with
InformationRetrievalEvaluatorwith these parameters:{ "truncate_dim": 2560 }
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.6126 |
| cosine_accuracy@3 | 0.64 |
| cosine_accuracy@5 | 0.7432 |
| cosine_accuracy@10 | 0.8295 |
| cosine_precision@1 | 0.6126 |
| cosine_precision@3 | 0.6154 |
| cosine_precision@5 | 0.4901 |
| cosine_precision@10 | 0.2914 |
| cosine_recall@1 | 0.1753 |
| cosine_recall@3 | 0.5181 |
| cosine_recall@5 | 0.6767 |
| cosine_recall@10 | 0.807 |
| cosine_ndcg@10 | 0.7149 |
| cosine_mrr@10 | 0.6569 |
| cosine_map@100 | 0.6966 |
Information Retrieval
- Dataset:
dim_2048 - Evaluated with
InformationRetrievalEvaluatorwith these parameters:{ "truncate_dim": 2048 }
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.6147 |
| cosine_accuracy@3 | 0.6379 |
| cosine_accuracy@5 | 0.7411 |
| cosine_accuracy@10 | 0.8253 |
| cosine_precision@1 | 0.6147 |
| cosine_precision@3 | 0.6147 |
| cosine_precision@5 | 0.4884 |
| cosine_precision@10 | 0.2899 |
| cosine_recall@1 | 0.1765 |
| cosine_recall@3 | 0.517 |
| cosine_recall@5 | 0.6726 |
| cosine_recall@10 | 0.8033 |
| cosine_ndcg@10 | 0.7132 |
| cosine_mrr@10 | 0.6567 |
| cosine_map@100 | 0.6967 |
Information Retrieval
- Dataset:
dim_1536 - Evaluated with
InformationRetrievalEvaluatorwith these parameters:{ "truncate_dim": 1536 }
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.6189 |
| cosine_accuracy@3 | 0.6379 |
| cosine_accuracy@5 | 0.7537 |
| cosine_accuracy@10 | 0.8253 |
| cosine_precision@1 | 0.6189 |
| cosine_precision@3 | 0.6154 |
| cosine_precision@5 | 0.4909 |
| cosine_precision@10 | 0.2928 |
| cosine_recall@1 | 0.1777 |
| cosine_recall@3 | 0.5168 |
| cosine_recall@5 | 0.6761 |
| cosine_recall@10 | 0.8111 |
| cosine_ndcg@10 | 0.7188 |
| cosine_mrr@10 | 0.66 |
| cosine_map@100 | 0.6994 |
Information Retrieval
- Dataset:
dim_1024 - Evaluated with
InformationRetrievalEvaluatorwith these parameters:{ "truncate_dim": 1024 }
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.5979 |
| cosine_accuracy@3 | 0.6211 |
| cosine_accuracy@5 | 0.7453 |
| cosine_accuracy@10 | 0.8105 |
| cosine_precision@1 | 0.5979 |
| cosine_precision@3 | 0.6007 |
| cosine_precision@5 | 0.4825 |
| cosine_precision@10 | 0.2869 |
| cosine_recall@1 | 0.1712 |
| cosine_recall@3 | 0.5056 |
| cosine_recall@5 | 0.6674 |
| cosine_recall@10 | 0.7965 |
| cosine_ndcg@10 | 0.7033 |
| cosine_mrr@10 | 0.6431 |
| cosine_map@100 | 0.6852 |
Information Retrieval
- Dataset:
dim_768 - Evaluated with
InformationRetrievalEvaluatorwith these parameters:{ "truncate_dim": 768 }
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.6 |
| cosine_accuracy@3 | 0.6211 |
| cosine_accuracy@5 | 0.7368 |
| cosine_accuracy@10 | 0.8 |
| cosine_precision@1 | 0.6 |
| cosine_precision@3 | 0.6007 |
| cosine_precision@5 | 0.4813 |
| cosine_precision@10 | 0.2823 |
| cosine_recall@1 | 0.1719 |
| cosine_recall@3 | 0.5047 |
| cosine_recall@5 | 0.6637 |
| cosine_recall@10 | 0.7842 |
| cosine_ndcg@10 | 0.6973 |
| cosine_mrr@10 | 0.6421 |
| cosine_map@100 | 0.6828 |
Information Retrieval
- Dataset:
dim_512 - Evaluated with
InformationRetrievalEvaluatorwith these parameters:{ "truncate_dim": 512 }
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.5726 |
| cosine_accuracy@3 | 0.6 |
| cosine_accuracy@5 | 0.7011 |
| cosine_accuracy@10 | 0.7874 |
| cosine_precision@1 | 0.5726 |
| cosine_precision@3 | 0.5754 |
| cosine_precision@5 | 0.4589 |
| cosine_precision@10 | 0.2766 |
| cosine_recall@1 | 0.1654 |
| cosine_recall@3 | 0.4863 |
| cosine_recall@5 | 0.6325 |
| cosine_recall@10 | 0.7672 |
| cosine_ndcg@10 | 0.6757 |
| cosine_mrr@10 | 0.617 |
| cosine_map@100 | 0.6607 |
Information Retrieval
- Dataset:
dim_256 - Evaluated with
InformationRetrievalEvaluatorwith these parameters:{ "truncate_dim": 256 }
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.5179 |
| cosine_accuracy@3 | 0.5389 |
| cosine_accuracy@5 | 0.6442 |
| cosine_accuracy@10 | 0.7411 |
| cosine_precision@1 | 0.5179 |
| cosine_precision@3 | 0.5172 |
| cosine_precision@5 | 0.4131 |
| cosine_precision@10 | 0.2583 |
| cosine_recall@1 | 0.1519 |
| cosine_recall@3 | 0.4409 |
| cosine_recall@5 | 0.5725 |
| cosine_recall@10 | 0.7146 |
| cosine_ndcg@10 | 0.6218 |
| cosine_mrr@10 | 0.5614 |
| cosine_map@100 | 0.6085 |
Information Retrieval
- Dataset:
dim_128 - Evaluated with
InformationRetrievalEvaluatorwith these parameters:{ "truncate_dim": 128 }
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.4526 |
| cosine_accuracy@3 | 0.4674 |
| cosine_accuracy@5 | 0.5747 |
| cosine_accuracy@10 | 0.6568 |
| cosine_precision@1 | 0.4526 |
| cosine_precision@3 | 0.4477 |
| cosine_precision@5 | 0.3604 |
| cosine_precision@10 | 0.2314 |
| cosine_recall@1 | 0.133 |
| cosine_recall@3 | 0.3811 |
| cosine_recall@5 | 0.5 |
| cosine_recall@10 | 0.6393 |
| cosine_ndcg@10 | 0.5499 |
| cosine_mrr@10 | 0.4914 |
| cosine_map@100 | 0.5422 |
Information Retrieval
- Dataset:
dim_64 - Evaluated with
InformationRetrievalEvaluatorwith these parameters:{ "truncate_dim": 64 }
| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.4147 |
| cosine_accuracy@3 | 0.4379 |
| cosine_accuracy@5 | 0.5242 |
| cosine_accuracy@10 | 0.5979 |
| cosine_precision@1 | 0.4147 |
| cosine_precision@3 | 0.4112 |
| cosine_precision@5 | 0.3339 |
| cosine_precision@10 | 0.2076 |
| cosine_recall@1 | 0.1233 |
| cosine_recall@3 | 0.3519 |
| cosine_recall@5 | 0.4646 |
| cosine_recall@10 | 0.5753 |
| cosine_ndcg@10 | 0.4995 |
| cosine_mrr@10 | 0.4501 |
| cosine_map@100 | 0.496 |
Training Details
Training Dataset
json
- Dataset: json
- Size: 4,268 training samples
- Columns:
anchorandpositive - Approximate statistics based on the first 100 samples:
anchor positive type string string modality text text details - min: 23 tokens
- mean: 49.43 tokens
- max: 90 tokens
- min: 24 tokens
- mean: 270.18 tokens
- max: 388 tokens
- Samples:
anchor positive Πόσο διαρκεί το προπτυχιακό πρόγραμμα σπουδών;. Το προπτυχιακό πρόγραμμα σπουδών έχει διάρκεια δέκα διδακτικών εξαμήνων και οδηγεί στην απονομή Διπλώματος Μηχανικού, το οποίο αναγνωρίζεται ως Integrated Master με πλήρη επαγγελματικά δικαιώματαΠοιες είναι οι αλγόριθμοι τοπικής αναζήτησης Ι;. Επίλυση προβλημάτων με αναζήτηση: Χώροι καταστάσεων, δέντρα αναζήτησης, μέθοδοι αναζήτησης χωρίς πληροφόρηση (depth-first, breadth-first), αναζήτηση με μερική πληροφόρηση. 3. Πληροφορημένη αναζήτηση και εξερεύνηση: Αλγόριθμοι Best First και Α*. 4. Αλγόριθμοι τοπικής αναζήτησης Ι: Hill climbing, simulated annealing. 5. Αλγόριθμοι τοπικής αναζήτησης ΙΙ: Γενετικοί αλγόριθμοι. 6Ποιες είναι οι δύο βασικές ικανότητες που σχετίζονται με την εφαρμογή στο εργαστήριο;. • Η ανάπτυξη της κριτικής σκέψης, της ικανότητας λήψης αποφάσεων, της επιδίωξης της καινοτομίας, του εξωστρεφούς τρόπου σκέψης, του πνεύματος συνεργασίας και της ομαδικής προσπάθειας, και της ικανότητας προσαρμογής σε μεταβαλλόμενες συνθήκες. • Η πλήρης κατανόηση και η ικανότητα εφαρμογής του θεωρητικού υπόβαθρου στο εργαστήριο - Loss:
MatryoshkaLosswith these parameters:{ "loss": "MultipleNegativesRankingLoss", "matryoshka_dims": [ 2560, 2048, 1536, 1024, 768, 512, 256, 128, 64 ], "matryoshka_weights": [ 1, 1, 1, 1, 1, 1, 1, 1, 1 ], "n_dims_per_step": -1 }
Training Hyperparameters
Non-Default Hyperparameters
per_device_train_batch_size: 16num_train_epochs: 10learning_rate: 2e-05lr_scheduler_type: cosinewarmup_steps: 0.1gradient_accumulation_steps: 8bf16: Truetf32: Trueload_best_model_at_end: Truebatch_sampler: no_duplicates
All Hyperparameters
Click to expandper_device_train_batch_size: 16num_train_epochs: 10max_steps: -1learning_rate: 2e-05lr_scheduler_type: cosinelr_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: 8average_tokens_across_devices: Truemax_grad_norm: 1.0label_smoothing_factor: 0.0bf16: Truefp16: Falsebf16_full_eval: Falsefp16_full_eval: Falsetf32: Truegradient_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: Trueignore_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 | dim_2560_cosine_ndcg@10 | dim_2048_cosine_ndcg@10 | dim_1536_cosine_ndcg@10 | dim_1024_cosine_ndcg@10 | dim_768_cosine_ndcg@10 | dim_512_cosine_ndcg@10 | dim_256_cosine_ndcg@10 | dim_128_cosine_ndcg@10 | dim_64_cosine_ndcg@10 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.2996 | 10 | 6.3134 | - | - | - | - | - | - | - | - | - |
| 0.5993 | 20 | 4.1175 | - | - | - | - | - | - | - | - | - |
| 0.8989 | 30 | 2.1983 | - | - | - | - | - | - | - | - | - |
| 1.0 | 34 | - | 0.7039 | 0.6994 | 0.6957 | 0.6832 | 0.6728 | 0.6554 | 0.6049 | 0.5283 | 0.4457 |
| 1.1798 | 40 | 1.6160 | - | - | - | - | - | - | - | - | - |
| 1.4794 | 50 | 1.3932 | - | - | - | - | - | - | - | - | - |
| 1.7790 | 60 | 1.4199 | - | - | - | - | - | - | - | - | - |
| 2.0 | 68 | - | 0.7276 | 0.7343 | 0.7319 | 0.7164 | 0.7007 | 0.6860 | 0.6159 | 0.5478 | 0.4570 |
| 2.0599 | 70 | 1.0645 | - | - | - | - | - | - | - | - | - |
| 2.3596 | 80 | 0.5630 | - | - | - | - | - | - | - | - | - |
| 2.6592 | 90 | 0.5838 | - | - | - | - | - | - | - | - | - |
| 2.9588 | 100 | 0.5760 | - | - | - | - | - | - | - | - | - |
| 3.0 | 102 | - | 0.7256 | 0.7217 | 0.7279 | 0.7215 | 0.7140 | 0.6908 | 0.6362 | 0.5473 | 0.4865 |
| 3.2397 | 110 | 0.4266 | - | - | - | - | - | - | - | - | - |
| 3.5393 | 120 | 0.3893 | - | - | - | - | - | - | - | - | - |
| 3.8390 | 130 | 0.4026 | - | - | - | - | - | - | - | - | - |
| 4.0 | 136 | - | 0.7296 | 0.7205 | 0.7245 | 0.7087 | 0.6941 | 0.6801 | 0.6277 | 0.5413 | 0.4889 |
| 4.1199 | 140 | 0.3360 | - | - | - | - | - | - | - | - | - |
| 4.4195 | 150 | 0.2930 | - | - | - | - | - | - | - | - | - |
| 4.7191 | 160 | 0.2276 | - | - | - | - | - | - | - | - | - |
| 5.0 | 170 | 0.2644 | 0.7249 | 0.7207 | 0.7198 | 0.7032 | 0.6946 | 0.6751 | 0.6202 | 0.5426 | 0.4955 |
| 5.2996 | 180 | 0.1981 | - | - | - | - | - | - | - | - | - |
| 5.5993 | 190 | 0.2499 | - | - | - | - | - | - | - | - | - |
| 5.8989 | 200 | 0.2791 | - | - | - | - | - | - | - | - | - |
| 6.0 | 204 | - | 0.7144 | 0.7107 | 0.7123 | 0.7018 | 0.6857 | 0.6714 | 0.6199 | 0.5397 | 0.4901 |
| 6.1798 | 210 | 0.3000 | - | - | - | - | - | - | - | - | - |
| 6.4794 | 220 | 0.2389 | - | - | - | - | - | - | - | - | - |
| 6.7790 | 230 | 0.2229 | - | - | - | - | - | - | - | - | - |
| 7.0 | 238 | - | 0.7113 | 0.7086 | 0.7111 | 0.7037 | 0.6889 | 0.6735 | 0.6203 | 0.5513 | 0.5003 |
| 7.0599 | 240 | 0.1998 | - | - | - | - | - | - | - | - | - |
| 7.3596 | 250 | 0.1704 | - | - | - | - | - | - | - | - | - |
| 7.6592 | 260 | 0.2299 | - | - | - | - | - | - | - | - | - |
| 7.9588 | 270 | 0.1757 | - | - | - | - | - | - | - | - | - |
| 8.0 | 272 | - | 0.7165 | 0.7112 | 0.7195 | 0.7055 | 0.6955 | 0.6763 | 0.6191 | 0.5489 | 0.5028 |
| 8.2397 | 280 | 0.1971 | - | - | - | - | - | - | - | - | - |
| 8.5393 | 290 | 0.1290 | - | - | - | - | - | - | - | - | - |
| 8.8390 | 300 | 0.1408 | - | - | - | - | - | - | - | - | - |
| 9.0 | 306 | - | 0.7180 | 0.7136 | 0.7199 | 0.7048 | 0.6957 | 0.6758 | 0.6176 | 0.5506 | 0.4956 |
| 9.1199 | 310 | 0.1705 | - | - | - | - | - | - | - | - | - |
| 9.4195 | 320 | 0.1828 | - | - | - | - | - | - | - | - | - |
| 9.7191 | 330 | 0.1291 | - | - | - | - | - | - | - | - | - |
| 10.0 | 340 | 0.1445 | 0.7149 | 0.7132 | 0.7188 | 0.7033 | 0.6973 | 0.6757 | 0.6218 | 0.5499 | 0.4995 |
- The bold row denotes the saved checkpoint.
Training Time
- Training: 2.1 hours
Framework Versions
- Python: 3.12.13
- Sentence Transformers: 5.6.0
- Transformers: 5.12.1
- PyTorch: 2.11.0+cu128
- Accelerate: 1.14.0
- Datasets: 4.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},
}