Team Ai
Modelpublic

CocoRoF/ModernBERT-SimCSE-multitask_v03-distill

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes79downloads
Model Card

SentenceTransformer based on CocoRoF/ModernBERT-SimCSE-multitask_v03-retry

This is a sentence-transformers model finetuned from CocoRoF/ModernBERT-SimCSE-multitask_v03-retry on the misc_sts_pairs_v2_kor_kosimcse dataset. 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: CocoRoF/ModernBERT-SimCSE-multitask_v03-retry <!-- at revision 8ea8efa5d7e41826a9093b28badc01ed44d01ace -->
  • —Maximum Sequence Length: 2048 tokens
  • —Output Dimensionality: 1024 dimensions
  • —Similarity Function: Cosine Similarity
  • —Training Dataset:
  • —misc_sts_pairs_v2_kor_kosimcse <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 2048, 'do_lower_case': False}) with Transformer model: ModernBertModel 
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
  (2): Dense({'in_features': 768, 'out_features': 1024, 'bias': True, 'activation_function': 'torch.nn.modules.activation.Tanh'})
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("CocoRoF/ModernBERT-SimCSE-multitask_v03-distill")
# Run inference
sentences = [
    '버스가 바쁜 길을 따라 운전한다.',
    '녹색 버스가 도로를 따라 내려간다.',
    '그 여자는 데이트하러 가는 중이다.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

Evaluation

Metrics

Semantic Similarity
MetricValue
pearson_cosine0.8221
spearman_cosine0.8282
pearson_euclidean0.7929
spearman_euclidean0.798
pearson_manhattan0.7937
spearman_manhattan0.7997
pearson_dot0.7011
spearman_dot0.6845
pearson_max0.8221
spearman_max0.8282

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Dataset

miscstspairsv2kor_kosimcse
  • —Dataset: misc_sts_pairs_v2_kor_kosimcse at e747415
  • —Size: 449,904 training samples
  • —Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>score</code>
  • —Approximate statistics based on the first 1000 samples: | | sentence1 | sentence2 | score | |:--------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------| | type | string | string | float | | details | <ul><li>min: 6 tokens</li><li>mean: 18.3 tokens</li><li>max: 69 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 18.69 tokens</li><li>max: 66 tokens</li></ul> | <ul><li>min: 0.11</li><li>mean: 0.77</li><li>max: 1.0</li></ul> |
  • —Samples: | sentence1 | sentence2 | score | |:-------------------------------------------------|:-------------------------------------------|:--------------------------------| | <code>주홍글씨는 언제 출판되었습니까?</code> | <code>《주홍글씨》는 몇 년에 출판되었습니까?</code> | <code>0.8638778924942017</code> | | <code>폴란드에서 빨간색과 흰색은 무엇을 의미합니까?</code> | <code>폴란드 국기의 색상은 무엇입니까?</code> | <code>0.6773715019226074</code> | | <code>노르만인들은 방어를 위해 모트와 베일리 성을 어떻게 사용했는가?</code> | <code>11세기에는 어떻게 모트와 베일리 성을 만들었습니까?</code> | <code>0.7460665702819824</code> |
  • —Loss: <code>CosineSimilarityLoss</code> with these parameters:
json
  {
      "loss_fct": "torch.nn.modules.loss.MSELoss"
  }

Evaluation Dataset

Unnamed Dataset
  • —Size: 1,500 evaluation samples
  • —Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>score</code>
  • —Approximate statistics based on the first 1000 samples: | | sentence1 | sentence2 | score | |:--------|:----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------| | type | string | string | float | | details | <ul><li>min: 7 tokens</li><li>mean: 20.38 tokens</li><li>max: 52 tokens</li></ul> | <ul><li>min: 6 tokens</li><li>mean: 20.52 tokens</li><li>max: 54 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.42</li><li>max: 1.0</li></ul> |
  • —Samples: | sentence1 | sentence2 | score | |:-------------------------------------|:------------------------------------|:------------------| | <code>안전모를 가진 한 남자가 춤을 추고 있다.</code> | <code>안전모를 쓴 한 남자가 춤을 추고 있다.</code> | <code>1.0</code> | | <code>어린아이가 말을 타고 있다.</code> | <code>아이가 말을 타고 있다.</code> | <code>0.95</code> | | <code>한 남자가 뱀에게 쥐를 먹이고 있다.</code> | <code>남자가 뱀에게 쥐를 먹이고 있다.</code> | <code>1.0</code> |
  • —Loss: <code>CosineSimilarityLoss</code> with these parameters:
json
  {
      "loss_fct": "torch.nn.modules.loss.MSELoss"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —overwrite_output_dir: True
  • —eval_strategy: steps
  • —gradient_accumulation_steps: 16
  • —learning_rate: 8e-05
  • —num_train_epochs: 10.0
  • —warmup_ratio: 0.2
  • —push_to_hub: True
  • —hub_model_id: CocoRoF/ModernBERT-SimCSE-multitask_v03-distill
  • —hub_strategy: checkpoint
  • —batch_sampler: no_duplicates
All Hyperparameters

<details><summary>Click to expand</summary>

  • —overwrite_output_dir: True
  • —do_predict: False
  • —eval_strategy: steps
  • —prediction_loss_only: True
  • —per_device_train_batch_size: 8
  • —per_device_eval_batch_size: 8
  • —per_gpu_train_batch_size: None
  • —per_gpu_eval_batch_size: None
  • —gradient_accumulation_steps: 16
  • —eval_accumulation_steps: None
  • —torch_empty_cache_steps: None
  • —learning_rate: 8e-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: 10.0
  • —max_steps: -1
  • —lr_scheduler_type: linear
  • —lr_scheduler_kwargs: {}
  • —warmup_ratio: 0.2
  • —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: False
  • —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: 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: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • —fsdp_transformer_layer_cls_to_wrap: None
  • —accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • —deepspeed: None
  • —label_smoothing_factor: 0.0
  • —optim: adamw_torch
  • —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: True
  • —resume_from_checkpoint: None
  • —hub_model_id: CocoRoF/ModernBERT-SimCSE-multitask_v03-distill
  • —hub_strategy: checkpoint
  • —hub_private_repo: None
  • —hub_always_push: False
  • —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
  • —dispatch_batches: None
  • —split_batches: 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
  • —eval_use_gather_object: False
  • —average_tokens_across_devices: False
  • —prompts: None
  • —batch_sampler: no_duplicates
  • —multi_dataset_batch_sampler: proportional

</details>

Training Logs

<details><summary>Click to expand</summary>

EpochStepTraining LossValidation Losssts_dev_spearman_max
0.0228100.3524--
0.0455200.3496--
0.0683300.3515--
0.0911400.348--
0.1138500.3409--
0.1366600.347--
0.1593700.3377--
0.1821800.3317--
0.2049900.3279--
0.22761000.3264--
0.25041100.3116--
0.27321200.3055--
0.29591300.3042--
0.31871400.2928--
0.34141500.2835--
0.36421600.2665--
0.38701700.2665--
0.40971800.2486--
0.43251900.2387--
0.45532000.2283--
0.47802100.2237--
0.50082200.2204--
0.52352300.205--
0.54632400.2002--
0.56912500.19040.03300.7921
0.59182600.1834--
0.61462700.1776--
0.63742800.1665--
0.66012900.1625--
0.68293000.1585--
0.70563100.1522--
0.72843200.1552--
0.75123300.1448--
0.77393400.1428--
0.79673500.1401--
0.81953600.1399--
0.84223700.1389--
0.86503800.1372--
0.88783900.1338--
0.91054000.1361--
0.93334100.1389--
0.95604200.1328--
0.97884300.1375--
1.04400.1266--
1.02284500.1269--
1.04554600.1262--
1.06834700.127--
1.09114800.1306--
1.11384900.1266--
1.13665000.12470.04050.7995
1.15935100.1258--
1.18215200.1277--
1.20495300.13--
1.22765400.1291--
1.25045500.1287--
1.27325600.1233--
1.29595700.1242--
1.31875800.1242--
1.34145900.1227--
1.36426000.1201--
1.38706100.1247--
1.40976200.1249--
1.43256300.1213--
1.45536400.1217--
1.47806500.1204--
1.50086600.1191--
1.52356700.1163--
1.54636800.1171--
1.56916900.1208--
1.59187000.1194--
1.61467100.1173--
1.63747200.1177--
1.66017300.1148--
1.68297400.1134--
1.70567500.11670.04220.8092
1.72847600.1145--
1.75127700.114--
1.77397800.1136--
1.79677900.1123--
1.81958000.1115--
1.84228100.1127--
1.86508200.1137--
1.88788300.1137--
1.91058400.1123--
1.93338500.1115--
1.95608600.1105--
1.97888700.1133--
2.08800.1049--
2.02288900.1091--
2.04559000.111--
2.06839100.1101--
2.09119200.1078--
2.11389300.1097--
2.13669400.108--
2.15939500.1077--
2.18219600.1087--
2.20499700.1058--
2.22769800.1071--
2.25049900.1058--
2.273210000.11040.04340.8156
2.295910100.1036--
2.318710200.1068--
2.341410300.1033--
2.364210400.1058--
2.387010500.105--
2.409710600.1052--
2.432510700.1013--
2.455310800.1037--
2.478010900.1031--
2.500811000.1057--
2.523511100.1051--
2.546311200.1019--
2.569111300.1018--
2.591811400.1007--
2.614611500.1035--
2.637411600.1032--
2.660111700.1036--
2.682911800.0971--
2.705611900.1015--
2.728412000.104--
2.751212100.1007--
2.773912200.102--
2.796712300.0994--
2.819512400.0972--
2.842212500.09690.04370.8185
2.865012600.0968--
2.887812700.1003--
2.910512800.1036--
2.933312900.0969--
2.956013000.0965--
2.978813100.0974--
3.013200.0905--
3.022813300.1006--
3.045513400.0952--
3.068313500.0971--
3.091113600.0943--
3.113813700.0996--
3.136613800.0971--
3.159313900.097--
3.182114000.0937--
3.204914100.0955--
3.227614200.0963--
3.250414300.0938--
3.273214400.0986--
3.295914500.0949--
3.318714600.0932--
3.341414700.096--
3.364214800.0919--
3.387014900.093--
3.409715000.09250.04380.8201
3.432515100.0935--
3.455315200.0928--
3.478015300.0914--
3.500815400.0912--
3.523515500.091--
3.546315600.0906--
3.569115700.0936--
3.591815800.0943--
3.614615900.0925--
3.637416000.0908--
3.660116100.0933--
3.682916200.0917--
3.705616300.0887--
3.728416400.0903--
3.751216500.0934--
3.773916600.0906--
3.796716700.0886--
3.819516800.0915--
3.842216900.0924--
3.865017000.094--
3.887817100.0899--
3.910517200.0881--
3.933317300.0884--
3.956017400.0894--
3.978817500.08920.04410.8215
4.017600.0812--
4.022817700.0878--
4.045517800.0869--
4.068317900.09--
4.091118000.0875--
4.113818100.086--
4.136618200.0888--
4.159318300.086--
4.182118400.0869--
4.204918500.0885--
4.227618600.0891--
4.250418700.0853--
4.273218800.0849--
4.295918900.0856--
4.318719000.0863--
4.341419100.0849--
4.364219200.0855--
4.387019300.0841--
4.409719400.0893--
4.432519500.0847--
4.455319600.0866--
4.478019700.0866--
4.500819800.0844--
4.523519900.0846--
4.546320000.08470.04350.8220
4.569120100.0831--
4.591820200.0843--
4.614620300.086--
4.637420400.0851--
4.660120500.0844--
4.682920600.0843--
4.705620700.0854--
4.728420800.0851--
4.751220900.0822--
4.773921000.0859--
4.796721100.0844--
4.819521200.0853--
4.842221300.0815--
4.865021400.0833--
4.887821500.0817--
4.910521600.0873--
4.933321700.0813--
4.956021800.0829--
4.978821900.0812--
5.022000.0776--
5.022822100.083--
5.045522200.0821--
5.068322300.0806--
5.091122400.0809--
5.113822500.08140.04310.8225
5.136622600.0808--
5.159322700.0791--
5.182122800.0811--
5.204922900.0805--
5.227623000.0817--
5.250423100.0772--
5.273223200.0799--
5.295923300.0829--
5.318723400.077--
5.341423500.0801--
5.364223600.0812--
5.387023700.0788--
5.409723800.0776--
5.432523900.0785--
5.455324000.0771--
5.478024100.0788--
5.500824200.0796--
5.523524300.0793--
5.546324400.0813--
5.569124500.0757--
5.591824600.079--
5.614624700.0797--
5.637424800.0794--
5.660124900.0808--
5.682925000.07960.04240.8230
5.705625100.0802--
5.728425200.0799--
5.751225300.0802--
5.773925400.0813--
5.796725500.0772--
5.819525600.0766--
5.842225700.0778--
5.865025800.076--
5.887825900.0787--
5.910526000.0794--
5.933326100.076--
5.956026200.0773--
5.978826300.0755--
6.026400.0725--
6.022826500.0738--
6.045526600.0762--
6.068326700.0761--
6.091126800.0771--
6.113826900.0765--
6.136627000.0755--
6.159327100.0771--
6.182127200.0748--
6.204927300.0768--
6.227627400.0766--
6.250427500.07660.04220.8239
6.273227600.076--
6.295927700.0753--
6.318727800.0735--
6.341427900.0751--
6.364228000.0738--
6.387028100.0749--
6.409728200.0753--
6.432528300.077--
6.455328400.0747--
6.478028500.0722--
6.500828600.0736--
6.523528700.073--
6.546328800.0774--
6.569128900.075--
6.591829000.0718--
6.614629100.0727--
6.637429200.0735--
6.660129300.0726--
6.682929400.075--
6.705629500.0728--
6.728429600.0713--
6.751229700.0722--
6.773929800.0753--
6.796729900.0733--
6.819530000.07270.04250.8243
6.842230100.0729--
6.865030200.073--
6.887830300.0739--
6.910530400.0717--
6.933330500.0719--
6.956030600.0712--
6.978830700.0712--
7.030800.0674--
7.022830900.0729--
7.045531000.0712--
7.068331100.0701--
7.091131200.0699--
7.113831300.0675--
7.136631400.0699--
7.159331500.0716--
7.182131600.0707--
7.204931700.0717--
7.227631800.0709--
7.250431900.071--
7.273232000.0722--
7.295932100.072--
7.318732200.0729--
7.341432300.0678--
7.364232400.0705--
7.387032500.07150.04260.8256
7.409732600.0703--
7.432532700.0699--
7.455332800.071--
7.478032900.0692--
7.500833000.0693--
7.523533100.0661--
7.546333200.0702--
7.569133300.0697--
7.591833400.072--
7.614633500.0693--
7.637433600.0691--
7.660133700.0702--
7.682933800.0672--
7.705633900.0698--
7.728434000.0687--
7.751234100.0654--
7.773934200.0687--
7.796734300.0679--
7.819534400.0713--
7.842234500.0676--
7.865034600.0708--
7.887834700.0666--
7.910534800.0675--
7.933334900.0693--
7.956035000.06880.04270.8260
7.978835100.068--
8.035200.063--
8.022835300.0659--
8.045535400.0639--
8.068335500.0678--
8.091135600.0689--
8.113835700.0687--
8.136635800.0672--
8.159335900.0659--
8.182136000.0658--
8.204936100.0664--
8.227636200.0659--
8.250436300.0664--
8.273236400.0652--
8.295936500.0683--
8.318736600.0641--
8.341436700.0672--
8.364236800.0655--
8.387036900.0661--
8.409737000.0638--
8.432537100.0675--
8.455337200.0648--
8.478037300.067--
8.500837400.0684--
8.523537500.06670.04200.8268
8.546337600.0645--
8.569137700.0652--
8.591837800.0633--
8.614637900.065--
8.637438000.064--
8.660138100.0677--
8.682938200.0661--
8.705638300.0653--
8.728438400.0625--
8.751238500.0651--
8.773938600.0656--
8.796738700.0636--
8.819538800.0655--
8.842238900.0647--
8.865039000.0638--
8.887839100.0636--
8.910539200.0666--
8.933339300.062--
8.956039400.065--
8.978839500.0643--
9.039600.0594--
9.022839700.0616--
9.045539800.0638--
9.068339900.0625--
9.091140000.06650.04140.8276
9.113840100.0624--
9.136640200.0621--
9.159340300.0648--
9.182140400.0622--
9.204940500.0635--
9.227640600.061--
9.250440700.0602--
9.273240800.0613--
9.295940900.0604--
9.318741000.0623--
9.341441100.0641--
9.364241200.0635--
9.387041300.0608--
9.409741400.0611--
9.432541500.0607--
9.455341600.0631--
9.478041700.0618--
9.500841800.0609--
9.523541900.0613--
9.546342000.0606--
9.569142100.0595--
9.591842200.0609--
9.614642300.061--
9.637442400.0616--
9.660142500.06130.04180.8282
9.682942600.0623--
9.705642700.0605--
9.728442800.0637--
9.751242900.0604--
9.773943000.0606--
9.796743100.0622--
9.819543200.0598--
9.842243300.0611--
9.865043400.0604--
9.887843500.0598--
9.910543600.0626--
9.933343700.0624--
9.956043800.0617--
9.978843900.0603--

</details>

Framework Versions

  • —Python: 3.11.10
  • —Sentence Transformers: 3.4.1
  • —Transformers: 4.48.3
  • —PyTorch: 2.5.1+cu124
  • —Accelerate: 1.3.0
  • —Datasets: 3.3.0
  • —Tokenizers: 0.21.0

Citation

BibTeX

Sentence Transformers
bibtex
@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",
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->