kwondw commited on
Commit
c1cdb06
·
verified ·
1 Parent(s): f5a8f11

Add new CrossEncoder model

Browse files
README.md ADDED
@@ -0,0 +1,517 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ tags:
6
+ - sentence-transformers
7
+ - cross-encoder
8
+ - reranker
9
+ - generated_from_trainer
10
+ - dataset_size:95939
11
+ - loss:LambdaLoss
12
+ base_model: answerdotai/ModernBERT-base
13
+ pipeline_tag: text-ranking
14
+ library_name: sentence-transformers
15
+ metrics:
16
+ - map
17
+ - mrr@10
18
+ - ndcg@10
19
+ model-index:
20
+ - name: ModernBERT-base trained on GooAQ
21
+ results:
22
+ - task:
23
+ type: cross-encoder-reranking
24
+ name: Cross Encoder Reranking
25
+ dataset:
26
+ name: gooaq dev
27
+ type: gooaq-dev
28
+ metrics:
29
+ - type: map
30
+ value: 0.7235
31
+ name: Map
32
+ - type: mrr@10
33
+ value: 0.722
34
+ name: Mrr@10
35
+ - type: ndcg@10
36
+ value: 0.7664
37
+ name: Ndcg@10
38
+ - task:
39
+ type: cross-encoder-reranking
40
+ name: Cross Encoder Reranking
41
+ dataset:
42
+ name: NanoMSMARCO R100
43
+ type: NanoMSMARCO_R100
44
+ metrics:
45
+ - type: map
46
+ value: 0.44
47
+ name: Map
48
+ - type: mrr@10
49
+ value: 0.4276
50
+ name: Mrr@10
51
+ - type: ndcg@10
52
+ value: 0.5023
53
+ name: Ndcg@10
54
+ - task:
55
+ type: cross-encoder-reranking
56
+ name: Cross Encoder Reranking
57
+ dataset:
58
+ name: NanoNFCorpus R100
59
+ type: NanoNFCorpus_R100
60
+ metrics:
61
+ - type: map
62
+ value: 0.3312
63
+ name: Map
64
+ - type: mrr@10
65
+ value: 0.5754
66
+ name: Mrr@10
67
+ - type: ndcg@10
68
+ value: 0.3743
69
+ name: Ndcg@10
70
+ - task:
71
+ type: cross-encoder-reranking
72
+ name: Cross Encoder Reranking
73
+ dataset:
74
+ name: NanoNQ R100
75
+ type: NanoNQ_R100
76
+ metrics:
77
+ - type: map
78
+ value: 0.2867
79
+ name: Map
80
+ - type: mrr@10
81
+ value: 0.281
82
+ name: Mrr@10
83
+ - type: ndcg@10
84
+ value: 0.3538
85
+ name: Ndcg@10
86
+ - task:
87
+ type: cross-encoder-nano-beir
88
+ name: Cross Encoder Nano BEIR
89
+ dataset:
90
+ name: NanoBEIR R100 mean
91
+ type: NanoBEIR_R100_mean
92
+ metrics:
93
+ - type: map
94
+ value: 0.3526
95
+ name: Map
96
+ - type: mrr@10
97
+ value: 0.428
98
+ name: Mrr@10
99
+ - type: ndcg@10
100
+ value: 0.4101
101
+ name: Ndcg@10
102
+ ---
103
+
104
+ # ModernBERT-base trained on GooAQ
105
+
106
+ This is a [Cross Encoder](https://www.sbert.net/docs/cross_encoder/usage/usage.html) model finetuned from [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) using the [sentence-transformers](https://www.SBERT.net) library. It computes scores for pairs of texts, which can be used for text reranking and semantic search.
107
+
108
+ ## Model Details
109
+
110
+ ### Model Description
111
+ - **Model Type:** Cross Encoder
112
+ - **Base model:** [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) <!-- at revision 8949b909ec900327062f0ebf497f51aef5e6f0c8 -->
113
+ - **Maximum Sequence Length:** 8192 tokens
114
+ - **Number of Output Labels:** 1 label
115
+ - **Supported Modality:** Text
116
+ <!-- - **Training Dataset:** Unknown -->
117
+ - **Language:** en
118
+ - **License:** apach-2.0
119
+
120
+ ### Model Sources
121
+
122
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
123
+ - **Documentation:** [Cross Encoder Documentation](https://www.sbert.net/docs/cross_encoder/usage/usage.html)
124
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
125
+ - **Hugging Face:** [Cross Encoders on Hugging Face](https://huggingface.co/models?library=sentence-transformers&other=cross-encoder)
126
+
127
+ ### Full Model Architecture
128
+
129
+ ```
130
+ CrossEncoder(
131
+ (0): Transformer({'transformer_task': 'sequence-classification', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'logits'}}, 'module_output_name': 'scores', 'architecture': 'ModernBertForSequenceClassification'})
132
+ )
133
+ ```
134
+
135
+ ## Usage
136
+
137
+ ### Direct Usage (Sentence Transformers)
138
+
139
+ First install the Sentence Transformers library:
140
+
141
+ ```bash
142
+ pip install -U sentence-transformers
143
+ ```
144
+
145
+ Then you can load this model and run inference.
146
+ ```python
147
+ from sentence_transformers import CrossEncoder
148
+
149
+ # Download from the 🤗 Hub
150
+ model = CrossEncoder("cross_encoder_model_id")
151
+ # Get scores for pairs of inputs
152
+ pairs = [
153
+ ['what are the 5 characteristics of a star?', 'Key Concept: Characteristics used to classify stars include color, temperature, size, composition, and brightness.'],
154
+ ['what are the 5 characteristics of a star?', 'The biggest difference was compression. The most recent Z-STAR has a compression of 90, while the Z-STAR XV comes in at 102. The original Q-STAR Tour had a compression of 75 (this new version, like Gen 2, is 72), and with its performance characteristics, Srixon could have called it Z-STAR Soft.'],
155
+ ['what are the 5 characteristics of a star?', "While 4-star hotels provide quality services to its patrons, a 5-star luxury accommodation will have impeccable service delivery. You'll often end up paying extra for the amenities like room service and concierge services in a 4-star hotel. But a 5-star hotel will always offer personalised services."],
156
+ ['what are the 5 characteristics of a star?', 'However, the brightness of a star depends on its composition and how far it is from the planet. Astronomers define star brightness in terms of apparent magnitude — how bright the star appears from Earth — and absolute magnitude — how bright the star appears at a standard distance of 32.6 light-years, or 10 parsecs.'],
157
+ ['what are the 5 characteristics of a star?', 'A "falling star" or a "shooting star" has nothing at all to do with a star! These amazing streaks of light you can sometimes see in the night sky are caused by tiny bits of dust and rock called meteoroids falling into the Earth\'s atmosphere and burning up. ... Meteors are commonly called falling stars or shooting stars.'],
158
+ ]
159
+ scores = model.predict(pairs)
160
+ print(scores)
161
+ # [9.4520e-01 1.7401e-04 4.5739e-03 2.9579e-03 1.3631e-05]
162
+
163
+ # Or rank different texts based on similarity to a single text
164
+ ranks = model.rank(
165
+ 'what are the 5 characteristics of a star?',
166
+ [
167
+ 'Key Concept: Characteristics used to classify stars include color, temperature, size, composition, and brightness.',
168
+ 'The biggest difference was compression. The most recent Z-STAR has a compression of 90, while the Z-STAR XV comes in at 102. The original Q-STAR Tour had a compression of 75 (this new version, like Gen 2, is 72), and with its performance characteristics, Srixon could have called it Z-STAR Soft.',
169
+ "While 4-star hotels provide quality services to its patrons, a 5-star luxury accommodation will have impeccable service delivery. You'll often end up paying extra for the amenities like room service and concierge services in a 4-star hotel. But a 5-star hotel will always offer personalised services.",
170
+ 'However, the brightness of a star depends on its composition and how far it is from the planet. Astronomers define star brightness in terms of apparent magnitude — how bright the star appears from Earth — and absolute magnitude — how bright the star appears at a standard distance of 32.6 light-years, or 10 parsecs.',
171
+ 'A "falling star" or a "shooting star" has nothing at all to do with a star! These amazing streaks of light you can sometimes see in the night sky are caused by tiny bits of dust and rock called meteoroids falling into the Earth\'s atmosphere and burning up. ... Meteors are commonly called falling stars or shooting stars.',
172
+ ]
173
+ )
174
+ # [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]
175
+ ```
176
+
177
+ <!--
178
+ ### Direct Usage (Transformers)
179
+
180
+ <details><summary>Click to see the direct usage in Transformers</summary>
181
+
182
+ </details>
183
+ -->
184
+
185
+ <!--
186
+ ### Downstream Usage (Sentence Transformers)
187
+
188
+ You can finetune this model on your own dataset.
189
+
190
+ <details><summary>Click to expand</summary>
191
+
192
+ </details>
193
+ -->
194
+
195
+ <!--
196
+ ### Out-of-Scope Use
197
+
198
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
199
+ -->
200
+
201
+ ## Evaluation
202
+
203
+ ### Metrics
204
+
205
+ #### Cross Encoder Reranking
206
+
207
+ * Dataset: `gooaq-dev`
208
+ * Evaluated with [<code>CrossEncoderRerankingEvaluator</code>](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CrossEncoderRerankingEvaluator) with these parameters:
209
+ ```json
210
+ {
211
+ "at_k": 10,
212
+ "always_rerank_positives": false
213
+ }
214
+ ```
215
+
216
+ | Metric | Value |
217
+ |:------------|:---------------------|
218
+ | map | 0.7235 (+0.1924) |
219
+ | mrr@10 | 0.7220 (+0.1981) |
220
+ | **ndcg@10** | **0.7664 (+0.1751)** |
221
+
222
+ #### Cross Encoder Reranking
223
+
224
+ * Datasets: `NanoMSMARCO_R100`, `NanoNFCorpus_R100` and `NanoNQ_R100`
225
+ * Evaluated with [<code>CrossEncoderRerankingEvaluator</code>](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CrossEncoderRerankingEvaluator) with these parameters:
226
+ ```json
227
+ {
228
+ "at_k": 10,
229
+ "always_rerank_positives": true
230
+ }
231
+ ```
232
+
233
+ | Metric | NanoMSMARCO_R100 | NanoNFCorpus_R100 | NanoNQ_R100 |
234
+ |:------------|:---------------------|:---------------------|:---------------------|
235
+ | map | 0.4400 (-0.0496) | 0.3312 (+0.0702) | 0.2867 (-0.1329) |
236
+ | mrr@10 | 0.4276 (-0.0499) | 0.5754 (+0.0756) | 0.2810 (-0.1457) |
237
+ | **ndcg@10** | **0.5023 (-0.0381)** | **0.3743 (+0.0492)** | **0.3538 (-0.1468)** |
238
+
239
+ #### Cross Encoder Nano BEIR
240
+
241
+ * Dataset: `NanoBEIR_R100_mean`
242
+ * Evaluated with [<code>CrossEncoderNanoBEIREvaluator</code>](https://sbert.net/docs/package_reference/cross_encoder/evaluation.html#sentence_transformers.cross_encoder.evaluation.CrossEncoderNanoBEIREvaluator) with these parameters:
243
+ ```json
244
+ {
245
+ "dataset_names": [
246
+ "msmarco",
247
+ "nfcorpus",
248
+ "nq"
249
+ ],
250
+ "dataset_id": "sentence-transformers/NanoBEIR-en",
251
+ "rerank_k": 100,
252
+ "at_k": 10,
253
+ "always_rerank_positives": true
254
+ }
255
+ ```
256
+
257
+ | Metric | Value |
258
+ |:------------|:---------------------|
259
+ | map | 0.3526 (-0.0374) |
260
+ | mrr@10 | 0.4280 (-0.0400) |
261
+ | **ndcg@10** | **0.4101 (-0.0452)** |
262
+
263
+ <!--
264
+ ## Bias, Risks and Limitations
265
+
266
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
267
+ -->
268
+
269
+ <!--
270
+ ### Recommendations
271
+
272
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
273
+ -->
274
+
275
+ ## Training Details
276
+
277
+ ### Training Dataset
278
+
279
+ #### Unnamed Dataset
280
+
281
+ * Size: 95,939 training samples
282
+ * Columns: <code>question</code>, <code>answer</code>, and <code>labels</code>
283
+ * Approximate statistics based on the first 100 samples:
284
+ | | question | answer | labels |
285
+ |:---------|:----------------------------------------------------------------------------------|:-----------------------------------|:-----------------------------------|
286
+ | type | string | list | list |
287
+ | modality | text | | |
288
+ | details | <ul><li>min: 8 tokens</li><li>mean: 11.69 tokens</li><li>max: 19 tokens</li></ul> | <ul><li>size: 6 elements</li></ul> | <ul><li>size: 6 elements</li></ul> |
289
+ * Samples:
290
+ | question | answer | labels |
291
+ |:-----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------|
292
+ | <code>what are the 5 characteristics of a star?</code> | <code>['Key Concept: Characteristics used to classify stars include color, temperature, size, composition, and brightness.', 'The biggest difference was compression. The most recent Z-STAR has a compression of 90, while the Z-STAR XV comes in at 102. The original Q-STAR Tour had a compression of 75 (this new version, like Gen 2, is 72), and with its performance characteristics, Srixon could have called it Z-STAR Soft.', "While 4-star hotels provide quality services to its patrons, a 5-star luxury accommodation will have impeccable service delivery. You'll often end up paying extra for the amenities like room service and concierge services in a 4-star hotel. But a 5-star hotel will always offer personalised services.", 'However, the brightness of a star depends on its composition and how far it is from the planet. Astronomers define star brightness in terms of apparent magnitude — how bright the star appears from Earth — and absolute magnitude — how bright the star appears at a standard distance of 32.6 light-years, or 10 parsecs.', 'A "falling star" or a "shooting star" has nothing at all to do with a star! These amazing streaks of light you can sometimes see in the night sky are caused by tiny bits of dust and rock called meteoroids falling into the Earth\'s atmosphere and burning up. ... Meteors are commonly called falling stars or shooting stars.', ...]</code> | <code>[1, 0, 0, 0, 0, ...]</code> |
293
+ | <code>are copic markers alcohol ink?</code> | <code>['Copic Ink is alcohol-based and flammable. Keep away from direct sunlight and extreme temperatures.', 'Copic Sketch markers are alcohol-based, refillable dye markers with replaceable nibs for full versatility. ... Great for comic drawing, scrapbooking, fine art, illustration, product design, architecture, and more, this marker is an essential for artists, designers and crafters. Details: Available in multiple colors.', 'Alcohol based markers differ from water based markers in that the color (dye or pigment) is suspended in an alcohol or another fast evaporating solvent, rather than water or glycerin. This means that alcohol based markers are not water soluble, but may be alcohol soluble.', 'Gel ink pens are primarily made to be used on paper substrates and not on plastics, glass, or fabrics. While some gel ink versions can adhere to other surfaces, this greatly affects the overall "performance" of the ink. (i.e. the gel inks might be easily washed out or scratched off the surface.)', 'Permanent markers are made from pigment and not dyes. Dyes are water soluble but pigment are not soluble in water. If you clean the markers with a no polar solvent like alcohol or acetone the markers are not truly permanent on certain materials. ... The purpose is to determine if permanent marker are truly permanent.', ...]</code> | <code>[1, 0, 0, 0, 0, ...]</code> |
294
+ | <code>what is the difference between appellate term and appellate division?</code> | <code>['Appellate terms An appellate term is an intermediate appellate court that hears appeals from the inferior courts within their designated counties or judicial districts, and are intended to ease the workload on the Appellate Division and provide a less expensive forum closer to the people.', 'As verbs the difference between request and appeal is that request is to express the need or desire for while appeal is (obsolete) to accuse (someone of something).', 'As nouns the difference between fraction and division is that fraction is a part of a whole, especially a comparatively small part while division is (uncountable) the act or process of dividing anything.', 'As nouns the difference between divide and division is that divide is a thing that divides while division is (uncountable) the act or process of dividing anything.', 'definition and meaning , “A feature is a distinctive characteristic of a good or service that sets it apart from similar items. Customers, however, want a benefit..” The same source also defines objective: “A specific result that a person or system aims to achieve within a time frame and with available resources.', ...]</code> | <code>[1, 0, 0, 0, 0, ...]</code> |
295
+ * Loss: [<code>LambdaLoss</code>](https://sbert.net/docs/package_reference/cross_encoder/losses.html#lambdaloss) with these parameters:
296
+ ```json
297
+ {
298
+ "weighting_scheme": "sentence_transformers.cross_encoder.losses.lambda_loss.NDCGLoss2PPScheme",
299
+ "k": null,
300
+ "sigma": 1.0,
301
+ "eps": 1e-10,
302
+ "reduction_log": "binary",
303
+ "activation_fn": "torch.nn.modules.linear.Identity",
304
+ "mini_batch_size": 8
305
+ }
306
+ ```
307
+
308
+ ### Training Hyperparameters
309
+ #### Non-Default Hyperparameters
310
+
311
+ - `per_device_train_batch_size`: 16
312
+ - `num_train_epochs`: 1
313
+ - `learning_rate`: 2e-05
314
+ - `warmup_steps`: 0.1
315
+ - `gradient_accumulation_steps`: 4
316
+ - `fp16`: True
317
+ - `per_device_eval_batch_size`: 16
318
+ - `load_best_model_at_end`: True
319
+ - `seed`: 12
320
+ - `dataloader_num_workers`: 2
321
+ - `dataloader_persistent_workers`: True
322
+
323
+ #### All Hyperparameters
324
+ <details><summary>Click to expand</summary>
325
+
326
+ - `per_device_train_batch_size`: 16
327
+ - `num_train_epochs`: 1
328
+ - `max_steps`: -1
329
+ - `learning_rate`: 2e-05
330
+ - `lr_scheduler_type`: linear
331
+ - `lr_scheduler_kwargs`: None
332
+ - `warmup_steps`: 0.1
333
+ - `optim`: adamw_torch_fused
334
+ - `optim_args`: None
335
+ - `weight_decay`: 0.0
336
+ - `adam_beta1`: 0.9
337
+ - `adam_beta2`: 0.999
338
+ - `adam_epsilon`: 1e-08
339
+ - `optim_target_modules`: None
340
+ - `gradient_accumulation_steps`: 4
341
+ - `average_tokens_across_devices`: True
342
+ - `max_grad_norm`: 1.0
343
+ - `label_smoothing_factor`: 0.0
344
+ - `bf16`: False
345
+ - `fp16`: True
346
+ - `bf16_full_eval`: False
347
+ - `fp16_full_eval`: False
348
+ - `tf32`: None
349
+ - `gradient_checkpointing`: False
350
+ - `gradient_checkpointing_kwargs`: None
351
+ - `torch_compile`: False
352
+ - `torch_compile_backend`: None
353
+ - `torch_compile_mode`: None
354
+ - `use_liger_kernel`: False
355
+ - `liger_kernel_config`: None
356
+ - `use_cache`: False
357
+ - `neftune_noise_alpha`: None
358
+ - `torch_empty_cache_steps`: None
359
+ - `auto_find_batch_size`: False
360
+ - `log_on_each_node`: True
361
+ - `logging_nan_inf_filter`: True
362
+ - `include_num_input_tokens_seen`: no
363
+ - `log_level`: passive
364
+ - `log_level_replica`: warning
365
+ - `disable_tqdm`: False
366
+ - `project`: huggingface
367
+ - `trackio_space_id`: None
368
+ - `trackio_bucket_id`: None
369
+ - `trackio_static_space_id`: None
370
+ - `per_device_eval_batch_size`: 16
371
+ - `prediction_loss_only`: True
372
+ - `eval_on_start`: False
373
+ - `eval_do_concat_batches`: True
374
+ - `eval_use_gather_object`: False
375
+ - `eval_accumulation_steps`: None
376
+ - `include_for_metrics`: []
377
+ - `batch_eval_metrics`: False
378
+ - `save_only_model`: False
379
+ - `save_on_each_node`: False
380
+ - `enable_jit_checkpoint`: False
381
+ - `push_to_hub`: False
382
+ - `hub_private_repo`: None
383
+ - `hub_model_id`: None
384
+ - `hub_strategy`: every_save
385
+ - `hub_always_push`: False
386
+ - `hub_revision`: None
387
+ - `load_best_model_at_end`: True
388
+ - `ignore_data_skip`: False
389
+ - `restore_callback_states_from_checkpoint`: False
390
+ - `full_determinism`: False
391
+ - `seed`: 12
392
+ - `data_seed`: None
393
+ - `use_cpu`: False
394
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
395
+ - `parallelism_config`: None
396
+ - `dataloader_drop_last`: False
397
+ - `dataloader_num_workers`: 2
398
+ - `dataloader_pin_memory`: True
399
+ - `dataloader_persistent_workers`: True
400
+ - `dataloader_prefetch_factor`: None
401
+ - `remove_unused_columns`: True
402
+ - `label_names`: None
403
+ - `train_sampling_strategy`: random
404
+ - `length_column_name`: length
405
+ - `ddp_find_unused_parameters`: None
406
+ - `ddp_bucket_cap_mb`: None
407
+ - `ddp_broadcast_buffers`: False
408
+ - `ddp_static_graph`: None
409
+ - `ddp_backend`: None
410
+ - `ddp_timeout`: 1800
411
+ - `fsdp`: None
412
+ - `fsdp_config`: None
413
+ - `deepspeed`: None
414
+ - `debug`: []
415
+ - `skip_memory_metrics`: True
416
+ - `do_predict`: False
417
+ - `resume_from_checkpoint`: None
418
+ - `warmup_ratio`: None
419
+ - `local_rank`: -1
420
+ - `prompts`: None
421
+ - `batch_sampler`: batch_sampler
422
+ - `multi_dataset_batch_sampler`: proportional
423
+ - `router_mapping`: {}
424
+ - `learning_rate_mapping`: {}
425
+
426
+ </details>
427
+
428
+ ### Training Logs
429
+ | Epoch | Step | Training Loss | gooaq-dev_ndcg@10 | NanoMSMARCO_R100_ndcg@10 | NanoNFCorpus_R100_ndcg@10 | NanoNQ_R100_ndcg@10 | NanoBEIR_R100_mean_ndcg@10 |
430
+ |:-------:|:--------:|:-------------:|:--------------------:|:------------------------:|:-------------------------:|:--------------------:|:--------------------------:|
431
+ | -1 | -1 | - | 0.1341 (-0.4572) | 0.0124 (-0.5280) | 0.2983 (-0.0268) | 0.0067 (-0.4940) | 0.1058 (-0.3496) |
432
+ | 0.0007 | 1 | 2.1925 | - | - | - | - | - |
433
+ | 0.0667 | 100 | 2.0361 | - | - | - | - | - |
434
+ | 0.1334 | 200 | 1.0558 | - | - | - | - | - |
435
+ | 0.1668 | 250 | - | 0.7213 (+0.1300) | 0.4535 (-0.0869) | 0.3667 (+0.0417) | 0.3618 (-0.1389) | 0.3940 (-0.0614) |
436
+ | 0.2001 | 300 | 0.6286 | - | - | - | - | - |
437
+ | 0.2668 | 400 | 0.5332 | - | - | - | - | - |
438
+ | 0.3335 | 500 | 0.5208 | 0.7468 (+0.1556) | 0.4826 (-0.0578) | 0.3783 (+0.0533) | 0.4192 (-0.0815) | 0.4267 (-0.0287) |
439
+ | 0.4002 | 600 | 0.4892 | - | - | - | - | - |
440
+ | 0.4669 | 700 | 0.4780 | - | - | - | - | - |
441
+ | 0.5003 | 750 | - | 0.7538 (+0.1626) | 0.5041 (-0.0363) | 0.4069 (+0.0819) | 0.3785 (-0.1221) | 0.4299 (-0.0255) |
442
+ | 0.5336 | 800 | 0.4448 | - | - | - | - | - |
443
+ | 0.6003 | 900 | 0.4455 | - | - | - | - | - |
444
+ | 0.6670 | 1000 | 0.4427 | 0.7611 (+0.1698) | 0.4584 (-0.0820) | 0.3731 (+0.0481) | 0.3098 (-0.1908) | 0.3804 (-0.0749) |
445
+ | 0.7337 | 1100 | 0.4307 | - | - | - | - | - |
446
+ | 0.8004 | 1200 | 0.4269 | - | - | - | - | - |
447
+ | 0.8338 | 1250 | - | 0.7640 (+0.1727) | 0.4978 (-0.0426) | 0.3887 (+0.0636) | 0.3634 (-0.1373) | 0.4166 (-0.0388) |
448
+ | 0.8671 | 1300 | 0.4119 | - | - | - | - | - |
449
+ | 0.9338 | 1400 | 0.4104 | - | - | - | - | - |
450
+ | **1.0** | **1500** | **0.4018** | **0.7664 (+0.1751)** | **0.5023 (-0.0381)** | **0.3743 (+0.0492)** | **0.3538 (-0.1468)** | **0.4101 (-0.0452)** |
451
+ | -1 | -1 | - | 0.7664 (+0.1751) | 0.5023 (-0.0381) | 0.3743 (+0.0492) | 0.3538 (-0.1468) | 0.4101 (-0.0452) |
452
+
453
+ * The bold row denotes the saved checkpoint.
454
+
455
+ ### Training Time
456
+ - **Training**: 2.2 hours
457
+
458
+ ### Framework Versions
459
+ - Python: 3.12.13
460
+ - Sentence Transformers: 5.6.0
461
+ - Transformers: 5.13.1
462
+ - PyTorch: 2.11.0+cu128
463
+ - Accelerate: 1.14.0
464
+ - Datasets: 4.0.0
465
+ - Tokenizers: 0.22.2
466
+
467
+ ## Additional Resources
468
+
469
+ - [Training and Finetuning Reranker Models with Sentence Transformers](https://huggingface.co/blog/train-reranker): the end-to-end guide for training or finetuning Cross Encoder (reranker) models.
470
+ - [Multimodal Embedding & Reranker Models with Sentence Transformers](https://huggingface.co/blog/multimodal-sentence-transformers): use text, image, audio, and video reranker models through the same API.
471
+ - [Training and Finetuning Multimodal Embedding & Reranker Models with Sentence Transformers](https://huggingface.co/blog/train-multimodal-sentence-transformers): training multimodal Cross Encoders.
472
+
473
+ ## Citation
474
+
475
+ ### BibTeX
476
+
477
+ #### Sentence Transformers
478
+ ```bibtex
479
+ @inproceedings{reimers-2019-sentence-bert,
480
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
481
+ author = "Reimers, Nils and Gurevych, Iryna",
482
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
483
+ month = "11",
484
+ year = "2019",
485
+ publisher = "Association for Computational Linguistics",
486
+ url = "https://arxiv.org/abs/1908.10084",
487
+ }
488
+ ```
489
+
490
+ #### LambdaLoss
491
+ ```bibtex
492
+ @inproceedings{wang2018lambdaloss,
493
+ title={The LambdaLoss Framework for Ranking Metric Optimization},
494
+ author={Wang, Xuanhui and Li, Cheng and Golbandi, Nadav and Bendersky, Michael and Najork, Marc},
495
+ booktitle={Proceedings of the 27th ACM international conference on information and knowledge management},
496
+ pages={1313--1322},
497
+ year={2018}
498
+ }
499
+ ```
500
+
501
+ <!--
502
+ ## Glossary
503
+
504
+ *Clearly define terms in order to be accessible across audiences.*
505
+ -->
506
+
507
+ <!--
508
+ ## Model Card Authors
509
+
510
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
511
+ -->
512
+
513
+ <!--
514
+ ## Model Card Contact
515
+
516
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
517
+ -->
config.json ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ModernBertForSequenceClassification"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": null,
8
+ "classifier_activation": "gelu",
9
+ "classifier_bias": false,
10
+ "classifier_dropout": 0.0,
11
+ "classifier_pooling": "mean",
12
+ "cls_token_id": 50281,
13
+ "decoder_bias": true,
14
+ "deterministic_flash_attn": false,
15
+ "dtype": "float32",
16
+ "embedding_dropout": 0.0,
17
+ "eos_token_id": null,
18
+ "global_attn_every_n_layers": 3,
19
+ "gradient_checkpointing": false,
20
+ "hidden_activation": "gelu",
21
+ "hidden_size": 768,
22
+ "id2label": {
23
+ "0": "LABEL_0"
24
+ },
25
+ "initializer_cutoff_factor": 2.0,
26
+ "initializer_range": 0.02,
27
+ "intermediate_size": 1152,
28
+ "label2id": {
29
+ "LABEL_0": 0
30
+ },
31
+ "layer_norm_eps": 1e-05,
32
+ "layer_types": [
33
+ "full_attention",
34
+ "sliding_attention",
35
+ "sliding_attention",
36
+ "full_attention",
37
+ "sliding_attention",
38
+ "sliding_attention",
39
+ "full_attention",
40
+ "sliding_attention",
41
+ "sliding_attention",
42
+ "full_attention",
43
+ "sliding_attention",
44
+ "sliding_attention",
45
+ "full_attention",
46
+ "sliding_attention",
47
+ "sliding_attention",
48
+ "full_attention",
49
+ "sliding_attention",
50
+ "sliding_attention",
51
+ "full_attention",
52
+ "sliding_attention",
53
+ "sliding_attention",
54
+ "full_attention"
55
+ ],
56
+ "local_attention": 128,
57
+ "max_position_embeddings": 8192,
58
+ "mlp_bias": false,
59
+ "mlp_dropout": 0.0,
60
+ "model_type": "modernbert",
61
+ "norm_bias": false,
62
+ "norm_eps": 1e-05,
63
+ "num_attention_heads": 12,
64
+ "num_hidden_layers": 22,
65
+ "pad_token_id": 50283,
66
+ "position_embedding_type": "absolute",
67
+ "rope_parameters": {
68
+ "full_attention": {
69
+ "rope_theta": 160000.0,
70
+ "rope_type": "default"
71
+ },
72
+ "sliding_attention": {
73
+ "rope_theta": 10000.0,
74
+ "rope_type": "default"
75
+ }
76
+ },
77
+ "sep_token_id": 50282,
78
+ "sparse_pred_ignore_index": -100,
79
+ "sparse_prediction": false,
80
+ "tie_word_embeddings": true,
81
+ "transformers_version": "5.13.1",
82
+ "use_cache": false,
83
+ "vocab_size": 50368
84
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "pytorch": "2.11.0+cu128",
4
+ "sentence_transformers": "5.6.0",
5
+ "transformers": "5.13.1"
6
+ },
7
+ "activation_fn": "torch.nn.modules.activation.Sigmoid",
8
+ "default_prompt_name": null,
9
+ "model_type": "CrossEncoder",
10
+ "prompts": {}
11
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93e9b6ed7330f7b6ebdc3f9e6232fdc146f7b4ddc6fc306ec3ab93fb1b433c49
3
+ size 598436708
modules.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.base.modules.transformer.Transformer"
7
+ }
8
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "transformer_task": "sequence-classification",
3
+ "modality_config": {
4
+ "text": {
5
+ "method": "forward",
6
+ "method_output_name": "logits"
7
+ }
8
+ },
9
+ "module_output_name": "scores"
10
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "clean_up_tokenization_spaces": true,
4
+ "cls_token": "[CLS]",
5
+ "is_local": false,
6
+ "local_files_only": false,
7
+ "mask_token": "[MASK]",
8
+ "model_input_names": [
9
+ "input_ids",
10
+ "attention_mask"
11
+ ],
12
+ "model_max_length": 8192,
13
+ "pad_token": "[PAD]",
14
+ "sep_token": "[SEP]",
15
+ "tokenizer_class": "TokenizersBackend",
16
+ "unk_token": "[UNK]"
17
+ }