SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2

This is a sentence-transformers model finetuned from sentence-transformers/all-MiniLM-L6-v2. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for retrieval.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: sentence-transformers/all-MiniLM-L6-v2
  • Maximum Sequence Length: 256 tokens
  • Output Dimensionality: 384 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': 'BertModel'})
  (1): Pooling({'embedding_dimension': 384, 'pooling_mode': 'mean', '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("kelompoknlp2026dsindo/retriever_260511070554_FINAL")
# Run inference
sentences = [
    'Measurements indicating that 2017 had relatively more sea ice in the Arctic and less melting of glacial ice in Greenland casts scientific doubt on the reality of global warming.',
    'The effects of global warming in the Arctic, or climate change in the Arctic include rising air and water temperatures, loss of sea ice, and melting of the Greenland ice sheet with a related cold temperature anomaly, observed since the 1970s.',
    'Human-caused increases in greenhouse gases are responsible for most of the observed global average surface warming of roughly 0.8\u202f°C (1.5\u202f°F) over the past 140 years.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.5034, 0.2555],
#         [0.5034, 1.0000, 0.4109],
#         [0.2555, 0.4109, 1.0000]])

Evaluation

Metrics

Information Retrieval

Metric Value
cosine_accuracy@1 0.2389
cosine_accuracy@3 0.469
cosine_accuracy@5 0.5752
cosine_accuracy@10 0.6726
cosine_precision@1 0.2389
cosine_precision@3 0.1947
cosine_precision@5 0.1575
cosine_precision@10 0.1053
cosine_precision@50 0.0331
cosine_precision@100 0.0185
cosine_precision@200 0.0102
cosine_recall@1 0.1121
cosine_recall@3 0.2397
cosine_recall@5 0.3314
cosine_recall@10 0.4282
cosine_recall@50 0.6518
cosine_recall@100 0.7305
cosine_recall@200 0.8034
cosine_ndcg@10 0.324
cosine_mrr@10 0.3777
cosine_map@100 0.2577

Training Details

Training Dataset

Unnamed Dataset

  • Size: 2,192 training samples
  • Columns: anchor and positive
  • Approximate statistics based on the first 1000 samples:
    anchor positive
    type string string
    details
    • min: 7 tokens
    • mean: 26.25 tokens
    • max: 70 tokens
    • min: 9 tokens
    • mean: 37.84 tokens
    • max: 111 tokens
  • Samples:
    anchor positive
    Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life. At very high concentrations (100 times atmospheric concentration, or greater), carbon dioxide can be toxic to animal life, so raising the concentration to 10,000 ppm (1%) or higher for several hours will eliminate pests such as whiteflies and spider mites in a greenhouse.
    Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life. Plants can grow as much as 50 percent faster in concentrations of 1,000 ppm CO 2 when compared with ambient conditions, though this assumes no change in climate and no limitation on other nutrients.
    Not only is there no scientific evidence that CO2 is a pollutant, higher CO2 concentrations actually help ecosystems support more plant and animal life. Higher carbon dioxide concentrations will favourably affect plant growth and demand for water.
  • 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: 16
  • per_device_eval_batch_size: 16
  • learning_rate: 1e-05
  • num_train_epochs: 20
  • warmup_steps: 100
  • data_seed: 42
  • load_best_model_at_end: True
  • batch_sampler: no_duplicates

All Hyperparameters

Click to expand
  • do_predict: False
  • prediction_loss_only: True
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 1e-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: 20
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: None
  • warmup_ratio: None
  • warmup_steps: 100
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • enable_jit_checkpoint: False
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • use_cpu: False
  • seed: 42
  • data_seed: 42
  • bf16: False
  • fp16: False
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: -1
  • ddp_backend: None
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: True
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': 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
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch_fused
  • optim_args: None
  • 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
  • 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_for_metrics: []
  • eval_do_concat_batches: True
  • auto_find_batch_size: False
  • full_determinism: False
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • 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
  • use_cache: False
  • 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 dev_cosine_ndcg@10
0.0365 5 0.8437 -
0.0730 10 0.8164 -
0.1095 15 0.8009 -
0.1460 20 0.7637 -
0.1825 25 0.8168 -
0.2190 30 0.8028 -
0.2555 35 0.6182 -
0.2920 40 0.6689 -
0.3285 45 0.8032 -
0.3650 50 0.6298 -
0.4015 55 0.6443 -
0.4380 60 0.6813 -
0.4745 65 0.4928 -
0.5109 70 0.8207 -
0.5474 75 0.5841 -
0.5839 80 0.5238 -
0.6204 85 0.4142 -
0.6569 90 0.6077 -
0.6934 95 0.4521 -
0.7299 100 0.5201 -
0.7664 105 0.5142 -
0.8029 110 0.4498 -
0.8394 115 0.5953 -
0.8759 120 0.3598 -
0.9124 125 0.5734 -
0.9489 130 0.4794 -
0.9854 135 0.4036 -
1.0 137 - 0.3189
1.0219 140 0.3969 -
1.0584 145 0.4520 -
1.0949 150 0.4475 -
1.1314 155 0.5730 -
1.1679 160 0.5064 -
1.2044 165 0.3858 -
1.2409 170 0.4059 -
1.2774 175 0.1969 -
1.3139 180 0.6806 -
1.3504 185 0.4008 -
1.3869 190 0.3313 -
1.4234 195 0.5591 -
1.4599 200 0.3068 -
1.4964 205 0.2700 -
1.5328 210 0.3596 -
1.5693 215 0.4863 -
1.6058 220 0.3552 -
1.6423 225 0.3481 -
1.6788 230 0.3418 -
1.7153 235 0.5629 -
1.7518 240 0.4146 -
1.7883 245 0.5223 -
1.8248 250 0.4027 -
1.8613 255 0.3733 -
1.8978 260 0.3287 -
1.9343 265 0.3615 -
1.9708 270 0.2782 -
2.0 274 - 0.3254
2.0073 275 0.4479 -
2.0438 280 0.2815 -
2.0803 285 0.3969 -
2.1168 290 0.3915 -
2.1533 295 0.4366 -
2.1898 300 0.3599 -
2.2263 305 0.2776 -
2.2628 310 0.2626 -
2.2993 315 0.3017 -
2.3358 320 0.3362 -
2.3723 325 0.2068 -
2.4088 330 0.2746 -
2.4453 335 0.3807 -
2.4818 340 0.2927 -
2.5182 345 0.2699 -
2.5547 350 0.2439 -
2.5912 355 0.3890 -
2.6277 360 0.5438 -
2.6642 365 0.4341 -
2.7007 370 0.2560 -
2.7372 375 0.1545 -
2.7737 380 0.1854 -
2.8102 385 0.4939 -
2.8467 390 0.2932 -
2.8832 395 0.3529 -
2.9197 400 0.2541 -
2.9562 405 0.2895 -
2.9927 410 0.3107 -
3.0 411 - 0.3277
3.0292 415 0.3130 -
3.0657 420 0.2742 -
3.1022 425 0.2136 -
3.1387 430 0.1759 -
3.1752 435 0.2413 -
3.2117 440 0.2888 -
3.2482 445 0.1988 -
3.2847 450 0.2650 -
3.3212 455 0.1097 -
3.3577 460 0.2162 -
3.3942 465 0.2702 -
3.4307 470 0.2485 -
3.4672 475 0.2010 -
3.5036 480 0.2736 -
3.5401 485 0.2912 -
3.5766 490 0.3467 -
3.6131 495 0.2874 -
3.6496 500 0.2772 -
3.6861 505 0.3618 -
3.7226 510 0.1875 -
3.7591 515 0.2509 -
3.7956 520 0.2517 -
3.8321 525 0.2589 -
3.8686 530 0.3354 -
3.9051 535 0.2970 -
3.9416 540 0.2349 -
3.9781 545 0.1915 -
4.0 548 - 0.3205
4.0146 550 0.1950 -
4.0511 555 0.2137 -
4.0876 560 0.2170 -
4.1241 565 0.3080 -
4.1606 570 0.2038 -
4.1971 575 0.1622 -
4.2336 580 0.1701 -
4.2701 585 0.1806 -
4.3066 590 0.2083 -
4.3431 595 0.2606 -
4.3796 600 0.4207 -
4.4161 605 0.2372 -
4.4526 610 0.1963 -
4.4891 615 0.1232 -
4.5255 620 0.1927 -
4.5620 625 0.2543 -
4.5985 630 0.2017 -
4.6350 635 0.2134 -
4.6715 640 0.2981 -
4.7080 645 0.2670 -
4.7445 650 0.2822 -
4.7810 655 0.2664 -
4.8175 660 0.2651 -
4.8540 665 0.1945 -
4.8905 670 0.2803 -
4.9270 675 0.3401 -
4.9635 680 0.2055 -
5.0 685 0.2808 0.3240
  • The bold row denotes the saved checkpoint.

Training Time

  • Training: 1.9 hours

Framework Versions

  • Python: 3.12.13
  • Sentence Transformers: 5.4.1
  • Transformers: 5.0.0
  • PyTorch: 2.10.0+cu128
  • Accelerate: 1.13.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",
}

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

Model tree for kelompoknlp2026dsindo/retriever_260511070554_FINAL

Finetuned
(902)
this model

Papers for kelompoknlp2026dsindo/retriever_260511070554_FINAL

Evaluation results