tomaarsen HF Staff commited on
Commit
bf16aca
·
verified ·
1 Parent(s): 9ea81ca

Add new SparseEncoder model

Browse files
README.md ADDED
@@ -0,0 +1,884 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ tags:
6
+ - sentence-transformers
7
+ - sparse-encoder
8
+ - sparse
9
+ - asymmetric
10
+ - inference-free
11
+ - splade
12
+ - generated_from_trainer
13
+ - dataset_size:99000
14
+ - loss:SpladeLoss
15
+ - loss:SparseMultipleNegativesRankingLoss
16
+ - loss:FlopsLoss
17
+ widget:
18
+ - text: Rollin' (Limp Bizkit song) The music video was filmed atop the South Tower
19
+ of the former World Trade Center in New York City. The introduction features Ben
20
+ Stiller and Stephen Dorff mistaking Fred Durst for the valet and giving him the
21
+ keys to their Bentley Azure. Also making a cameo is break dancer Mr. Wiggles.
22
+ The rest of the video has several cuts to Durst and his bandmates hanging out
23
+ of the Bentley as they drive about Manhattan. The song Ben Stiller is playing
24
+ at the beginning is "My Generation" from the same album. The video also features
25
+ scenes of Fred Durst with five girls dancing in a room. The video was filmed around
26
+ the same time as the film Zoolander, which explains Stiller and Dorff's appearance.
27
+ Fred Durst has a small cameo in that film.
28
+ - text: 'Maze Runner: The Death Cure On April 22, 2017, the studio delayed the release
29
+ date once again, to February 9, 2018, in order to allow more time for post-production;
30
+ months later, on August 25, the studio moved the release forward two weeks.[17]
31
+ The film will premiere on January 26, 2018 in 3D, IMAX and IMAX 3D.[18][19]'
32
+ - text: who played the dj in the movie the warriors
33
+ - text: Lionel Messi Born and raised in central Argentina, Messi was diagnosed with
34
+ a growth hormone deficiency as a child. At age 13, he relocated to Spain to join
35
+ Barcelona, who agreed to pay for his medical treatment. After a fast progression
36
+ through Barcelona's youth academy, Messi made his competitive debut aged 17 in
37
+ October 2004. Despite being injury-prone during his early career, he established
38
+ himself as an integral player for the club within the next three years, finishing
39
+ 2007 as a finalist for both the Ballon d'Or and FIFA World Player of the Year
40
+ award, a feat he repeated the following year. His first uninterrupted campaign
41
+ came in the 2008–09 season, during which he helped Barcelona achieve the first
42
+ treble in Spanish football. At 22 years old, Messi won the Ballon d'Or and FIFA
43
+ World Player of the Year award by record voting margins.
44
+ - text: 'Send In the Clowns "Send In the Clowns" is a song written by Stephen Sondheim
45
+ for the 1973 musical A Little Night Music, an adaptation of Ingmar Bergman''s
46
+ film Smiles of a Summer Night. It is a ballad from Act Two, in which the character
47
+ Desirée reflects on the ironies and disappointments of her life. Among other things,
48
+ she looks back on an affair years earlier with the lawyer Fredrik, who was deeply
49
+ in love with her but whose marriage proposals she had rejected. Meeting him after
50
+ so long, she realizes she is in love with him and finally ready to marry him,
51
+ but now it is he who rejects her: he is in an unconsummated marriage with a much
52
+ younger woman. Desirée proposes marriage to rescue him from this situation, but
53
+ he declines, citing his dedication to his bride. Reacting to his rejection, Desirée
54
+ sings this song. The song is later reprised as a coda after Fredrik''s young wife
55
+ runs away with his son, and Fredrik is finally free to accept Desirée''s offer.[1]'
56
+ datasets:
57
+ - sentence-transformers/natural-questions
58
+ pipeline_tag: feature-extraction
59
+ library_name: sentence-transformers
60
+ metrics:
61
+ - dot_accuracy@1
62
+ - dot_accuracy@3
63
+ - dot_accuracy@5
64
+ - dot_accuracy@10
65
+ - dot_precision@1
66
+ - dot_precision@3
67
+ - dot_precision@5
68
+ - dot_precision@10
69
+ - dot_recall@1
70
+ - dot_recall@3
71
+ - dot_recall@5
72
+ - dot_recall@10
73
+ - dot_ndcg@10
74
+ - dot_mrr@10
75
+ - dot_map@100
76
+ - query_active_dims
77
+ - query_sparsity_ratio
78
+ - corpus_active_dims
79
+ - corpus_sparsity_ratio
80
+ co2_eq_emissions:
81
+ emissions: 12.160208585908531
82
+ energy_consumed: 0.03128414205717627
83
+ source: codecarbon
84
+ training_type: fine-tuning
85
+ on_cloud: false
86
+ cpu_model: 13th Gen Intel(R) Core(TM) i7-13700K
87
+ ram_total_size: 31.777088165283203
88
+ hours_used: 0.09
89
+ hardware_used: 1 x NVIDIA GeForce RTX 3090
90
+ model-index:
91
+ - name: Inference-free SPLADE BERT-tiny trained on Natural-Questions tuples
92
+ results:
93
+ - task:
94
+ type: sparse-information-retrieval
95
+ name: Sparse Information Retrieval
96
+ dataset:
97
+ name: NanoMSMARCO
98
+ type: NanoMSMARCO
99
+ metrics:
100
+ - type: dot_accuracy@1
101
+ value: 0.28
102
+ name: Dot Accuracy@1
103
+ - type: dot_accuracy@3
104
+ value: 0.48
105
+ name: Dot Accuracy@3
106
+ - type: dot_accuracy@5
107
+ value: 0.54
108
+ name: Dot Accuracy@5
109
+ - type: dot_accuracy@10
110
+ value: 0.68
111
+ name: Dot Accuracy@10
112
+ - type: dot_precision@1
113
+ value: 0.28
114
+ name: Dot Precision@1
115
+ - type: dot_precision@3
116
+ value: 0.15999999999999998
117
+ name: Dot Precision@3
118
+ - type: dot_precision@5
119
+ value: 0.10800000000000003
120
+ name: Dot Precision@5
121
+ - type: dot_precision@10
122
+ value: 0.068
123
+ name: Dot Precision@10
124
+ - type: dot_recall@1
125
+ value: 0.28
126
+ name: Dot Recall@1
127
+ - type: dot_recall@3
128
+ value: 0.48
129
+ name: Dot Recall@3
130
+ - type: dot_recall@5
131
+ value: 0.54
132
+ name: Dot Recall@5
133
+ - type: dot_recall@10
134
+ value: 0.68
135
+ name: Dot Recall@10
136
+ - type: dot_ndcg@10
137
+ value: 0.4712098455669033
138
+ name: Dot Ndcg@10
139
+ - type: dot_mrr@10
140
+ value: 0.4061269841269841
141
+ name: Dot Mrr@10
142
+ - type: dot_map@100
143
+ value: 0.42123222050853626
144
+ name: Dot Map@100
145
+ - type: query_active_dims
146
+ value: 7.360000133514404
147
+ name: Query Active Dims
148
+ - type: query_sparsity_ratio
149
+ value: 0.9997588624554906
150
+ name: Query Sparsity Ratio
151
+ - type: corpus_active_dims
152
+ value: 181.48126220703125
153
+ name: Corpus Active Dims
154
+ - type: corpus_sparsity_ratio
155
+ value: 0.9940540835395113
156
+ name: Corpus Sparsity Ratio
157
+ - task:
158
+ type: sparse-information-retrieval
159
+ name: Sparse Information Retrieval
160
+ dataset:
161
+ name: NanoNFCorpus
162
+ type: NanoNFCorpus
163
+ metrics:
164
+ - type: dot_accuracy@1
165
+ value: 0.46
166
+ name: Dot Accuracy@1
167
+ - type: dot_accuracy@3
168
+ value: 0.6
169
+ name: Dot Accuracy@3
170
+ - type: dot_accuracy@5
171
+ value: 0.64
172
+ name: Dot Accuracy@5
173
+ - type: dot_accuracy@10
174
+ value: 0.7
175
+ name: Dot Accuracy@10
176
+ - type: dot_precision@1
177
+ value: 0.46
178
+ name: Dot Precision@1
179
+ - type: dot_precision@3
180
+ value: 0.38666666666666666
181
+ name: Dot Precision@3
182
+ - type: dot_precision@5
183
+ value: 0.34
184
+ name: Dot Precision@5
185
+ - type: dot_precision@10
186
+ value: 0.264
187
+ name: Dot Precision@10
188
+ - type: dot_recall@1
189
+ value: 0.04441960931285628
190
+ name: Dot Recall@1
191
+ - type: dot_recall@3
192
+ value: 0.07855216438081768
193
+ name: Dot Recall@3
194
+ - type: dot_recall@5
195
+ value: 0.11501385338572513
196
+ name: Dot Recall@5
197
+ - type: dot_recall@10
198
+ value: 0.13799680508768822
199
+ name: Dot Recall@10
200
+ - type: dot_ndcg@10
201
+ value: 0.3363725092471443
202
+ name: Dot Ndcg@10
203
+ - type: dot_mrr@10
204
+ value: 0.5348571428571429
205
+ name: Dot Mrr@10
206
+ - type: dot_map@100
207
+ value: 0.14273057100379044
208
+ name: Dot Map@100
209
+ - type: query_active_dims
210
+ value: 5.739999771118164
211
+ name: Query Active Dims
212
+ - type: query_sparsity_ratio
213
+ value: 0.9998119389367958
214
+ name: Query Sparsity Ratio
215
+ - type: corpus_active_dims
216
+ value: 267.9966125488281
217
+ name: Corpus Active Dims
218
+ - type: corpus_sparsity_ratio
219
+ value: 0.9912195592507428
220
+ name: Corpus Sparsity Ratio
221
+ - task:
222
+ type: sparse-information-retrieval
223
+ name: Sparse Information Retrieval
224
+ dataset:
225
+ name: NanoNQ
226
+ type: NanoNQ
227
+ metrics:
228
+ - type: dot_accuracy@1
229
+ value: 0.3
230
+ name: Dot Accuracy@1
231
+ - type: dot_accuracy@3
232
+ value: 0.56
233
+ name: Dot Accuracy@3
234
+ - type: dot_accuracy@5
235
+ value: 0.7
236
+ name: Dot Accuracy@5
237
+ - type: dot_accuracy@10
238
+ value: 0.7
239
+ name: Dot Accuracy@10
240
+ - type: dot_precision@1
241
+ value: 0.3
242
+ name: Dot Precision@1
243
+ - type: dot_precision@3
244
+ value: 0.18666666666666665
245
+ name: Dot Precision@3
246
+ - type: dot_precision@5
247
+ value: 0.14
248
+ name: Dot Precision@5
249
+ - type: dot_precision@10
250
+ value: 0.07200000000000001
251
+ name: Dot Precision@10
252
+ - type: dot_recall@1
253
+ value: 0.3
254
+ name: Dot Recall@1
255
+ - type: dot_recall@3
256
+ value: 0.54
257
+ name: Dot Recall@3
258
+ - type: dot_recall@5
259
+ value: 0.66
260
+ name: Dot Recall@5
261
+ - type: dot_recall@10
262
+ value: 0.67
263
+ name: Dot Recall@10
264
+ - type: dot_ndcg@10
265
+ value: 0.498972350043216
266
+ name: Dot Ndcg@10
267
+ - type: dot_mrr@10
268
+ value: 0.4476666666666666
269
+ name: Dot Mrr@10
270
+ - type: dot_map@100
271
+ value: 0.44805918373861153
272
+ name: Dot Map@100
273
+ - type: query_active_dims
274
+ value: 10.420000076293945
275
+ name: Query Active Dims
276
+ - type: query_sparsity_ratio
277
+ value: 0.999658606903994
278
+ name: Query Sparsity Ratio
279
+ - type: corpus_active_dims
280
+ value: 156.2409210205078
281
+ name: Corpus Active Dims
282
+ - type: corpus_sparsity_ratio
283
+ value: 0.9948810392169416
284
+ name: Corpus Sparsity Ratio
285
+ - task:
286
+ type: sparse-nano-beir
287
+ name: Sparse Nano BEIR
288
+ dataset:
289
+ name: NanoBEIR mean
290
+ type: NanoBEIR_mean
291
+ metrics:
292
+ - type: dot_accuracy@1
293
+ value: 0.3466666666666667
294
+ name: Dot Accuracy@1
295
+ - type: dot_accuracy@3
296
+ value: 0.5466666666666667
297
+ name: Dot Accuracy@3
298
+ - type: dot_accuracy@5
299
+ value: 0.6266666666666667
300
+ name: Dot Accuracy@5
301
+ - type: dot_accuracy@10
302
+ value: 0.6933333333333334
303
+ name: Dot Accuracy@10
304
+ - type: dot_precision@1
305
+ value: 0.3466666666666667
306
+ name: Dot Precision@1
307
+ - type: dot_precision@3
308
+ value: 0.24444444444444444
309
+ name: Dot Precision@3
310
+ - type: dot_precision@5
311
+ value: 0.19600000000000004
312
+ name: Dot Precision@5
313
+ - type: dot_precision@10
314
+ value: 0.13466666666666668
315
+ name: Dot Precision@10
316
+ - type: dot_recall@1
317
+ value: 0.20813986977095209
318
+ name: Dot Recall@1
319
+ - type: dot_recall@3
320
+ value: 0.3661840547936059
321
+ name: Dot Recall@3
322
+ - type: dot_recall@5
323
+ value: 0.43833795112857504
324
+ name: Dot Recall@5
325
+ - type: dot_recall@10
326
+ value: 0.4959989350292295
327
+ name: Dot Recall@10
328
+ - type: dot_ndcg@10
329
+ value: 0.4355182349524212
330
+ name: Dot Ndcg@10
331
+ - type: dot_mrr@10
332
+ value: 0.4628835978835979
333
+ name: Dot Mrr@10
334
+ - type: dot_map@100
335
+ value: 0.33734065841697936
336
+ name: Dot Map@100
337
+ - type: query_active_dims
338
+ value: 7.839999993642171
339
+ name: Query Active Dims
340
+ - type: query_sparsity_ratio
341
+ value: 0.9997431360987601
342
+ name: Query Sparsity Ratio
343
+ - type: corpus_active_dims
344
+ value: 191.33428282595386
345
+ name: Corpus Active Dims
346
+ - type: corpus_sparsity_ratio
347
+ value: 0.9937312665347632
348
+ name: Corpus Sparsity Ratio
349
+ ---
350
+
351
+ # Inference-free SPLADE BERT-tiny trained on Natural-Questions tuples
352
+
353
+ This is a [Asymmetric Inference-free SPLADE Sparse Encoder](https://www.sbert.net/docs/sparse_encoder/usage/usage.html) model trained on the [natural-questions](https://huggingface.co/datasets/sentence-transformers/natural-questions) dataset using the [sentence-transformers](https://www.SBERT.net) library. It maps sentences & paragraphs to a 30522-dimensional sparse vector space and can be used for semantic search and sparse retrieval.
354
+ ## Model Details
355
+
356
+ ### Model Description
357
+ - **Model Type:** Asymmetric Inference-free SPLADE Sparse Encoder
358
+ <!-- - **Base model:** [Unknown](https://huggingface.co/unknown) -->
359
+ - **Maximum Sequence Length:** 512 tokens
360
+ - **Output Dimensionality:** 30522 dimensions
361
+ - **Similarity Function:** Dot Product
362
+ - **Training Dataset:**
363
+ - [natural-questions](https://huggingface.co/datasets/sentence-transformers/natural-questions)
364
+ - **Language:** en
365
+ - **License:** apache-2.0
366
+
367
+ ### Model Sources
368
+
369
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
370
+ - **Documentation:** [Sparse Encoder Documentation](https://www.sbert.net/docs/sparse_encoder/usage/usage.html)
371
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
372
+ - **Hugging Face:** [Sparse Encoders on Hugging Face](https://huggingface.co/models?library=sentence-transformers&other=sparse-encoder)
373
+
374
+ ### Full Model Architecture
375
+
376
+ ```
377
+ SparseEncoder(
378
+ (0): Router(
379
+ (query_0_IDF): IDF ({'frozen': False}, dim:30522, tokenizer: BertTokenizerFast)
380
+ (document_0_MLMTransformer): MLMTransformer({'max_seq_length': 512, 'do_lower_case': False}) with MLMTransformer model: BertForMaskedLM
381
+ (document_1_SpladePooling): SpladePooling({'pooling_strategy': 'max', 'activation_function': 'relu', 'word_embedding_dimension': 30522})
382
+ )
383
+ )
384
+ ```
385
+
386
+ ## Usage
387
+
388
+ ### Direct Usage (Sentence Transformers)
389
+
390
+ First install the Sentence Transformers library:
391
+
392
+ ```bash
393
+ pip install -U sentence-transformers
394
+ ```
395
+
396
+ Then you can load this model and run inference.
397
+ ```python
398
+ from sentence_transformers import SparseEncoder
399
+
400
+ # Download from the 🤗 Hub
401
+ model = SparseEncoder("tomaarsen/inference-free-splade-bert-tiny-nq-fresh-3e-2-lambda-corpus-1e-3-idf-lr-2e-5-lr")
402
+ # Run inference
403
+ sentences = [
404
+ 'is send in the clowns from a musical',
405
+ 'Send In the Clowns "Send In the Clowns" is a song written by Stephen Sondheim for the 1973 musical A Little Night Music, an adaptation of Ingmar Bergman\'s film Smiles of a Summer Night. It is a ballad from Act Two, in which the character Desirée reflects on the ironies and disappointments of her life. Among other things, she looks back on an affair years earlier with the lawyer Fredrik, who was deeply in love with her but whose marriage proposals she had rejected. Meeting him after so long, she realizes she is in love with him and finally ready to marry him, but now it is he who rejects her: he is in an unconsummated marriage with a much younger woman. Desirée proposes marriage to rescue him from this situation, but he declines, citing his dedication to his bride. Reacting to his rejection, Desirée sings this song. The song is later reprised as a coda after Fredrik\'s young wife runs away with his son, and Fredrik is finally free to accept Desirée\'s offer.[1]',
406
+ 'The Suite Life on Deck The Suite Life on Deck is an American sitcom that aired on Disney Channel from September 26, 2008 to May 6, 2011. It is a sequel/spin-off of the Disney Channel Original Series The Suite Life of Zack & Cody. The series follows twin brothers Zack and Cody Martin and hotel heiress London Tipton in a new setting, the SS Tipton, where they attend classes at "Seven Seas High School" and meet Bailey Pickett while Mr. Moseby manages the ship. The ship travels around the world to nations such as Italy, France, Greece, India, Sweden and the United Kingdom where the characters experience different cultures, adventures, and situations.[1]',
407
+ ]
408
+ embeddings = model.encode(sentences)
409
+ print(embeddings.shape)
410
+ # (3, 30522)
411
+
412
+ # Get the similarity scores for the embeddings
413
+ similarities = model.similarity(embeddings, embeddings)
414
+ print(similarities.shape)
415
+ # [3, 3]
416
+ ```
417
+
418
+ <!--
419
+ ### Direct Usage (Transformers)
420
+
421
+ <details><summary>Click to see the direct usage in Transformers</summary>
422
+
423
+ </details>
424
+ -->
425
+
426
+ <!--
427
+ ### Downstream Usage (Sentence Transformers)
428
+
429
+ You can finetune this model on your own dataset.
430
+
431
+ <details><summary>Click to expand</summary>
432
+
433
+ </details>
434
+ -->
435
+
436
+ <!--
437
+ ### Out-of-Scope Use
438
+
439
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
440
+ -->
441
+
442
+ ## Evaluation
443
+
444
+ ### Metrics
445
+
446
+ #### Sparse Information Retrieval
447
+
448
+ * Datasets: `NanoMSMARCO`, `NanoNFCorpus` and `NanoNQ`
449
+ * Evaluated with [<code>SparseInformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sparse_encoder/evaluation.html#sentence_transformers.sparse_encoder.evaluation.SparseInformationRetrievalEvaluator)
450
+
451
+ | Metric | NanoMSMARCO | NanoNFCorpus | NanoNQ |
452
+ |:----------------------|:------------|:-------------|:----------|
453
+ | dot_accuracy@1 | 0.28 | 0.46 | 0.3 |
454
+ | dot_accuracy@3 | 0.48 | 0.6 | 0.56 |
455
+ | dot_accuracy@5 | 0.54 | 0.64 | 0.7 |
456
+ | dot_accuracy@10 | 0.68 | 0.7 | 0.7 |
457
+ | dot_precision@1 | 0.28 | 0.46 | 0.3 |
458
+ | dot_precision@3 | 0.16 | 0.3867 | 0.1867 |
459
+ | dot_precision@5 | 0.108 | 0.34 | 0.14 |
460
+ | dot_precision@10 | 0.068 | 0.264 | 0.072 |
461
+ | dot_recall@1 | 0.28 | 0.0444 | 0.3 |
462
+ | dot_recall@3 | 0.48 | 0.0786 | 0.54 |
463
+ | dot_recall@5 | 0.54 | 0.115 | 0.66 |
464
+ | dot_recall@10 | 0.68 | 0.138 | 0.67 |
465
+ | **dot_ndcg@10** | **0.4712** | **0.3364** | **0.499** |
466
+ | dot_mrr@10 | 0.4061 | 0.5349 | 0.4477 |
467
+ | dot_map@100 | 0.4212 | 0.1427 | 0.4481 |
468
+ | query_active_dims | 7.36 | 5.74 | 10.42 |
469
+ | query_sparsity_ratio | 0.9998 | 0.9998 | 0.9997 |
470
+ | corpus_active_dims | 181.4813 | 267.9966 | 156.2409 |
471
+ | corpus_sparsity_ratio | 0.9941 | 0.9912 | 0.9949 |
472
+
473
+ #### Sparse Nano BEIR
474
+
475
+ * Dataset: `NanoBEIR_mean`
476
+ * Evaluated with [<code>SparseNanoBEIREvaluator</code>](https://sbert.net/docs/package_reference/sparse_encoder/evaluation.html#sentence_transformers.sparse_encoder.evaluation.SparseNanoBEIREvaluator) with these parameters:
477
+ ```json
478
+ {
479
+ "dataset_names": [
480
+ "msmarco",
481
+ "nfcorpus",
482
+ "nq"
483
+ ]
484
+ }
485
+ ```
486
+
487
+ | Metric | Value |
488
+ |:----------------------|:-----------|
489
+ | dot_accuracy@1 | 0.3467 |
490
+ | dot_accuracy@3 | 0.5467 |
491
+ | dot_accuracy@5 | 0.6267 |
492
+ | dot_accuracy@10 | 0.6933 |
493
+ | dot_precision@1 | 0.3467 |
494
+ | dot_precision@3 | 0.2444 |
495
+ | dot_precision@5 | 0.196 |
496
+ | dot_precision@10 | 0.1347 |
497
+ | dot_recall@1 | 0.2081 |
498
+ | dot_recall@3 | 0.3662 |
499
+ | dot_recall@5 | 0.4383 |
500
+ | dot_recall@10 | 0.496 |
501
+ | **dot_ndcg@10** | **0.4355** |
502
+ | dot_mrr@10 | 0.4629 |
503
+ | dot_map@100 | 0.3373 |
504
+ | query_active_dims | 7.84 |
505
+ | query_sparsity_ratio | 0.9997 |
506
+ | corpus_active_dims | 191.3343 |
507
+ | corpus_sparsity_ratio | 0.9937 |
508
+
509
+ <!--
510
+ ## Bias, Risks and Limitations
511
+
512
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
513
+ -->
514
+
515
+ <!--
516
+ ### Recommendations
517
+
518
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
519
+ -->
520
+
521
+ ## Training Details
522
+
523
+ ### Training Dataset
524
+
525
+ #### natural-questions
526
+
527
+ * Dataset: [natural-questions](https://huggingface.co/datasets/sentence-transformers/natural-questions) at [f9e894e](https://huggingface.co/datasets/sentence-transformers/natural-questions/tree/f9e894e1081e206e577b4eaa9ee6de2b06ae6f17)
528
+ * Size: 99,000 training samples
529
+ * Columns: <code>query</code> and <code>answer</code>
530
+ * Approximate statistics based on the first 1000 samples:
531
+ | | query | answer |
532
+ |:--------|:-----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|
533
+ | type | string | string |
534
+ | details | <ul><li>min: 10 tokens</li><li>mean: 11.71 tokens</li><li>max: 26 tokens</li></ul> | <ul><li>min: 4 tokens</li><li>mean: 131.81 tokens</li><li>max: 450 tokens</li></ul> |
535
+ * Samples:
536
+ | query | answer |
537
+ |:--------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
538
+ | <code>who played the father in papa don't preach</code> | <code>Alex McArthur Alex McArthur (born March 6, 1957) is an American actor.</code> |
539
+ | <code>where was the location of the battle of hastings</code> | <code>Battle of Hastings The Battle of Hastings[a] was fought on 14 October 1066 between the Norman-French army of William, the Duke of Normandy, and an English army under the Anglo-Saxon King Harold Godwinson, beginning the Norman conquest of England. It took place approximately 7 miles (11 kilometres) northwest of Hastings, close to the present-day town of Battle, East Sussex, and was a decisive Norman victory.</code> |
540
+ | <code>how many puppies can a dog give birth to</code> | <code>Canine reproduction The largest litter size to date was set by a Neapolitan Mastiff in Manea, Cambridgeshire, UK on November 29, 2004; the litter was 24 puppies.[22]</code> |
541
+ * Loss: [<code>SpladeLoss</code>](https://sbert.net/docs/package_reference/sparse_encoder/losses.html#spladeloss) with these parameters:
542
+ ```json
543
+ {
544
+ "loss": "SparseMultipleNegativesRankingLoss(scale=1.0, similarity_fct='dot_score')",
545
+ "lambda_corpus": 0.03,
546
+ "lambda_query": 0
547
+ }
548
+ ```
549
+
550
+ ### Evaluation Dataset
551
+
552
+ #### natural-questions
553
+
554
+ * Dataset: [natural-questions](https://huggingface.co/datasets/sentence-transformers/natural-questions) at [f9e894e](https://huggingface.co/datasets/sentence-transformers/natural-questions/tree/f9e894e1081e206e577b4eaa9ee6de2b06ae6f17)
555
+ * Size: 1,000 evaluation samples
556
+ * Columns: <code>query</code> and <code>answer</code>
557
+ * Approximate statistics based on the first 1000 samples:
558
+ | | query | answer |
559
+ |:--------|:-----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|
560
+ | type | string | string |
561
+ | details | <ul><li>min: 10 tokens</li><li>mean: 11.69 tokens</li><li>max: 23 tokens</li></ul> | <ul><li>min: 15 tokens</li><li>mean: 134.01 tokens</li><li>max: 512 tokens</li></ul> |
562
+ * Samples:
563
+ | query | answer |
564
+ |:-------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
565
+ | <code>where is the tiber river located in italy</code> | <code>Tiber The Tiber (/ˈtaɪbər/, Latin: Tiberis,[1] Italian: Tevere [ˈteːvere])[2] is the third-longest river in Italy, rising in the Apennine Mountains in Emilia-Romagna and flowing 406 kilometres (252 mi) through Tuscany, Umbria and Lazio, where it is joined by the river Aniene, to the Tyrrhenian Sea, between Ostia and Fiumicino.[3] It drains a basin estimated at 17,375 square kilometres (6,709 sq mi). The river has achieved lasting fame as the main watercourse of the city of Rome, founded on its eastern banks.</code> |
566
+ | <code>what kind of car does jay gatsby drive</code> | <code>Jay Gatsby At the Buchanan home, Jordan Baker, Nick, Jay, and the Buchanans decide to visit New York City. Tom borrows Gatsby's yellow Rolls Royce to drive up to the city. On the way to New York City, Tom makes a detour at a gas station in "the Valley of Ashes", a run-down part of Long Island. The owner, George Wilson, shares his concern that his wife, Myrtle, may be having an affair. This unnerves Tom, who has been having an affair with Myrtle, and he leaves in a hurry.</code> |
567
+ | <code>who sings if i can dream about you</code> | <code>I Can Dream About You "I Can Dream About You" is a song performed by American singer Dan Hartman on the soundtrack album of the film Streets of Fire. Released in 1984 as a single from the soundtrack, and included on Hartman's album I Can Dream About You, it reached number 6 on the Billboard Hot 100.[1]</code> |
568
+ * Loss: [<code>SpladeLoss</code>](https://sbert.net/docs/package_reference/sparse_encoder/losses.html#spladeloss) with these parameters:
569
+ ```json
570
+ {
571
+ "loss": "SparseMultipleNegativesRankingLoss(scale=1.0, similarity_fct='dot_score')",
572
+ "lambda_corpus": 0.03,
573
+ "lambda_query": 0
574
+ }
575
+ ```
576
+
577
+ ### Training Hyperparameters
578
+ #### Non-Default Hyperparameters
579
+
580
+ - `eval_strategy`: steps
581
+ - `per_device_train_batch_size`: 64
582
+ - `per_device_eval_batch_size`: 64
583
+ - `learning_rate`: 2e-05
584
+ - `num_train_epochs`: 1
585
+ - `warmup_ratio`: 0.1
586
+ - `fp16`: True
587
+ - `batch_sampler`: no_duplicates
588
+ - `router_mapping`: {'query': 'query', 'answer': 'document'}
589
+ - `learning_rate_mapping`: {'IDF\\.weight': 0.001}
590
+
591
+ #### All Hyperparameters
592
+ <details><summary>Click to expand</summary>
593
+
594
+ - `overwrite_output_dir`: False
595
+ - `do_predict`: False
596
+ - `eval_strategy`: steps
597
+ - `prediction_loss_only`: True
598
+ - `per_device_train_batch_size`: 64
599
+ - `per_device_eval_batch_size`: 64
600
+ - `per_gpu_train_batch_size`: None
601
+ - `per_gpu_eval_batch_size`: None
602
+ - `gradient_accumulation_steps`: 1
603
+ - `eval_accumulation_steps`: None
604
+ - `torch_empty_cache_steps`: None
605
+ - `learning_rate`: 2e-05
606
+ - `weight_decay`: 0.0
607
+ - `adam_beta1`: 0.9
608
+ - `adam_beta2`: 0.999
609
+ - `adam_epsilon`: 1e-08
610
+ - `max_grad_norm`: 1.0
611
+ - `num_train_epochs`: 1
612
+ - `max_steps`: -1
613
+ - `lr_scheduler_type`: linear
614
+ - `lr_scheduler_kwargs`: {}
615
+ - `warmup_ratio`: 0.1
616
+ - `warmup_steps`: 0
617
+ - `log_level`: passive
618
+ - `log_level_replica`: warning
619
+ - `log_on_each_node`: True
620
+ - `logging_nan_inf_filter`: True
621
+ - `save_safetensors`: True
622
+ - `save_on_each_node`: False
623
+ - `save_only_model`: False
624
+ - `restore_callback_states_from_checkpoint`: False
625
+ - `no_cuda`: False
626
+ - `use_cpu`: False
627
+ - `use_mps_device`: False
628
+ - `seed`: 42
629
+ - `data_seed`: None
630
+ - `jit_mode_eval`: False
631
+ - `use_ipex`: False
632
+ - `bf16`: False
633
+ - `fp16`: True
634
+ - `fp16_opt_level`: O1
635
+ - `half_precision_backend`: auto
636
+ - `bf16_full_eval`: False
637
+ - `fp16_full_eval`: False
638
+ - `tf32`: None
639
+ - `local_rank`: 0
640
+ - `ddp_backend`: None
641
+ - `tpu_num_cores`: None
642
+ - `tpu_metrics_debug`: False
643
+ - `debug`: []
644
+ - `dataloader_drop_last`: False
645
+ - `dataloader_num_workers`: 0
646
+ - `dataloader_prefetch_factor`: None
647
+ - `past_index`: -1
648
+ - `disable_tqdm`: False
649
+ - `remove_unused_columns`: True
650
+ - `label_names`: None
651
+ - `load_best_model_at_end`: False
652
+ - `ignore_data_skip`: False
653
+ - `fsdp`: []
654
+ - `fsdp_min_num_params`: 0
655
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
656
+ - `fsdp_transformer_layer_cls_to_wrap`: None
657
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
658
+ - `deepspeed`: None
659
+ - `label_smoothing_factor`: 0.0
660
+ - `optim`: adamw_torch
661
+ - `optim_args`: None
662
+ - `adafactor`: False
663
+ - `group_by_length`: False
664
+ - `length_column_name`: length
665
+ - `ddp_find_unused_parameters`: None
666
+ - `ddp_bucket_cap_mb`: None
667
+ - `ddp_broadcast_buffers`: False
668
+ - `dataloader_pin_memory`: True
669
+ - `dataloader_persistent_workers`: False
670
+ - `skip_memory_metrics`: True
671
+ - `use_legacy_prediction_loop`: False
672
+ - `push_to_hub`: False
673
+ - `resume_from_checkpoint`: None
674
+ - `hub_model_id`: None
675
+ - `hub_strategy`: every_save
676
+ - `hub_private_repo`: None
677
+ - `hub_always_push`: False
678
+ - `gradient_checkpointing`: False
679
+ - `gradient_checkpointing_kwargs`: None
680
+ - `include_inputs_for_metrics`: False
681
+ - `include_for_metrics`: []
682
+ - `eval_do_concat_batches`: True
683
+ - `fp16_backend`: auto
684
+ - `push_to_hub_model_id`: None
685
+ - `push_to_hub_organization`: None
686
+ - `mp_parameters`:
687
+ - `auto_find_batch_size`: False
688
+ - `full_determinism`: False
689
+ - `torchdynamo`: None
690
+ - `ray_scope`: last
691
+ - `ddp_timeout`: 1800
692
+ - `torch_compile`: False
693
+ - `torch_compile_backend`: None
694
+ - `torch_compile_mode`: None
695
+ - `include_tokens_per_second`: False
696
+ - `include_num_input_tokens_seen`: False
697
+ - `neftune_noise_alpha`: None
698
+ - `optim_target_modules`: None
699
+ - `batch_eval_metrics`: False
700
+ - `eval_on_start`: False
701
+ - `use_liger_kernel`: False
702
+ - `eval_use_gather_object`: False
703
+ - `average_tokens_across_devices`: False
704
+ - `prompts`: None
705
+ - `batch_sampler`: no_duplicates
706
+ - `multi_dataset_batch_sampler`: proportional
707
+ - `router_mapping`: {'query': 'query', 'answer': 'document'}
708
+ - `learning_rate_mapping`: {'IDF\\.weight': 0.001}
709
+
710
+ </details>
711
+
712
+ ### Training Logs
713
+ | Epoch | Step | Training Loss | Validation Loss | NanoMSMARCO_dot_ndcg@10 | NanoNFCorpus_dot_ndcg@10 | NanoNQ_dot_ndcg@10 | NanoBEIR_mean_dot_ndcg@10 |
714
+ |:------:|:----:|:-------------:|:---------------:|:-----------------------:|:------------------------:|:------------------:|:-------------------------:|
715
+ | 0.0129 | 20 | 1.8729 | - | - | - | - | - |
716
+ | 0.0259 | 40 | 4.3293 | - | - | - | - | - |
717
+ | 0.0388 | 60 | 7.3157 | - | - | - | - | - |
718
+ | 0.0517 | 80 | 7.3718 | - | - | - | - | - |
719
+ | 0.0646 | 100 | 5.171 | - | - | - | - | - |
720
+ | 0.0776 | 120 | 3.5119 | - | - | - | - | - |
721
+ | 0.0905 | 140 | 2.6883 | - | - | - | - | - |
722
+ | 0.1034 | 160 | 2.2642 | - | - | - | - | - |
723
+ | 0.1164 | 180 | 1.9244 | - | - | - | - | - |
724
+ | 0.1293 | 200 | 1.6712 | 1.2603 | 0.3854 | 0.3158 | 0.4024 | 0.3679 |
725
+ | 0.1422 | 220 | 1.4993 | - | - | - | - | - |
726
+ | 0.1551 | 240 | 1.3321 | - | - | - | - | - |
727
+ | 0.1681 | 260 | 1.2798 | - | - | - | - | - |
728
+ | 0.1810 | 280 | 1.1572 | - | - | - | - | - |
729
+ | 0.1939 | 300 | 1.0751 | - | - | - | - | - |
730
+ | 0.2069 | 320 | 1.0125 | - | - | - | - | - |
731
+ | 0.2198 | 340 | 0.9666 | - | - | - | - | - |
732
+ | 0.2327 | 360 | 0.935 | - | - | - | - | - |
733
+ | 0.2456 | 380 | 0.8799 | - | - | - | - | - |
734
+ | 0.2586 | 400 | 0.8102 | 0.7086 | 0.4184 | 0.3178 | 0.4684 | 0.4015 |
735
+ | 0.2715 | 420 | 0.7882 | - | - | - | - | - |
736
+ | 0.2844 | 440 | 0.8081 | - | - | - | - | - |
737
+ | 0.2973 | 460 | 0.7592 | - | - | - | - | - |
738
+ | 0.3103 | 480 | 0.7707 | - | - | - | - | - |
739
+ | 0.3232 | 500 | 0.7704 | - | - | - | - | - |
740
+ | 0.3361 | 520 | 0.7467 | - | - | - | - | - |
741
+ | 0.3491 | 540 | 0.7128 | - | - | - | - | - |
742
+ | 0.3620 | 560 | 0.7659 | - | - | - | - | - |
743
+ | 0.3749 | 580 | 0.6987 | - | - | - | - | - |
744
+ | 0.3878 | 600 | 0.7579 | 0.6132 | 0.4346 | 0.3186 | 0.4910 | 0.4147 |
745
+ | 0.4008 | 620 | 0.7029 | - | - | - | - | - |
746
+ | 0.4137 | 640 | 0.6148 | - | - | - | - | - |
747
+ | 0.4266 | 660 | 0.6393 | - | - | - | - | - |
748
+ | 0.4396 | 680 | 0.6764 | - | - | - | - | - |
749
+ | 0.4525 | 700 | 0.6586 | - | - | - | - | - |
750
+ | 0.4654 | 720 | 0.5964 | - | - | - | - | - |
751
+ | 0.4783 | 740 | 0.6263 | - | - | - | - | - |
752
+ | 0.4913 | 760 | 0.6045 | - | - | - | - | - |
753
+ | 0.5042 | 780 | 0.5662 | - | - | - | - | - |
754
+ | 0.5171 | 800 | 0.6092 | 0.5510 | 0.4367 | 0.3269 | 0.4902 | 0.4179 |
755
+ | 0.5301 | 820 | 0.6066 | - | - | - | - | - |
756
+ | 0.5430 | 840 | 0.5914 | - | - | - | - | - |
757
+ | 0.5559 | 860 | 0.608 | - | - | - | - | - |
758
+ | 0.5688 | 880 | 0.5745 | - | - | - | - | - |
759
+ | 0.5818 | 900 | 0.5733 | - | - | - | - | - |
760
+ | 0.5947 | 920 | 0.5631 | - | - | - | - | - |
761
+ | 0.6076 | 940 | 0.5444 | - | - | - | - | - |
762
+ | 0.6206 | 960 | 0.5588 | - | - | - | - | - |
763
+ | 0.6335 | 980 | 0.5975 | - | - | - | - | - |
764
+ | 0.6464 | 1000 | 0.5211 | 0.5213 | 0.4450 | 0.3315 | 0.4922 | 0.4229 |
765
+ | 0.6593 | 1020 | 0.5496 | - | - | - | - | - |
766
+ | 0.6723 | 1040 | 0.5321 | - | - | - | - | - |
767
+ | 0.6852 | 1060 | 0.5474 | - | - | - | - | - |
768
+ | 0.6981 | 1080 | 0.5752 | - | - | - | - | - |
769
+ | 0.7111 | 1100 | 0.5567 | - | - | - | - | - |
770
+ | 0.7240 | 1120 | 0.5332 | - | - | - | - | - |
771
+ | 0.7369 | 1140 | 0.5591 | - | - | - | - | - |
772
+ | 0.7498 | 1160 | 0.5345 | - | - | - | - | - |
773
+ | 0.7628 | 1180 | 0.5521 | - | - | - | - | - |
774
+ | 0.7757 | 1200 | 0.5581 | 0.5031 | 0.4640 | 0.3333 | 0.4904 | 0.4292 |
775
+ | 0.7886 | 1220 | 0.538 | - | - | - | - | - |
776
+ | 0.8016 | 1240 | 0.5487 | - | - | - | - | - |
777
+ | 0.8145 | 1260 | 0.5273 | - | - | - | - | - |
778
+ | 0.8274 | 1280 | 0.5431 | - | - | - | - | - |
779
+ | 0.8403 | 1300 | 0.5618 | - | - | - | - | - |
780
+ | 0.8533 | 1320 | 0.5379 | - | - | - | - | - |
781
+ | 0.8662 | 1340 | 0.5302 | - | - | - | - | - |
782
+ | 0.8791 | 1360 | 0.5268 | - | - | - | - | - |
783
+ | 0.8920 | 1380 | 0.5336 | - | - | - | - | - |
784
+ | 0.9050 | 1400 | 0.5189 | 0.4937 | 0.4716 | 0.3359 | 0.4971 | 0.4348 |
785
+ | 0.9179 | 1420 | 0.5221 | - | - | - | - | - |
786
+ | 0.9308 | 1440 | 0.4935 | - | - | - | - | - |
787
+ | 0.9438 | 1460 | 0.5454 | - | - | - | - | - |
788
+ | 0.9567 | 1480 | 0.5224 | - | - | - | - | - |
789
+ | 0.9696 | 1500 | 0.5315 | - | - | - | - | - |
790
+ | 0.9825 | 1520 | 0.5307 | - | - | - | - | - |
791
+ | 0.9955 | 1540 | 0.5303 | - | - | - | - | - |
792
+ | -1 | -1 | - | - | 0.4712 | 0.3364 | 0.4990 | 0.4355 |
793
+
794
+
795
+ ### Environmental Impact
796
+ Carbon emissions were measured using [CodeCarbon](https://github.com/mlco2/codecarbon).
797
+ - **Energy Consumed**: 0.031 kWh
798
+ - **Carbon Emitted**: 0.012 kg of CO2
799
+ - **Hours Used**: 0.09 hours
800
+
801
+ ### Training Hardware
802
+ - **On Cloud**: No
803
+ - **GPU Model**: 1 x NVIDIA GeForce RTX 3090
804
+ - **CPU Model**: 13th Gen Intel(R) Core(TM) i7-13700K
805
+ - **RAM Size**: 31.78 GB
806
+
807
+ ### Framework Versions
808
+ - Python: 3.11.6
809
+ - Sentence Transformers: 4.2.0.dev0
810
+ - Transformers: 4.52.3
811
+ - PyTorch: 2.6.0+cu124
812
+ - Accelerate: 1.5.1
813
+ - Datasets: 2.21.0
814
+ - Tokenizers: 0.21.1
815
+
816
+ ## Citation
817
+
818
+ ### BibTeX
819
+
820
+ #### Sentence Transformers
821
+ ```bibtex
822
+ @inproceedings{reimers-2019-sentence-bert,
823
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
824
+ author = "Reimers, Nils and Gurevych, Iryna",
825
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
826
+ month = "11",
827
+ year = "2019",
828
+ publisher = "Association for Computational Linguistics",
829
+ url = "https://arxiv.org/abs/1908.10084",
830
+ }
831
+ ```
832
+
833
+ #### SpladeLoss
834
+ ```bibtex
835
+ @misc{formal2022distillationhardnegativesampling,
836
+ title={From Distillation to Hard Negative Sampling: Making Sparse Neural IR Models More Effective},
837
+ author={Thibault Formal and Carlos Lassance and Benjamin Piwowarski and Stéphane Clinchant},
838
+ year={2022},
839
+ eprint={2205.04733},
840
+ archivePrefix={arXiv},
841
+ primaryClass={cs.IR},
842
+ url={https://arxiv.org/abs/2205.04733},
843
+ }
844
+ ```
845
+
846
+ #### SparseMultipleNegativesRankingLoss
847
+ ```bibtex
848
+ @misc{henderson2017efficient,
849
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
850
+ 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},
851
+ year={2017},
852
+ eprint={1705.00652},
853
+ archivePrefix={arXiv},
854
+ primaryClass={cs.CL}
855
+ }
856
+ ```
857
+
858
+ #### FlopsLoss
859
+ ```bibtex
860
+ @article{paria2020minimizing,
861
+ title={Minimizing flops to learn efficient sparse representations},
862
+ author={Paria, Biswajit and Yeh, Chih-Kuan and Yen, Ian EH and Xu, Ning and Ravikumar, Pradeep and P{'o}czos, Barnab{'a}s},
863
+ journal={arXiv preprint arXiv:2004.05665},
864
+ year={2020}
865
+ }
866
+ ```
867
+
868
+ <!--
869
+ ## Glossary
870
+
871
+ *Clearly define terms in order to be accessible across audiences.*
872
+ -->
873
+
874
+ <!--
875
+ ## Model Card Authors
876
+
877
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
878
+ -->
879
+
880
+ <!--
881
+ ## Model Card Contact
882
+
883
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
884
+ -->
config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "types": {
3
+ "query_0_IDF": "sentence_transformers.sparse_encoder.models.IDF",
4
+ "document_0_MLMTransformer": "sentence_transformers.sparse_encoder.models.MLMTransformer",
5
+ "document_1_SpladePooling": "sentence_transformers.sparse_encoder.models.SpladePooling"
6
+ },
7
+ "structure": {
8
+ "query": [
9
+ "query_0_IDF"
10
+ ],
11
+ "document": [
12
+ "document_0_MLMTransformer",
13
+ "document_1_SpladePooling"
14
+ ]
15
+ },
16
+ "parameters": {
17
+ "allow_empty_key": true
18
+ }
19
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "SparseEncoder",
3
+ "__version__": {
4
+ "sentence_transformers": "4.2.0.dev0",
5
+ "transformers": "4.52.3",
6
+ "pytorch": "2.6.0+cu124"
7
+ },
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "dot"
14
+ }
document_0_MLMTransformer/config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertForMaskedLM"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "hidden_act": "gelu",
8
+ "hidden_dropout_prob": 0.1,
9
+ "hidden_size": 128,
10
+ "initializer_range": 0.02,
11
+ "intermediate_size": 512,
12
+ "layer_norm_eps": 1e-12,
13
+ "max_position_embeddings": 512,
14
+ "model_type": "bert",
15
+ "num_attention_heads": 2,
16
+ "num_hidden_layers": 2,
17
+ "pad_token_id": 0,
18
+ "position_embedding_type": "absolute",
19
+ "torch_dtype": "float32",
20
+ "transformers_version": "4.52.3",
21
+ "type_vocab_size": 2,
22
+ "use_cache": true,
23
+ "vocab_size": 30522
24
+ }
document_0_MLMTransformer/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bb83b697cd4a769aa69199158adca109ba29d4142aca2f506eb309cab0cfdedd
3
+ size 17671560
document_0_MLMTransformer/sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": false
4
+ }
document_0_MLMTransformer/special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
document_0_MLMTransformer/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
document_0_MLMTransformer/tokenizer_config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "model_max_length": 512,
51
+ "never_split": null,
52
+ "pad_token": "[PAD]",
53
+ "sep_token": "[SEP]",
54
+ "strip_accents": null,
55
+ "tokenize_chinese_chars": true,
56
+ "tokenizer_class": "BertTokenizer",
57
+ "unk_token": "[UNK]"
58
+ }
document_0_MLMTransformer/vocab.txt ADDED
The diff for this file is too large to render. See raw diff
 
document_1_SpladePooling/config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "pooling_strategy": "max",
3
+ "activation_function": "relu",
4
+ "word_embedding_dimension": 30522
5
+ }
modules.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Asym"
7
+ }
8
+ ]
query_0_IDF/config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "frozen": false
3
+ }
query_0_IDF/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d63c87c220ce49b3425eda33076600ad8f4df6a9dfd7cca2e945bf3114cdeb4
3
+ size 122168
query_0_IDF/special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
query_0_IDF/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
query_0_IDF/tokenizer_config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "model_max_length": 512,
51
+ "never_split": null,
52
+ "pad_token": "[PAD]",
53
+ "sep_token": "[SEP]",
54
+ "strip_accents": null,
55
+ "tokenize_chinese_chars": true,
56
+ "tokenizer_class": "BertTokenizer",
57
+ "unk_token": "[UNK]"
58
+ }
query_0_IDF/vocab.txt ADDED
The diff for this file is too large to render. See raw diff