File size: 35,453 Bytes
572ea0d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
---

language:
- en
license: apache-2.0
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- dense
- generated_from_trainer
- dataset_size:90000
- loss:QuantizationAwareLoss
- loss:MultipleNegativesRankingLoss
base_model: microsoft/mpnet-base
widget:
- source_sentence: what is the difference between trojan virus and worm?
  sentences:
  - Worms spread from computer to computer, but unlike a virus, it has the capability
    to travel without any help from a person. ... A Trojan horse is not a virus. It
    is a destructive program that looks as a genuine application. Unlike viruses,
    Trojan horses do not replicate themselves but they can be just as destructive.
  - You're usually no longer infectious 24 hours after starting a course of antibiotics,
    but this time period can sometimes vary. For example, the antibiotics may take
    longer to work if your body takes longer to absorb them, or if you're taking other
    medicine that interacts with the antibiotics.
  - Eating salt raises the amount of sodium in your bloodstream and wrecks the delicate
    balance, reducing the ability of your kidneys to remove the water. The result
    is a higher blood pressure due to the extra fluid and extra strain on the delicate
    blood vessels leading to the kidneys.
- source_sentence: which are the neighbouring countries of pakistan?
  sentences:
  - Pakistan is bordered by India on the east, the Arabian Sea on the south, Iran
    on the southwest, and Afghanistan on the west and north; in the northeast is the
    disputed territory (with India) of Kashmir, of which the part occupied by Pakistan
    borders on China.
  - Age is a big factor when it comes to how much sleep a dog needs. Just as human
    babies need a lot of sleep, the AKC notes your puppy needs 15-20 hours of sleep
    a day to help his central nervous system, immune system and muscles develop properly.
  - 'Step 1: Connect your iPhone to your computer using n USB cable through any of

    the USB ports available on your computer. Step 2: Open iTunes, click the "Files"

    tab and check the boxes to sync or transfer your files. Step 3: Select your desired

    destination folder for the files and click "Sync" to complete the transfer.'
- source_sentence: what can you do with 1gb of data?
  sentences:
  - You could even contact your email provider, complain that somebody else is using
    your email address, and say that you are worried about your account being compromised.
    They're very unlikely to do anything, but if something goes wrong, at least you
    can prove you forewarned them.
  - 1) Under Section 80CCD(1), investment in Atal Pension Yojana or NPS up to  1.5
    lakh qualifies for income tax deduction. But remember that the total amount of
    deduction under sections 80C, 80CCC and 80CCD cannot exceed  1.5 lakh.
  - 1GB (or 1024MB) of data lets you send or receive about 1,000 emails and browse
    the Internet for about 20 hours every month. (This limit relates only to your
    1GB mobile data allocation; if you are an 'inclusive mobile broadband customer'
    you also get 2000 BT Wi-fi wi-fi minutes every month.)
- source_sentence: how many carbon atoms are in carbon dioxide?
  sentences:
  - For CO2 there is one atom of carbon and two atoms of oxygen. For H2O, there is
    one atom of oxygen and two atoms of hydrogen. A molecule can be made of only one
    type of atom.
  - Avian influenza refers to the disease caused by infection with avian (bird) influenza
    (flu) Type A viruses. These viruses occur naturally among wild aquatic birds worldwide
    and can infect domestic poultry and other bird and animal species. Avian flu viruses
    do not normally infect humans.
  - At the end of "Inception," Dom Cobb (Leonardo DiCaprio) finally returns home to
    his kids after spending a long time in the dream world. Cobb carries a little
    top with him. If the top keeps spinning, that means he is in a dream. ... The
    final shot shows the top spinning, but it never reveals whether it falls over.
