Qwen/Qwen3-Embedding-4B-Matryoshka

This is a sentence-transformers model finetuned from Qwen/Qwen3-Embedding-4B. It maps sentences & paragraphs to a 2560-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-4B
  • Maximum Sequence Length: 40960 tokens
  • Output Dimensionality: 2560 dimensions
  • Similarity Function: Cosine Similarity
  • Language: en
  • License: apache-2.0

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 40960, 'do_lower_case': False, 'architecture': 'Qwen3Model'})
  (1): Pooling({'word_embedding_dimension': 2560, '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

# Download from the 🤗 Hub
model = SentenceTransformer("mrhimanshu/viaviembedteravm")
# Run inference
queries = [
    "What does the Auxiliary Positions Bitmask represent?",
]
documents = [
    '0x2.</td</tr <tr<td id="86-O"Receive Positions Bitmask</td<td id="86-P"Bitmask indicating the receive positions for video streams.</td<td id="86-Q"Mandatory bitmask between 0x0 - 0xFFFF.d</tr <tr<td id="86-O"Receive Positions Bitmask</td<td id="86-P"Bitmask indicating the receive positions for video streams.</td<td id="86-Q"Mandatory bitmask between 0x0 - 0xFFFF.Default is 0x2.</td</tr <tr<td id="86-R"Auxiliary Positions Bitmask</td<td id="86-S"Bitmask indicating the auxiliary positions for video streams.</td<td id="86-T"Optional bitmask between 0x0 - 0xFFFF.',
    'It indicates which user interface panels should be active when a video stream is paused. For content editing workflows, the auxiliary mask controls GUI layout, enabling or disabling panels like timeline scrubbers, annotation tools, or metadata inspectors. By setting or clearing bits, the system infers which supplemental UI components are relevant for a given paused stream, rather than specifying any spatial or positional information for video content itself.',
    's list consists of a Default TLS Settings along with any other user shared TLS/SSL Settings. THREATS: Potential risks or security vulnerabilities that could compromise the system.\n\n\n## 2.9. Checking Out a Test The test can be checked out from Workspace or Library.\n\n\nTeraVM HTML5 User Guide\n\n\nPage 18\n\n\n2.9. Checking Out a Test\n\n\nThe Workspace is where you can configure tests that have been checked out from the Library and save them back into the Library to be shared.',
]
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.6665, 0.0776, 0.1395]])

Evaluation

Metrics

Triplet

Metric Value
cosine_accuracy 0.6169

Training Details

Training Dataset

