CoolFace
Modelpublic

agentlans/deberta-v3-xsmall-zyda-2-v2

sourceHugging Faceupdated 2y agoView on Hugging Face
2likes19downloads
Model Card

SentenceTransformer based on agentlans/deberta-v3-xsmall-zyda-2

This is a sentence-transformers model finetuned from agentlans/deberta-v3-xsmall-zyda-2. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.

It was finetuned in the same way as agentlans/deberta-v3-base-zyda-2-v2. However, the training loss is much higher probably due its small model size.

Model Details

Model Description

  • —Model Type: Sentence Transformer
  • —Base model: agentlans/deberta-v3-xsmall-zyda-2 <!-- at revision e8b975c39abdf9cca77a022a376ae9459bb7cded -->
  • —Maximum Sequence Length: 512 tokens
  • —Output Dimensionality: 384 tokens
  • —Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: DebertaV2Model 
  (1): Pooling({'word_embedding_dimension': 384, '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})
)

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("agentlans/deberta-v3-xsmall-zyda-2-v2")
# Run inference
sentences = [
    'The expansion of European colonies resulted in the dissemination of their cultural ideas and institutions to other regions.',
    'How long do dogs bleed during menstruation?',
    'The team added a second car for Thed Björk in 2006 , and was replaced by Richard Göransson in 2009 .',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]

# 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. -->

<!--

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

Unnamed Dataset
  • —Size: 1,079,040 training samples
  • —Columns: <code>sentence0</code>, <code>sentence1</code>, and <code>label</code>
  • —Approximate statistics based on the first 1000 samples: | | sentence0 | sentence1 | label | |:--------|:-----------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:---------------------------------------------------------------| | type | string | string | float | | details | <ul><li>min: 7 tokens</li><li>mean: 22.43 tokens</li><li>max: 104 tokens</li></ul> | <ul><li>min: 7 tokens</li><li>mean: 20.92 tokens</li><li>max: 77 tokens</li></ul> | <ul><li>min: 0.0</li><li>mean: 0.33</li><li>max: 1.0</li></ul> |
  • —Samples: | sentence0 | sentence1 | label | |:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------| | <code>Can attaching a CAR with cab companies such as OLA, Taxi for Sure, and Meru Cabs result in financial gain? What are the final returns after factoring in all practical earnings and expenses?</code> | <code>A problem is regarded as inherently difficult if its solution requires significant resources, whatever the algorithm used.</code> | <code>0.0</code> | | <code>She was loaned the money with the specific aim of providing for the child's needs.</code> | <code>The Army's training and doctrine command spokesperson, Maj. Mike Kenfield, stated that the program had been recognized for its role in reducing non-lethal operations and that there were plans to expand the team's reach beyond Iraq and Afghanistan.</code> | <code>0.0</code> | | <code>Two rotavirus vaccines against Rotavirus A infection are safe and effective in children : Rotarix by GlaxoSmithKline and RotaTeq by Merck .</code> | <code>contact lists were wiped after the makers of the game enjoyed by .</code> | <code>0.0</code> |
  • —Loss: <code>CoSENTLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "pairwise_cos_sim"
  }

Training Hyperparameters

Non-Default Hyperparameters
  • —per_device_train_batch_size: 16
  • —per_device_eval_batch_size: 16
  • —multi_dataset_batch_sampler: round_robin
All Hyperparameters

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

  • —overwrite_output_dir: False
  • —do_predict: False
  • —eval_strategy: no
  • —prediction_loss_only: True
  • —per_device_train_batch_size: 16
  • —per_device_eval_batch_size: 16
  • —per_gpu_train_batch_size: None
  • —per_gpu_eval_batch_size: None
  • —gradient_accumulation_steps: 1
  • —eval_accumulation_steps: None
  • —torch_empty_cache_steps: None
  • —learning_rate: 5e-05
  • —weight_decay: 0.0
  • —adam_beta1: 0.9
  • —adam_beta2: 0.999
  • —adam_epsilon: 1e-08
  • —max_grad_norm: 1
  • —num_train_epochs: 3
  • —max_steps: -1
  • —lr_scheduler_type: linear
  • —lr_scheduler_kwargs: {}
  • —warmup_ratio: 0.0
  • —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: 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: 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: False
  • —resume_from_checkpoint: None
  • —hub_model_id: None
  • —hub_strategy: every_save
  • —hub_private_repo: False
  • —hub_always_push: False
  • —gradient_checkpointing: False
  • —gradient_checkpointing_kwargs: None
  • —include_inputs_for_metrics: False
  • —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
  • —eval_use_gather_object: False
  • —batch_sampler: batch_sampler
  • —multi_dataset_batch_sampler: round_robin

</details>

Training Logs

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