- source_sentence: is duchenne muscular dystrophy a dominant or recessive trait?
  sentences:
  - Duchenne muscular dystrophy is inherited in an X-linked recessive pattern. Males
    have only one copy of the X chromosome from their mother and one copy of the Y
    chromosome from their father. If their X chromosome has a DMD gene mutation, they
    will have Duchenne muscular dystrophy.
  - An automatic transmission will downshift for you when you drive uphill. However,
    for moderately steep slopes, it's wise to shift to the gear range marked D2, 2,
    or L to ascend and descend the hill. For steep slopes that you can't ascend at
    a speed faster than 10 mph (about 15 kph), shift to D1 or 1.
  - The dream suggests captivity and it refers to your fear of punishment. Another
    interpretation of this dream refers to a need to do what you feel is right in
    waking life. Being in jail suggests that your feelings may be trapped by a limited
    mind and body. ... Jail also suggests repressed feelings.
datasets:
- sentence-transformers/gooaq
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- cosine_accuracy@1
- cosine_accuracy@3
- cosine_accuracy@5
- cosine_accuracy@10
- cosine_precision@1
- cosine_precision@3
- cosine_precision@5
- cosine_precision@10
- cosine_recall@1
- cosine_recall@3
- cosine_recall@5
- cosine_recall@10
- cosine_ndcg@10
- cosine_mrr@10
- cosine_map@100
co2_eq_emissions:
  emissions: 24.236900898755138
  energy_consumed: 0.0905639330800724
  source: codecarbon
  training_type: fine-tuning
  on_cloud: false
  cpu_model: 13th Gen Intel(R) Core(TM) i7-13700K
  ram_total_size: 31.777088165283203
  hours_used: 0.293
  hardware_used: 1 x NVIDIA GeForce RTX 3090
model-index:
- name: MPNet base trained on GooAQ using QAT with InfoNCE + GOR
  results:
  - task:
      type: information-retrieval
      name: Information Retrieval
    dataset:
      name: gooaq dev float32
      type: gooaq-dev-float32
    metrics:
    - type: cosine_accuracy@1
      value: 0.7419
      name: Cosine Accuracy@1
    - type: cosine_accuracy@3
      value: 0.8825
      name: Cosine Accuracy@3
    - type: cosine_accuracy@5
      value: 0.9237
      name: Cosine Accuracy@5
    - type: cosine_accuracy@10
      value: 0.96
      name: Cosine Accuracy@10
    - type: cosine_precision@1
      value: 0.7419
      name: Cosine Precision@1
    - type: cosine_precision@3
      value: 0.29416666666666663
      name: Cosine Precision@3
    - type: cosine_precision@5
      value: 0.18474000000000002
      name: Cosine Precision@5
    - type: cosine_precision@10
      value: 0.09600000000000002
      name: Cosine Precision@10
    - type: cosine_recall@1
      value: 0.7419
      name: Cosine Recall@1
    - type: cosine_recall@3
      value: 0.8825
      name: Cosine Recall@3
    - type: cosine_recall@5
      value: 0.9237
      name: Cosine Recall@5
    - type: cosine_recall@10
      value: 0.96
      name: Cosine Recall@10
    - type: cosine_ndcg@10
      value: 0.8536715392203515
      name: Cosine Ndcg@10
    - type: cosine_mrr@10
      value: 0.8192423412698366
      name: Cosine Mrr@10
    - type: cosine_map@100
      value: 0.8211527599211433
      name: Cosine Map@100
  - task:
      type: information-retrieval
      name: Information Retrieval
    dataset:
      name: gooaq dev int8
      type: gooaq-dev-int8
    metrics:
    - type: cosine_accuracy@1
      value: 0.7336
      name: Cosine Accuracy@1
    - type: cosine_accuracy@3
      value: 0.8753
      name: Cosine Accuracy@3
    - type: cosine_accuracy@5
      value: 0.919
      name: Cosine Accuracy@5
    - type: cosine_accuracy@10
      value: 0.9569
      name: Cosine Accuracy@10
    - type: cosine_precision@1
      value: 0.7336
      name: Cosine Precision@1
    - type: cosine_precision@3
      value: 0.2917666666666666
      name: Cosine Precision@3
    - type: cosine_precision@5
      value: 0.18380000000000002
      name: Cosine Precision@5
    - type: cosine_precision@10
      value: 0.09569000000000001
      name: Cosine Precision@10
    - type: cosine_recall@1
      value: 0.7336
      name: Cosine Recall@1
    - type: cosine_recall@3
      value: 0.8753
      name: Cosine Recall@3
    - type: cosine_recall@5
      value: 0.919
      name: Cosine Recall@5
    - type: cosine_recall@10
      value: 0.9569
      name: Cosine Recall@10
    - type: cosine_ndcg@10
      value: 0.8480672791448349
      name: Cosine Ndcg@10
    - type: cosine_mrr@10
      value: 0.8128262301587247
      name: Cosine Mrr@10
    - type: cosine_map@100
      value: 0.8148631237973415
      name: Cosine Map@100
  - task:
      type: information-retrieval
      name: Information Retrieval
    dataset:
      name: gooaq dev binary
      type: gooaq-dev-binary
    metrics:
    - type: cosine_accuracy@1
      value: 0.7171
      name: Cosine Accuracy@1
    - type: cosine_accuracy@3
      value: 0.8612
      name: Cosine Accuracy@3
    - type: cosine_accuracy@5
      value: 0.907
      name: Cosine Accuracy@5
    - type: cosine_accuracy@10
      value: 0.9488
      name: Cosine Accuracy@10
    - type: cosine_precision@1
      value: 0.7171
      name: Cosine Precision@1
    - type: cosine_precision@3
      value: 0.28706666666666664
      name: Cosine Precision@3
    - type: cosine_precision@5
      value: 0.18140000000000003
      name: Cosine Precision@5
    - type: cosine_precision@10
      value: 0.09488000000000002
      name: Cosine Precision@10
    - type: cosine_recall@1
      value: 0.7171
      name: Cosine Recall@1
    - type: cosine_recall@3
      value: 0.8612
      name: Cosine Recall@3
    - type: cosine_recall@5
      value: 0.907
      name: Cosine Recall@5
    - type: cosine_recall@10
      value: 0.9488
      name: Cosine Recall@10
    - type: cosine_ndcg@10
      value: 0.8346138412124019
      name: Cosine Ndcg@10
    - type: cosine_mrr@10
      value: 0.7977967063492009
      name: Cosine Mrr@10
    - type: cosine_map@100
      value: 0.8001907977756205
      name: Cosine Map@100
