Update README.md
Browse files
README.md
CHANGED
@@ -7,42 +7,39 @@ tags:
|
|
7 |
metrics:
|
8 |
- accuracy
|
9 |
model-index:
|
10 |
-
- name: ModernBERT-base-zeroshot-v2.0
|
11 |
results: []
|
12 |
---
|
13 |
|
14 |
-
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
15 |
-
should probably proofread and complete it, then remove this comment. -->
|
16 |
|
17 |
-
# ModernBERT-base-zeroshot-v2.0
|
18 |
-
|
19 |
-
This model is a fine-tuned version of [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on an unknown dataset.
|
20 |
-
It achieves the following results on the evaluation set:
|
21 |
-
- Loss: 0.1856
|
22 |
-
- F1 Macro: 0.6373
|
23 |
-
- F1 Micro: 0.7076
|
24 |
-
- Accuracy Balanced: 0.6761
|
25 |
-
- Accuracy: 0.7076
|
26 |
-
- Precision Macro: 0.6700
|
27 |
-
- Recall Macro: 0.6761
|
28 |
-
- Precision Micro: 0.7076
|
29 |
-
- Recall Micro: 0.7076
|
30 |
|
31 |
## Model description
|
32 |
|
33 |
-
|
|
|
|
|
34 |
|
35 |
-
##
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
-
More information needed
|
38 |
|
39 |
-
## Training
|
40 |
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
-
## Training procedure
|
44 |
|
45 |
-
|
46 |
|
47 |
The following hyperparameters were used during training:
|
48 |
- learning_rate: 5e-05
|
@@ -54,25 +51,8 @@ The following hyperparameters were used during training:
|
|
54 |
- lr_scheduler_warmup_ratio: 0.06
|
55 |
- num_epochs: 2
|
56 |
|
57 |
-
### Training results
|
58 |
-
|
59 |
-
| Training Loss | Epoch | Step | Validation Loss | F1 Macro | F1 Micro | Accuracy Balanced | Accuracy | Precision Macro | Recall Macro | Precision Micro | Recall Micro |
|
60 |
-
|:-------------:|:-----:|:-----:|:---------------:|:--------:|:--------:|:-----------------:|:--------:|:---------------:|:------------:|:---------------:|:------------:|
|
61 |
-
| 0.2321 | 1.0 | 33915 | 0.3726 | 0.8316 | 0.8458 | 0.8332 | 0.8458 | 0.8301 | 0.8332 | 0.8458 | 0.8458 |
|
62 |
-
| 0.1305 | 2.0 | 67830 | 0.4350 | 0.8396 | 0.8541 | 0.8389 | 0.8541 | 0.8403 | 0.8389 | 0.8541 | 0.8541 |
|
63 |
-
|
64 |
-
|
65 |
-
Per-dataset breakdown:
|
66 |
-
|
67 |
-
|Datasets|Mean|Mean w/o NLI|mnli_m|mnli_mm|fevernli|anli_r1|anli_r2|anli_r3|wanli|lingnli|wellformedquery|rottentomatoes|amazonpolarity|imdb|yelpreviews|hatexplain|massive|banking77|emotiondair|emocontext|empathetic|agnews|yahootopics|biasframes_sex|biasframes_offensive|biasframes_intent|financialphrasebank|appreviews|hateoffensive|trueteacher|spam|wikitoxic_toxicaggregated|wikitoxic_obscene|wikitoxic_identityhate|wikitoxic_threat|wikitoxic_insult|manifesto|capsotu|
|
68 |
-
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
69 |
-
|Accuracy|0.831|0.835|0.932|0.936|0.884|0.763|0.647|0.657|0.823|0.889|0.753|0.864|0.949|0.935|0.974|0.798|0.788|0.727|0.789|0.793|0.489|0.893|0.717|0.927|0.851|0.859|0.907|0.952|0.926|0.726|0.978|0.912|0.914|0.93|0.951|0.906|0.476|0.708|
|
70 |
-
|F1 macro|0.813|0.818|0.925|0.93|0.872|0.74|0.61|0.611|0.81|0.874|0.751|0.864|0.949|0.935|0.974|0.751|0.738|0.746|0.733|0.798|0.475|0.893|0.712|0.919|0.851|0.859|0.892|0.952|0.847|0.721|0.966|0.912|0.914|0.93|0.942|0.906|0.329|0.637|
|
71 |
-
|Inference text/sec (GPU, batch=128)|3472.0|3474.0|2338.0|4416.0|2993.0|2959.0|2904.0|3003.0|4647.0|4486.0|5032.0|4354.0|2466.0|1140.0|1582.0|4392.0|5446.0|5296.0|4904.0|4787.0|2251.0|4042.0|1884.0|4048.0|4032.0|4121.0|4275.0|3746.0|4485.0|1114.0|4322.0|2260.0|2274.0|2189.0|2085.0|2410.0|3933.0|4388.0|
|
72 |
-
|
73 |
-
|
74 |
|
75 |
-
|
76 |
|
77 |
- Transformers 4.48.0.dev0
|
78 |
- Pytorch 2.5.1+cu124
|
|
|
7 |
metrics:
|
8 |
- accuracy
|
9 |
model-index:
|
10 |
+
- name: ModernBERT-base-zeroshot-v2.0
|
11 |
results: []
|
12 |
---
|
13 |
|
|
|
|
|
14 |
|
15 |
+
# ModernBERT-base-zeroshot-v2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
## Model description
|
18 |
|
19 |
+
This model is [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base)
|
20 |
+
fine-tuned on the same dataset mix as the `zeroshot-v2.0` models in the [Zeroshot Classifiers Collection](https://huggingface.co/collections/MoritzLaurer/zeroshot-classifiers-6548b4ff407bb19ff5c3ad6f).
|
21 |
+
|
22 |
|
23 |
+
## General takeaways:
|
24 |
+
- The model is very fast and memory efficient. It's multiple times faster and consumes multiple times less memory than DeBERTav3.
|
25 |
+
The memory efficiency enables larger batch sizes. I got a ~2x speed increase by enabling bf16 (instead of fp16).
|
26 |
+
- It performs slightly worse then DeBERTav3 on average on the tasks tested below.
|
27 |
+
- I'm in the process of preparing a newer version trained on better synthetic data to make full use of the 8k context window
|
28 |
+
and to update the training mix of the older `zeroshot-v2.0` models.
|
29 |
|
|
|
30 |
|
31 |
+
## Training results
|
32 |
|
33 |
+
Per-dataset breakdown:
|
34 |
+
|
35 |
+
|Datasets|Mean|Mean w/o NLI|mnli_m|mnli_mm|fevernli|anli_r1|anli_r2|anli_r3|wanli|lingnli|wellformedquery|rottentomatoes|amazonpolarity|imdb|yelpreviews|hatexplain|massive|banking77|emotiondair|emocontext|empathetic|agnews|yahootopics|biasframes_sex|biasframes_offensive|biasframes_intent|financialphrasebank|appreviews|hateoffensive|trueteacher|spam|wikitoxic_toxicaggregated|wikitoxic_obscene|wikitoxic_identityhate|wikitoxic_threat|wikitoxic_insult|manifesto|capsotu|
|
36 |
+
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
37 |
+
|Accuracy|0.831|0.835|0.932|0.936|0.884|0.763|0.647|0.657|0.823|0.889|0.753|0.864|0.949|0.935|0.974|0.798|0.788|0.727|0.789|0.793|0.489|0.893|0.717|0.927|0.851|0.859|0.907|0.952|0.926|0.726|0.978|0.912|0.914|0.93|0.951|0.906|0.476|0.708|
|
38 |
+
|F1 macro|0.813|0.818|0.925|0.93|0.872|0.74|0.61|0.611|0.81|0.874|0.751|0.864|0.949|0.935|0.974|0.751|0.738|0.746|0.733|0.798|0.475|0.893|0.712|0.919|0.851|0.859|0.892|0.952|0.847|0.721|0.966|0.912|0.914|0.93|0.942|0.906|0.329|0.637|
|
39 |
+
|Inference text/sec (A100 40GB GPU, batch=128)|3472.0|3474.0|2338.0|4416.0|2993.0|2959.0|2904.0|3003.0|4647.0|4486.0|5032.0|4354.0|2466.0|1140.0|1582.0|4392.0|5446.0|5296.0|4904.0|4787.0|2251.0|4042.0|1884.0|4048.0|4032.0|4121.0|4275.0|3746.0|4485.0|1114.0|4322.0|2260.0|2274.0|2189.0|2085.0|2410.0|3933.0|4388.0|
|
40 |
|
|
|
41 |
|
42 |
+
## Training hyperparameters
|
43 |
|
44 |
The following hyperparameters were used during training:
|
45 |
- learning_rate: 5e-05
|
|
|
51 |
- lr_scheduler_warmup_ratio: 0.06
|
52 |
- num_epochs: 2
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
+
## Framework versions
|
56 |
|
57 |
- Transformers 4.48.0.dev0
|
58 |
- Pytorch 2.5.1+cu124
|