EpochStepTraining Loss
0.00745002.6583
0.014810001.5993
0.022215001.0375
0.029720000.8232
0.037125000.6996
0.044530000.6607
0.051935000.6087
0.059340000.5447
0.066745000.5691
0.074150000.5576
0.081655000.5405
0.089060000.4901
0.096465000.5432
0.103870000.4969
0.111275000.5058
0.118680000.4935
0.126085000.5072
0.133590000.4525
0.140995000.5121
0.1483100000.5217
0.1557105000.5012
0.1631110000.4475
0.1705115000.4788
0.1779120000.4687
0.1853125000.4651
0.1928130000.4056
0.2002135000.485
0.2076140000.4738
0.2150145000.4194
0.2224150000.4522
0.2298155000.5182
0.2372160000.4746
0.2447165000.4762
0.2521170000.4804
0.2595175000.4041
0.2669180000.4
0.2743185000.4459
0.2817190000.4258
0.2891195000.4218
0.2966200000.4951
0.3040205000.4687
0.3114210000.446
0.3188215000.5007
0.3262220000.4506
0.3336225000.4916
0.3410230000.403
0.3485235000.4527
0.3559240000.4052
0.3633245000.4387
0.3707250000.4238
0.3781255000.4208
0.3855260000.4363
0.3929265000.429
0.4004270000.4837
0.4078275000.4042
0.4152280000.465
0.4226285000.4259
0.4300290000.4342
0.4374295000.4521
0.4448300000.397
0.4523305000.4213
0.4597310000.4309
0.4671315000.473
0.4745320000.4081
0.4819325000.3937
0.4893330000.4402
0.4967335000.4685
0.5042340000.4309
0.5116345000.4349
0.5190350000.4357
0.5264355000.5066
0.5338360000.4424
0.5412365000.4532
0.5486370000.4576
0.5560375000.4634
0.5635380000.4742
0.5709385000.4565
0.5783390000.4613
0.5857395000.385
0.5931400000.4613
0.6005405000.4129
0.6079410000.4066
0.6154415000.4372
0.6228420000.4426
0.6302425000.4561
0.6376430000.4557
0.6450435000.4163
0.6524440000.3948
0.6598445000.4461
0.6673450000.4717
0.6747455000.3877
0.6821460000.4421
0.6895465000.4977
0.6969470000.433
0.7043475000.4292
0.7117480000.4749
0.7192485000.4418
0.7266490000.4091
0.7340495000.412
0.7414500000.465
0.7488505000.4649
0.7562510000.4311
0.7636515000.4238
0.7711520000.4228
0.7785525000.4491
0.7859530000.4434
0.7933535000.4364
0.8007540000.435
0.8081545000.4196
0.8155550000.4866
0.8230555000.4684
0.8304560000.4264
0.8378565000.4061
0.8452570000.4813
0.8526575000.4596
0.8600580000.4602
0.8674585000.4342
0.8749590000.4358
0.8823595000.4693
0.8897600000.4794
0.8971605000.4515
0.9045610000.4574
0.9119615000.388
0.9193620000.408
0.9267625000.4204
0.9342630000.4001
0.9416635000.4995
0.9490640000.477
0.9564645000.4395
0.9638650000.4498
0.9712655000.4893
0.9786660000.4205
0.9861665000.4511
0.9935670000.4393
1.0009675000.4694
1.0083680000.4305
1.0157685000.4272
1.0231690000.3722
1.0305695000.4147
1.0380700000.4019
1.0454705000.4306
1.0528710000.4514
1.0602715000.4377
1.0676720000.4222
1.0750725000.4682
1.0824730000.4684
1.0899735000.4234
1.0973740000.4583
1.1047745000.4659
1.1121750000.4413
1.1195755000.4591
1.1269760000.4363
1.1343765000.4202
1.1418770000.4485
1.1492775000.4817
1.1566780000.4796
1.1640785000.4041
1.1714790000.3975
1.1788795000.4199
1.1862800000.4582
1.1937805000.4115
1.2011810000.4636
1.2085815000.4611
1.2159820000.4025
1.2233825000.4725
1.2307830000.4905
1.2381835000.4346
1.2456840000.4832
1.2530845000.465
1.2604850000.3884
1.2678855000.4228
1.2752860000.4086
1.2826865000.4548
1.2900870000.4022
1.2974875000.5155
1.3049880000.4158
1.3123885000.4638
1.3197890000.4645
1.3271895000.4357
1.3345900000.4144
1.3419905000.412
1.3493910000.3951
1.3568915000.4384
1.3642920000.4292
1.3716925000.391
1.3790930000.4262
1.3864935000.4783
1.3938940000.4474
1.4012945000.4367
1.4087950000.4055
1.4161955000.4471
1.4235960000.4472
1.4309965000.4555
1.4383970000.4854
1.4457975000.389
1.4531980000.4308
1.4606985000.4565
1.4680990000.4344
1.4754995000.4332
1.48281000000.4179
1.49021005000.4546
1.49761010000.4667
1.50501015000.4418
1.51251020000.4462
1.51991025000.4841
1.52731030000.4768
1.53471035000.4072
1.54211040000.453
1.54951045000.4863
1.55691050000.5193
1.56441055000.4476
1.57181060000.4141
1.57921065000.4454
1.58661070000.4072
1.59401075000.4339
1.60141080000.4519
1.60881085000.4432
1.61631090000.4408
1.62371095000.4438
1.63111100000.4188
1.63851105000.4621
1.64591110000.3997
1.65331115000.3953
1.66071120000.4459
1.66811125000.4905
1.67561130000.4067
1.68301135000.4705
1.69041140000.4883
1.69781145000.4553
1.70521150000.4644
1.71261155000.4733
1.72001160000.4591
1.72751165000.4112
1.73491170000.4354
1.74231175000.4771
1.74971180000.4418
1.75711185000.4927
1.76451190000.4273
1.77191195000.4424
1.77941200000.4979
1.78681205000.4479
1.79421210000.4344
1.80161215000.4285
1.80901220000.444
1.81641225000.4389
1.82381230000.4661
1.83131235000.4203
1.83871240000.4452
1.84611245000.4731
1.85351250000.4654
1.86091255000.4802
1.86831260000.445
1.87571265000.4279
1.88321270000.4832
1.89061275000.4754
1.89801280000.4675
1.90541285000.4248
1.91281290000.4189
1.92021295000.4098
1.92761300000.4308
1.93511305000.4118
1.94251310000.4508
1.94991315000.4327
1.95731320000.4557
1.96471325000.4688
1.97211330000.4743
1.97951335000.4362
1.98701340000.4782
1.99441345000.4441
2.00181350000.4344
2.00921355000.4414
2.01661360000.4432
2.02401365000.3841
2.03141370000.4706
2.03881375000.455
2.04631380000.4336
2.05371385000.4215
2.06111390000.4369
2.06851395000.4539
2.07591400000.4395
2.08331405000.4303
2.09071410000.4272
2.09821415000.4857
2.10561420000.4832
2.11301425000.4579
2.12041430000.4695
2.12781435000.4174
2.13521440000.4167
2.14261445000.4766
2.15011450000.4676
2.15751455000.4878
2.16491460000.4259
2.17231465000.4185
2.17971470000.4656
2.18711475000.4278
2.19451480000.4322
2.20201485000.4321
2.20941490000.439
2.21681495000.4254
2.22421500000.5099
2.23161505000.4311
2.23901510000.4404
2.24641515000.4868
2.25391520000.4572
2.26131525000.3887
2.26871530000.4222
2.27611535000.4465
2.28351540000.4298
2.29091545000.4386
2.29831550000.5101
2.30581555000.4677
2.31321560000.4299
2.32061565000.4585
2.32801570000.4335
2.33541575000.4298
2.34281580000.4167
2.35021585000.4132
2.35771590000.4135
2.36511595000.4453
2.37251600000.4093
2.37991605000.4249
2.38731610000.4968
2.39471615000.4763
2.40211620000.4496
2.40951625000.452
2.41701630000.4688
2.42441635000.3847
2.43181640000.4752
2.43921645000.4463
2.44661650000.3764
2.45401655000.4515
2.46141660000.4342
2.46891665000.4163
2.47631670000.4306
2.48371675000.4131
2.49111680000.4657
2.49851685000.446
2.50591690000.4342
2.51331695000.4293
2.52081700000.4388
2.52821705000.4935
2.53561710000.4124
2.54301715000.4519
2.55041720000.4886
2.55781725000.4552
2.56521730000.4628
2.57271735000.4277
2.58011740000.4048
2.58751745000.434
2.59491750000.43
2.60231755000.4637
2.60971760000.4151
2.61711765000.4334
2.62461770000.4592
2.63201775000.4548
2.63941780000.4622
2.64681785000.3954
2.65421790000.417
2.66161795000.4429
2.66901800000.4639
2.67651805000.3764
2.68391810000.4809
2.69131815000.4518
2.69871820000.4526
2.70611825000.464
2.71351830000.4487
2.72091835000.4213
2.72841840000.3954
2.73581845000.4081
2.74321850000.4707
2.75061855000.4218
2.75801860000.4552
2.76541865000.4371
2.77281870000.4286
2.78021875000.4626
2.78771880000.4075
2.79511885000.4263
2.80251890000.4215
2.80991895000.428
2.81731900000.4919
2.82471905000.459
2.83211910000.4122
2.83961915000.4404
2.84701920000.4358
2.85441925000.472
2.86181930000.4541
2.86921935000.4378
2.87661940000.4281
2.88401945000.4745
2.89151950000.4642
2.89891955000.4637
2.90631960000.4311
2.91371965000.3999
2.92111970000.4125
2.92851975000.426
2.93591980000.4357
2.94341985000.4743
2.95081990000.4519
2.95821995000.4294
2.96562000000.4603
2.97302005000.4824
2.98042010000.4003
2.98782015000.4161
2.99532020000.4853

</details>

Framework Versions

  • —Python: 3.10.12
  • —Sentence Transformers: 3.1.0
  • —Transformers: 4.43.3
  • —PyTorch: 2.3.0+cu121
  • —Accelerate: 0.33.0
  • —Datasets: 3.2.0
  • —Tokenizers: 0.19.1

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",
}
CoSENTLoss
bibtex
@online{kexuefm-8847,
    title={CoSENT: A more efficient sentence vector scheme than Sentence-BERT},
    author={Su Jianlin},
    year={2022},
    month={Jan},
    url={https://kexue.fm/archives/8847},
}

<!--

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. -->