Unnamed Dataset

  • Size: 31,914 training samples
  • Columns: anchor, positive, and negative
  • Approximate statistics based on the first 1000 samples:
    anchor positive negative
    type string string string
    details
    • min: 8 tokens
    • mean: 18.65 tokens
    • max: 49 tokens
    • min: 51 tokens
    • mean: 421.83 tokens
    • max: 1433 tokens
    • min: 24 tokens
    • mean: 91.21 tokens
    • max: 206 tokens
  • Samples:
    anchor positive negative
    What Advanced Settings option must be enabled for HTML5 UI tests in TeraVM on GCP? Compute Engine VM instances to see the list of TeraVM Instances you created. Click on the Test Module VM name to open the details and look for the Network interfaces section. Make a note of the Primary internal IP address and Alias IP ranges values displayed in the tvm-nut row.Setup Guide: TeraVM on Google Cloud Platform


    Page 67


    8.4. Running a Test


    Figure 8-10. Test Module VM - NUT IP Address


    Network interfaces

    Note If the testbed was deployed from a TeraVM MA, the IP addresses are available also in the outpu...
    It is necessary to enable the "Window Scaling" option in the Advanced Settings window for HTML5 UI tests. Activating TCP Window Scaling allows the window size to be dynamically adjusted based on network conditions, avoiding throttling when streaming UI elements. You simply mark the "Enable Window Scaling" checkbox to apply this improvement.
    What is measured by the DES56 column in the TLS statistics? cond received (at Layer 1, may be estimated).

    Table 3-88. HttpClient - Tls It shows the total number of unique session IDs that were generated when falling back to DES encryption with 56-bit keys, including both full and resumed sessions. Each distinct session ID adds one unit to the counter, irrespective of whether the connection completed or was subsequently resumed.
    How do you enable or disable a Task in the Job tab? lected Task. 3. If the Task is already enabled, then select the Disable menu item to disable the task, otherwise select the Enable menu item to enable the task.


    Deleting a Task


    Note A task cannot be deleted if it is part of an active job. ---To delete a Task: 1. In the Job tab select the task which you wish to delete. 2. Right click on the selected Task. 3. Select the Delete menu item to delete the selected Task.
    You enable or disable a Task by going to the Job tab and selecting Tools > Task Options. In the dialog box that appears, locate the 'Status' slider bar under the General tab. Drag it toward the green side to enable or toward the red side to disable. After adjusting, click OK. Then you must also edit the trigger settings by switching the checkbox in the Recurrence section off or on, which completes the enabling or disabling process.
  • Loss: MultipleNegativesRankingLoss with these parameters:
    {
        "scale": 20.0,
        "similarity_fct": "cos_sim",
        "gather_across_devices": false
    }
    
  • Evaluation Dataset

    Unnamed Dataset

    • Size: 355 evaluation samples
    • Columns: anchor, positive, and negative
    • Approximate statistics based on the first 355 samples:
      anchor positive negative
      type string string string
      details
      • min: 9 tokens
      • mean: 18.46 tokens
      • max: 40 tokens
      • min: 55 tokens
      • mean: 415.19 tokens
      • max: 1257 tokens
      • min: 34 tokens
      • mean: 92.46 tokens
      • max: 192 tokens
    • Samples:
      anchor positive negative
      How many initialNumberOfApplications are configured for the FTPClients? rp/engineering/TeraVM_Classic/16.5/Documentation/API/TeraVM_REST_Control_Manager_API.html#_example_response_13)
      ```
      HTTP/1.1 200 OK
      Content-Type: application/json
      Content-Length: 4850{"id":1,"name":"Throughput","tests":[{"testType":"ADAPTIVE","name":"f","libraryName":"FTP Throughput","testConstraints":[],"expertSettings":{"sys_tcp-maxrtx":2,"sys_param-flags":"0x10","sys_phyif-rxring":"4096","sys_phyif-txring":1024,"sys_tcp-fastwrite":"full","sys_tcp-synmaxrtx":2,"sys_param-ipchksum":"tx","sys_param-tcpchksum":"tx","sys_param-tcpflags+":["0x40","0x4"],"sys_param-udpchksum":"tx","sys_param-taskparams":200,"sys_phyif-linkstatus":"off","sys_tcp-fastreadchksum":"on"},"duration":0,"tag":{},"systemsUnderTest":[],"captureSettings":{"captureType":"OFF","packetCount":5000,"numberOfSubnets":1,"timeDuration":0,"transportProtocol":"ANY"},"platformDependentConfig":[{"platformType":"GoogleCloudPlatform","overrideMtuValue":1460,"supportLro":false}],"testMetrics":[{"name":"In L1 bits/s","group":"Interf...
      According to the example, the FTPClients application profile has initialNumberOfApplications configured as 30. This lower client count is intended to represent a restrained testing scenario, where the focus is on assessing per-client performance metrics such as command completion times and session establishment rates rather than peak throughput. By using 30 clients, the test provides detailed insights into latency, retransmit counts, and sequence ordering without overwhelming the server’s networking stack.
      What is the allowed duration range for the ramp-down phase of a test? must be set between 10 and 3596610 seconds.

      For information on each individual application profile set of Metrics, see the corresponding test template.


      HTTPS Metrics are displayed as 0, if selected in the Metrics tab, while not enabled in the Application Profile. For a list of HTTPS Metrics available, see Appendix B.


      The Metrics that are used as KPIs or Constraints are not editable, they must always be selected in a test. The Constraints are part of the Application Profi...
      According to the alternative guidelines, the ramp-down phase must be set between 10 seconds and 1000 seconds. This adjustment was made to accommodate both short-lived functional validations and extended endurance testing. The minimum of 10 seconds provides sufficient time for background cleanup tasks to complete, while the maximum of 1000 seconds caters to scenarios where a slow ramp-down is critical for analyzing resource release patterns under sustained load.
      What distinguishes the DdosListener RttBuckets statistics from the DdosListener L1 throughput statistics? s

      Table 3-48. DdosListener - L1










      # DdosListener - RttBuckets Optional Round Trip Time (RTT) Bucket Stats. Available only on TCP-based Aggregates (HTTP, SMTP, POP, FTP, etc). NOTE: Because the bucket arrangement is user-configurable, the actual columns available may differ from the example presented here.Table 3-49. DdosListener - RttBuckets
      The RttBuckets statistics measure the average byte rate distribution across different round trip time categories, effectively combining throughput and latency analysis into one dataset, whereas L1 throughput focuses purely on throughput without bucketed distribution.
    • Loss: MultipleNegativesRankingLoss with these parameters:
      {
          "scale": 20.0,
          "similarity_fct": "cos_sim",
          "gather_across_devices": false
      }
      
    • Training Hyperparameters

      Non-Default Hyperparameters

      • eval_strategy: steps
      • per_device_train_batch_size: 2
      • per_device_eval_batch_size: 2
      • gradient_accumulation_steps: 32
      • learning_rate: 2e-06
      • num_train_epochs: 1
      • lr_scheduler_type: cosine
      • warmup_ratio: 0.1
      • bf16: True
      • tf32: True
      • optim: adamw_torch_fused
      • 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: 2
      • per_device_eval_batch_size: 2
      • per_gpu_train_batch_size: None
      • per_gpu_eval_batch_size: None
      • gradient_accumulation_steps: 32
      • eval_accumulation_steps: None
      • torch_empty_cache_steps: None
      • learning_rate: 2e-06
      • weight_decay: 0.0
      • adam_beta1: 0.9
      • adam_beta2: 0.999
      • adam_epsilon: 1e-08
      • max_grad_norm: 1.0
      • num_train_epochs: 1
      • 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
      • use_ipex: 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: True
      • 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
      • 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: False
      • 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: False
      • prompts: None
      • batch_sampler: no_duplicates
      • multi_dataset_batch_sampler: proportional
      • router_mapping: {}
      • learning_rate_mapping: {}

      Training Logs

      Epoch Step Qwen/Qwen3-Embedding-4B-Matryoshka_cosine_accuracy
      -1 -1 0.6169

      Framework Versions

      • Python: 3.11.10
      • Sentence Transformers: 5.2.0
      • Transformers: 4.56.0
      • PyTorch: 2.5.1+cu121
      • Accelerate: 1.10.1
      • Datasets: 4.0.0
      • Tokenizers: 0.22.0

      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{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}
      }
      
Downloads last month
18
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 mrhimanshu/viaviembedteravm

Base model

Qwen/Qwen3-4B-Base
Finetuned
(33)
this model

Papers for mrhimanshu/viaviembedteravm

Evaluation results

  • Cosine Accuracy on Qwen/Qwen3 Embedding 4B Matryoshka
    self-reported
    0.617