davanstrien HF Staff commited on
Commit
81f3a54
·
verified ·
1 Parent(s): 65bc390

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +129 -106
README.md CHANGED
@@ -3,114 +3,137 @@ library_name: transformers
3
  license: apache-2.0
4
  base_model: answerdotai/ModernBERT-base
5
  tags:
6
- - generated_from_trainer
 
7
  datasets:
8
- - davanstrien/reasoning-required
9
  language:
10
  - en
11
- model-index:
12
- - name: modernbert-reasoning-required
13
- results: []
 
 
 
 
 
 
 
 
 
14
  ---
15
 
16
- # Modernbert-Reasoning-Required
17
-
18
- <img src="https://cdn-uploads.huggingface.co/production/uploads/60107b385ac3e86b3ea4fc34/vqCMlr4g95ysSAZ2eAn7D.png" alt="ModernBERT-based-Reasoning-Required illustration" width=500px>
19
-
20
-
21
- This model is a fine-tuned version of [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on the [davanstrien/reasoning-required](https://huggingface.co/datasets/davanstrien/reasoning-required) dataset.
22
- It achieves the following results on the evaluation set:
23
- - Loss: 0.2034
24
- - Mse: 0.2034
25
- - Mae: 0.2578
26
- - Spearman: 0.6963
27
- - High Mae: 0.1355
28
- - High Mse: 0.0831
29
-
30
- ## Model description
31
-
32
- More information needed
33
-
34
- ## Intended uses & limitations
35
-
36
- More information needed
37
-
38
- ## Training and evaluation data
39
-
40
- More information needed
41
-
42
- ## Training procedure
43
-
44
- ### Training hyperparameters
45
-
46
- The following hyperparameters were used during training:
47
- - learning_rate: 5e-05
48
- - train_batch_size: 16
49
- - eval_batch_size: 32
50
- - seed: 42
51
- - optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
52
- - lr_scheduler_type: linear
53
- - num_epochs: 10
54
-
55
- ### Training results
56
-
57
- | Training Loss | Epoch | Step | Validation Loss | Mse | Mae | Spearman | High Mae | High Mse |
58
- |:-------------:|:-----:|:----:|:---------------:|:------:|:------:|:--------:|:--------:|:--------:|
59
- | 0.619 | 0.2 | 50 | 0.2932 | 0.2932 | 0.3742 | 0.6209 | 0.2537 | 0.1183 |
60
- | 0.3229 | 0.4 | 100 | 0.3045 | 0.3045 | 0.4308 | 0.6303 | 0.3396 | 0.1437 |
61
- | 0.3032 | 0.6 | 150 | 0.2575 | 0.2575 | 0.3473 | 0.6785 | 0.2365 | 0.1040 |
62
- | 0.2609 | 0.8 | 200 | 0.2513 | 0.2513 | 0.3433 | 0.6764 | 0.2603 | 0.1442 |
63
- | 0.3414 | 1.0 | 250 | 0.2308 | 0.2308 | 0.3039 | 0.6732 | 0.1798 | 0.0894 |
64
- | 0.2337 | 1.2 | 300 | 0.2491 | 0.2491 | 0.3620 | 0.6669 | 0.2780 | 0.1358 |
65
- | 0.2665 | 1.4 | 350 | 0.2522 | 0.2522 | 0.3350 | 0.6803 | 0.2483 | 0.1660 |
66
- | 0.1984 | 1.6 | 400 | 0.2660 | 0.2660 | 0.3380 | 0.6836 | 0.1872 | 0.0689 |
67
- | 0.2587 | 1.8 | 450 | 0.2341 | 0.2341 | 0.3284 | 0.6852 | 0.2225 | 0.1109 |
68
- | 0.1862 | 2.0 | 500 | 0.2146 | 0.2146 | 0.2971 | 0.6927 | 0.1798 | 0.0821 |
69
- | 0.1218 | 2.2 | 550 | 0.2364 | 0.2364 | 0.3277 | 0.6888 | 0.2408 | 0.1480 |
70
- | 0.1232 | 2.4 | 600 | 0.2216 | 0.2216 | 0.3226 | 0.7030 | 0.2305 | 0.1221 |
71
- | 0.1651 | 2.6 | 650 | 0.2219 | 0.2219 | 0.3344 | 0.6868 | 0.2487 | 0.1190 |
72
- | 0.1631 | 2.8 | 700 | 0.2306 | 0.2306 | 0.3312 | 0.6918 | 0.2533 | 0.1495 |
73
- | 0.1024 | 3.0 | 750 | 0.2256 | 0.2256 | 0.3368 | 0.6882 | 0.2320 | 0.0966 |
74
- | 0.0713 | 3.2 | 800 | 0.2189 | 0.2189 | 0.2950 | 0.6878 | 0.1907 | 0.1121 |
75
- | 0.0608 | 3.4 | 850 | 0.2196 | 0.2196 | 0.2934 | 0.6981 | 0.1933 | 0.1178 |
76
- | 0.0656 | 3.6 | 900 | 0.2199 | 0.2199 | 0.3018 | 0.7047 | 0.2186 | 0.1358 |
77
- | 0.0774 | 3.8 | 950 | 0.2034 | 0.2034 | 0.2765 | 0.7033 | 0.1668 | 0.0962 |
78
- | 0.0507 | 4.0 | 1000 | 0.2142 | 0.2142 | 0.2726 | 0.6607 | 0.1283 | 0.0602 |
79
- | 0.0383 | 4.2 | 1050 | 0.2260 | 0.2260 | 0.3115 | 0.7006 | 0.1781 | 0.0642 |
80
- | 0.0481 | 4.4 | 1100 | 0.2198 | 0.2198 | 0.3510 | 0.6998 | 0.2959 | 0.1498 |
81
- | 0.0466 | 4.6 | 1150 | 0.2121 | 0.2121 | 0.3278 | 0.6813 | 0.2356 | 0.0976 |
82
- | 0.029 | 4.8 | 1200 | 0.2055 | 0.2055 | 0.2710 | 0.7043 | 0.1522 | 0.0857 |
83
- | 0.0355 | 5.0 | 1250 | 0.2016 | 0.2016 | 0.2751 | 0.7064 | 0.1707 | 0.0989 |
84
- | 0.0178 | 5.2 | 1300 | 0.2108 | 0.2108 | 0.2926 | 0.6538 | 0.1835 | 0.1015 |
85
- | 0.0321 | 5.4 | 1350 | 0.2053 | 0.2053 | 0.2824 | 0.7000 | 0.1876 | 0.1124 |
86
- | 0.0167 | 5.6 | 1400 | 0.1993 | 0.1993 | 0.2622 | 0.7052 | 0.1473 | 0.0886 |
87
- | 0.0243 | 5.8 | 1450 | 0.2052 | 0.2052 | 0.3119 | 0.6965 | 0.2269 | 0.1081 |
88
- | 0.0169 | 6.0 | 1500 | 0.2058 | 0.2058 | 0.2565 | 0.6841 | 0.1239 | 0.0734 |
89
- | 0.0103 | 6.2 | 1550 | 0.2006 | 0.2006 | 0.2639 | 0.6926 | 0.1496 | 0.0907 |
90
- | 0.0136 | 6.4 | 1600 | 0.2039 | 0.2039 | 0.2859 | 0.6873 | 0.1846 | 0.1002 |
91
- | 0.0093 | 6.6 | 1650 | 0.1995 | 0.1995 | 0.2685 | 0.7040 | 0.1654 | 0.1001 |
92
- | 0.0093 | 6.8 | 1700 | 0.2065 | 0.2065 | 0.2604 | 0.6920 | 0.1416 | 0.0932 |
93
- | 0.0095 | 7.0 | 1750 | 0.2056 | 0.2056 | 0.2618 | 0.7007 | 0.1476 | 0.0956 |
94
- | 0.0062 | 7.2 | 1800 | 0.2043 | 0.2043 | 0.2637 | 0.6919 | 0.1470 | 0.0918 |
95
- | 0.0052 | 7.4 | 1850 | 0.2018 | 0.2018 | 0.2593 | 0.6920 | 0.1453 | 0.0927 |
96
- | 0.0078 | 7.6 | 1900 | 0.2043 | 0.2043 | 0.2571 | 0.6849 | 0.1243 | 0.0699 |
97
- | 0.0064 | 7.8 | 1950 | 0.2094 | 0.2094 | 0.2565 | 0.6845 | 0.1156 | 0.0650 |
98
- | 0.0063 | 8.0 | 2000 | 0.2047 | 0.2047 | 0.2556 | 0.6861 | 0.1232 | 0.0703 |
99
- | 0.0038 | 8.2 | 2050 | 0.2056 | 0.2056 | 0.2541 | 0.6923 | 0.1245 | 0.0787 |
100
- | 0.0027 | 8.4 | 2100 | 0.2069 | 0.2069 | 0.2587 | 0.6908 | 0.1315 | 0.0792 |
101
- | 0.0025 | 8.6 | 2150 | 0.2041 | 0.2041 | 0.2576 | 0.6960 | 0.1351 | 0.0835 |
102
- | 0.0034 | 8.8 | 2200 | 0.2023 | 0.2023 | 0.2633 | 0.6974 | 0.1511 | 0.0920 |
103
- | 0.0029 | 9.0 | 2250 | 0.2034 | 0.2034 | 0.2589 | 0.6950 | 0.1369 | 0.0833 |
104
- | 0.002 | 9.2 | 2300 | 0.2029 | 0.2029 | 0.2591 | 0.6985 | 0.1398 | 0.0861 |
105
- | 0.0025 | 9.4 | 2350 | 0.2033 | 0.2033 | 0.2575 | 0.6969 | 0.1346 | 0.0824 |
106
- | 0.0011 | 9.6 | 2400 | 0.2042 | 0.2042 | 0.2572 | 0.6958 | 0.1314 | 0.0798 |
107
- | 0.0023 | 9.8 | 2450 | 0.2034 | 0.2034 | 0.2582 | 0.6951 | 0.1364 | 0.0836 |
108
- | 0.0006 | 10.0 | 2500 | 0.2034 | 0.2034 | 0.2578 | 0.6963 | 0.1355 | 0.0831 |
109
-
110
-
111
- ### Framework versions
112
-
113
- - Transformers 4.51.0
114
- - Pytorch 2.6.0+cu124
115
- - Datasets 3.5.0
116
- - Tokenizers 0.21.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  license: apache-2.0
4
  base_model: answerdotai/ModernBERT-base
5
  tags:
6
+ - reasoning
7
+ - reasoning-datasets-competition
8
  datasets:
9
+ - davanstrien/natural-reasoning-classifier
10
  language:
11
  - en
12
+ metrics:
13
+ - mse
14
+ - mae
15
+ - spearman
16
+ widget:
17
+ - text: >-
18
+ The debate on artificial intelligence's role in society has become
19
+ increasingly polarized. Some argue that AI will lead to widespread
20
+ unemployment and concentration of power, while others contend it will create
21
+ new jobs and democratize access to knowledge. These viewpoints reflect
22
+ different assumptions about technological development, economic systems, and
23
+ human adaptability.
24
  ---
25
 
26
+ # ModernBERT Reasoning Complexity Regressor
27
+
28
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/60107b385ac3e86b3ea4fc34/vqCMlr4g95ysSAZ2eAn7D.png" alt="ModernBERT-based Reasoning Complexity Regressor" width=500px>
29
+
30
+ ## Model Description
31
+
32
+ This model predicts the reasoning complexity level (0-4) required to engage with a given text. It's fine-tuned from [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on the [davanstrien/natural-reasoning-classifier](https://huggingface.co/datasets/davanstrien/natural-reasoning-classifier) dataset.
33
+
34
+ The reasoning complexity scale ranges from:
35
+
36
+ - **0: Minimal Reasoning** - Simple factual content requiring only recall
37
+ - **1: Basic Reasoning** - Straightforward connections or single-step logical processes
38
+ - **2: Intermediate Reasoning** - Integration of multiple factors or perspectives
39
+ - **3: Advanced Reasoning** - Sophisticated analysis across multiple dimensions
40
+ - **4: Expert Reasoning** - Theoretical frameworks and novel conceptual synthesis
41
+
42
+ ## Performance
43
+
44
+ The model achieves the following results on the evaluation set:
45
+
46
+ - MSE: 0.2034
47
+ - MAE: 0.2578
48
+ - Spearman Correlation: 0.6963
49
+
50
+ ## Intended Uses
51
+
52
+ This model can be used to:
53
+
54
+ - Filter and classify educational content by reasoning complexity
55
+ - Identify complex reasoning problems across diverse domains
56
+ - Serve as a first-stage filter in a reasoning dataset creation pipeline
57
+
58
+ ## Limitations
59
+
60
+ - Predictions are influenced by the original dataset's domain distribution
61
+ - Reasoning complexity is subjective and context-dependent
62
+
63
+
64
+ ## Training
65
+
66
+ The model was fine-tuned using a regression objective with the following settings:
67
+ - Learning rate: 5e-05
68
+ - Batch size: 16
69
+ - Optimizer: AdamW
70
+ - Schedule: Linear
71
+ - Epochs: 10
72
+
73
+ ## Usage Examples
74
+
75
+ ### Using the pipeline API
76
+
77
+ ```python
78
+ from transformers import pipeline
79
+ pipe = pipeline("text-classification", model="davanstrien/ModernBERT-based-Reasoning-Required")
80
+
81
+ def predict_reasoning_level(text, pipe):
82
+ # Get the raw prediction
83
+ result = pipe(text)
84
+ score = result[0]['score']
85
+
86
+ # Round to nearest integer (optional)
87
+ rounded_score = round(score)
88
+
89
+ # Clip to valid range (0-4)
90
+ rounded_score = max(0, min(4, rounded_score))
91
+
92
+ # Create a human-readable interpretation (optional)
93
+ reasoning_labels = {
94
+ 0: "No reasoning",
95
+ 1: "Basic reasoning",
96
+ 2: "Moderate reasoning",
97
+ 3: "Strong reasoning",
98
+ 4: "Advanced reasoning"
99
+ }
100
+
101
+ return {
102
+ "raw_score": score,
103
+ "reasoning_level": rounded_score,
104
+ "interpretation": reasoning_labels[rounded_score]
105
+ }
106
+
107
+ # Usage
108
+ text = "This argument uses multiple sources and evaluates competing perspectives before reaching a conclusion."
109
+ result = predict_reasoning_level(text, pipe)
110
+ print(f"Raw score: {result['raw_score']:.2f}")
111
+ print(f"Reasoning level: {result['reasoning_level']}")
112
+ print(f"Interpretation: {result['interpretation']}")
113
+ ```
114
+
115
+ ### Using the model directly
116
+
117
+ ```python
118
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
119
+ import torch
120
+
121
+ # Load model and tokenizer
122
+ model_name = "davanstrien/modernbert-reasoning-complexity"
123
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
124
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
125
+
126
+ # Prepare text
127
+ text = "The debate on artificial intelligence's role in society has become increasingly polarized."
128
+
129
+ # Tokenize and predict
130
+ inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
131
+ with torch.no_grad():
132
+ outputs = model(**inputs)
133
+
134
+ # Get regression score
135
+ complexity_score = outputs.logits.item()
136
+ print(f"Reasoning Complexity: {complexity_score:.2f}/4.00")
137
+ ```
138
+
139
+