---


# MPNet base trained on GooAQ using QAT with InfoNCE + GOR

This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [microsoft/mpnet-base](https://huggingface.co/microsoft/mpnet-base) on the [gooaq](https://huggingface.co/datasets/sentence-transformers/gooaq) dataset. It maps sentences & paragraphs to a 768-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:** [microsoft/mpnet-base](https://huggingface.co/microsoft/mpnet-base) <!-- at revision 6996ce1e91bd2a9c7d7f61daec37463394f73f09 -->
- **Maximum Sequence Length:** 512 tokens
- **Output Dimensionality:** 768 dimensions
- **Similarity Function:** Cosine Similarity
- **Training Dataset:**
    - [gooaq](https://huggingface.co/datasets/sentence-transformers/gooaq)
- **Language:** en
- **License:** apache-2.0

### Model Sources

- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)

### Full Model Architecture

```

SentenceTransformer(

  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'MPNetModel'})

  (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})

)

```

## 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("tomaarsen/mpnet-base-gooaq-qat")

# Run inference

queries = [

    "is duchenne muscular dystrophy a dominant or recessive trait?",

]

documents = [

    'Duchenne muscular dystrophy is inherited in an X-linked recessive pattern. Males have only one copy of the X chromosome from their mother and one copy of the Y chromosome from their father. If their X chromosome has a DMD gene mutation, they will have Duchenne muscular dystrophy.',

    'The dream suggests captivity and it refers to your fear of punishment. Another interpretation of this dream refers to a need to do what you feel is right in waking life. Being in jail suggests that your feelings may be trapped by a limited mind and body. ... Jail also suggests repressed feelings.',

    "An automatic transmission will downshift for you when you drive uphill. However, for moderately steep slopes, it's wise to shift to the gear range marked D2, 2, or L to ascend and descend the hill. For steep slopes that you can't ascend at a speed faster than 10 mph (about 15 kph), shift to D1 or 1.",

]

query_embeddings = model.encode_query(queries)

document_embeddings = model.encode_document(documents)

print(query_embeddings.shape, document_embeddings.shape)

# [1, 768] [3, 768]



# Get the similarity scores for the embeddings

similarities = model.similarity(query_embeddings, document_embeddings)

print(similarities)

# tensor([[0.8103, 0.1611, 0.2026]])

```

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

#### Information Retrieval

* Datasets: `gooaq-dev-float32`, `gooaq-dev-int8` and `gooaq-dev-binary`
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)

| Metric              | gooaq-dev-float32 | gooaq-dev-int8 | gooaq-dev-binary |
|:--------------------|:------------------|:---------------|:-----------------|
| cosine_accuracy@1   | 0.7419            | 0.7336         | 0.7171           |

| cosine_accuracy@3   | 0.8825            | 0.8753         | 0.8612           |
| cosine_accuracy@5   | 0.9237            | 0.919          | 0.907            |

| cosine_accuracy@10  | 0.96              | 0.9569         | 0.9488           |
| cosine_precision@1  | 0.7419            | 0.7336         | 0.7171           |

| cosine_precision@3  | 0.2942            | 0.2918         | 0.2871           |
| cosine_precision@5  | 0.1847            | 0.1838         | 0.1814           |

| cosine_precision@10 | 0.096             | 0.0957         | 0.0949           |
| cosine_recall@1     | 0.7419            | 0.7336         | 0.7171           |

| cosine_recall@3     | 0.8825            | 0.8753         | 0.8612           |
| cosine_recall@5     | 0.9237            | 0.919          | 0.907            |

| cosine_recall@10    | 0.96              | 0.9569         | 0.9488           |
| **cosine_ndcg@10**  | **0.8537**        | **0.8481**     | **0.8346**       |

| cosine_mrr@10       | 0.8192            | 0.8128         | 0.7978           |

| cosine_map@100      | 0.8212            | 0.8149         | 0.8002           |



<!--

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



#### gooaq



* Dataset: [gooaq](https://huggingface.co/datasets/sentence-transformers/gooaq) at [b089f72](https://huggingface.co/datasets/sentence-transformers/gooaq/tree/b089f728748a068b7bc5234e5bcf5b25e3c8279c)

* Size: 90,000 training samples

* Columns: <code>question</code> and <code>answer</code>

* Approximate statistics based on the first 1000 samples:

  |         | question                                                                          | answer                                                                              |

  |:--------|:----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|

  | type    | string                                                                            | string                                                                              |

  | details | <ul><li>min: 8 tokens</li><li>mean: 11.83 tokens</li><li>max: 20 tokens</li></ul> | <ul><li>min: 15 tokens</li><li>mean: 60.45 tokens</li><li>max: 180 tokens</li></ul> |

* Samples:

  | question                                                            | answer                                                                                                                                                                                                                                                                                                                                       |

  |:--------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

  | <code>how long does halifax take to transfer mortgage funds?</code> | <code>Bear in mind that the speed of application will vary depending on your own personal circumstances and the lender's present day-to-day performance. In some cases, applications can be approved by the lender within 24 hours, while some can take weeks or even months.</code>                                                         |

  | <code>can you get a false pregnancy test?</code>                    | <code>In very rare cases, you can have a false-positive result. This means you're not pregnant but the test says you are. You could have a false-positive result if you have blood or protein in your pee. Certain drugs, such as tranquilizers, anticonvulsants, hypnotics, and fertility drugs, could cause false-positive results.</code> |

  | <code>are ahead of its time?</code>                                 | <code>Definition of ahead of one's/its time : too advanced or modern to be understood or appreciated during the time when one lives or works As a director, he was ahead of his time.</code>                                                                                                                                                 |

* Loss: [<code>QuantizationAwareLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#quantizationawareloss) with these parameters:

  ```json

  {

      "loss": "MultipleNegativesRankingLoss",

      "quantization_precisions": [

          "float32",

          "int8",

          "binary"

      ],

      "quantization_weights": [

          1.0,

          1.0,

          1.0

      ],

      "n_precisions_per_step": -1

  }

  ```



### Evaluation Dataset



#### gooaq



* Dataset: [gooaq](https://huggingface.co/datasets/sentence-transformers/gooaq) at [b089f72](https://huggingface.co/datasets/sentence-transformers/gooaq/tree/b089f728748a068b7bc5234e5bcf5b25e3c8279c)

* Size: 10,000 evaluation samples

* Columns: <code>question</code> and <code>answer</code>

* Approximate statistics based on the first 1000 samples:

  |         | question                                                                          | answer                                                                              |

  |:--------|:----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|

  | type    | string                                                                            | string                                                                              |

  | details | <ul><li>min: 8 tokens</li><li>mean: 11.93 tokens</li><li>max: 25 tokens</li></ul> | <ul><li>min: 14 tokens</li><li>mean: 60.84 tokens</li><li>max: 127 tokens</li></ul> |

* Samples:

  | question                                                         | answer                                                                                                                                                                                                                                                                                                                                                        |

  |:-----------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

  | <code>should you take ibuprofen with high blood pressure?</code> | <code>In general, people with high blood pressure should use acetaminophen or possibly aspirin for over-the-counter pain relief. Unless your health care provider has said it's OK, you should not use ibuprofen, ketoprofen, or naproxen sodium. If aspirin or acetaminophen doesn't help with your pain, call your doctor.</code>                           |

  | <code>how old do you have to be to work in sc?</code>            | <code>The general minimum age of employment for South Carolina youth is 14, although the state allows younger children who are performers to work in show business. If their families are agricultural workers, children younger than age 14 may also participate in farm labor.</code>                                                                       |

  | <code>how to write a topic proposal for a research paper?</code> | <code>['Write down the main topic of your paper. ... ', 'Write two or three short sentences under the main topic that explain why you chose that topic. ... ', 'Write a thesis sentence that states the angle and purpose of your research paper. ... ', 'List the items you will cover in the body of the paper that support your thesis statement.']</code> |

* Loss: [<code>QuantizationAwareLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#quantizationawareloss) with these parameters:

  ```json

  {

      "loss": "MultipleNegativesRankingLoss",

      "quantization_precisions": [

          "float32",

          "int8",

          "binary"

      ],

      "quantization_weights": [

          1.0,

          1.0,

          1.0

      ],

      "n_precisions_per_step": -1

  }

  ```



### Training Hyperparameters

#### Non-Default Hyperparameters



- `eval_strategy`: steps

- `per_device_train_batch_size`: 64

- `per_device_eval_batch_size`: 64

- `learning_rate`: 2e-05

- `num_train_epochs`: 1

- `warmup_ratio`: 0.1

- `bf16`: True

- `batch_sampler`: no_duplicates



#### All Hyperparameters

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



- `overwrite_output_dir`: False

- `do_predict`: False

- `eval_strategy`: steps

- `prediction_loss_only`: True

- `per_device_train_batch_size`: 64

- `per_device_eval_batch_size`: 64

- `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`: 2e-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`: 1

- `max_steps`: -1

- `lr_scheduler_type`: linear

- `lr_scheduler_kwargs`: None

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

- `bf16`: True

- `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`: {'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

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

- `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`: 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

- `prompts`: None

- `batch_sampler`: no_duplicates

- `multi_dataset_batch_sampler`: proportional

- `router_mapping`: {}

- `learning_rate_mapping`: {}



</details>



### Training Logs

| Epoch  | Step | Training Loss | Validation Loss | gooaq-dev-float32_cosine_ndcg@10 | gooaq-dev-int8_cosine_ndcg@10 | gooaq-dev-binary_cosine_ndcg@10 |

|:------:|:----:|:-------------:|:---------------:|:--------------------------------:|:-----------------------------:|:-------------------------------:|

| -1     | -1   | -             | -               | 0.2155                           | 0.5116                        | 0.3432                          |

| 0.0007 | 1    | 8.8919        | -               | -                                | -                             | -                               |

| 0.0505 | 71   | 4.6028        | -               | -                                | -                             | -                               |

| 0.1002 | 141  | -             | 0.3973          | 0.7842                           | 0.7799                        | 0.7606                          |

| 0.1009 | 142  | 0.8168        | -               | -                                | -                             | -                               |

| 0.1514 | 213  | 0.4967        | -               | -                                | -                             | -                               |

| 0.2004 | 282  | -             | 0.2611          | 0.8125                           | 0.8082                        | 0.7879                          |

| 0.2018 | 284  | 0.4427        | -               | -                                | -                             | -                               |

| 0.2523 | 355  | 0.4156        | -               | -                                | -                             | -                               |

| 0.3006 | 423  | -             | 0.2213          | 0.8282                           | 0.8230                        | 0.8047                          |

| 0.3028 | 426  | 0.3245        | -               | -                                | -                             | -                               |

| 0.3532 | 497  | 0.3354        | -               | -                                | -                             | -                               |

| 0.4009 | 564  | -             | 0.2026          | 0.8333                           | 0.8291                        | 0.8129                          |

| 0.4037 | 568  | 0.2926        | -               | -                                | -                             | -                               |

| 0.4542 | 639  | 0.317         | -               | -                                | -                             | -                               |

| 0.5011 | 705  | -             | 0.1854          | 0.8384                           | 0.8340                        | 0.8192                          |

| 0.5046 | 710  | 0.2779        | -               | -                                | -                             | -                               |

| 0.5551 | 781  | 0.278         | -               | -                                | -                             | -                               |

| 0.6013 | 846  | -             | 0.1768          | 0.8440                           | 0.8398                        | 0.8245                          |

| 0.6055 | 852  | 0.2696        | -               | -                                | -                             | -                               |

| 0.6560 | 923  | 0.2752        | -               | -                                | -                             | -                               |

| 0.7015 | 987  | -             | 0.1679          | 0.8504                           | 0.8449                        | 0.8287                          |

| 0.7065 | 994  | 0.2318        | -               | -                                | -                             | -                               |

| 0.7569 | 1065 | 0.2398        | -               | -                                | -                             | -                               |

| 0.8017 | 1128 | -             | 0.1621          | 0.8498                           | 0.8454                        | 0.8317                          |

| 0.8074 | 1136 | 0.2274        | -               | -                                | -                             | -                               |

| 0.8579 | 1207 | 0.2376        | -               | -                                | -                             | -                               |

| 0.9019 | 1269 | -             | 0.1572          | 0.8518                           | 0.8464                        | 0.8305                          |

| 0.9083 | 1278 | 0.238         | -               | -                                | -                             | -                               |

| 0.9588 | 1349 | 0.2168        | -               | -                                | -                             | -                               |

| -1     | -1   | -             | -               | 0.8537                           | 0.8481                        | 0.8346                          |





### Environmental Impact

Carbon emissions were measured using [CodeCarbon](https://github.com/mlco2/codecarbon).

- **Energy Consumed**: 0.091 kWh

- **Carbon Emitted**: 0.024 kg of CO2

- **Hours Used**: 0.293 hours



### Training Hardware

- **On Cloud**: No

- **GPU Model**: 1 x NVIDIA GeForce RTX 3090

- **CPU Model**: 13th Gen Intel(R) Core(TM) i7-13700K

- **RAM Size**: 31.78 GB



### Framework Versions

- Python: 3.11.6

- Sentence Transformers: 5.3.0.dev0

- Transformers: 4.57.6

- PyTorch: 2.10.0+cu126

- Accelerate: 1.12.0

- Datasets: 4.3.0

- Tokenizers: 0.22.2



## 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",

}

```



#### QuantizationAwareLoss

```bibtex

@article{jacob2018quantization,

    title={Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference},

    author={Jacob, Benoit and Kligys, Skirmantas and Chen, Bo and Zhu, Menglong and Tang, Matthew and Howard, Andrew and Adam, Hartwig and Kalenichenko, Dmitry},

    journal={arXiv preprint arXiv:1712.05877},

    year={2018}

}

```



#### MultipleNegativesRankingLoss

```bibtex

@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}

}

```



<!--

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

-->