File size: 5,476 Bytes
d1ff550
 
 
 
 
05aa86a
 
d1ff550
05aa86a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9cd3099
d1ff550
 
 
 
 
 
 
963f003
 
9cd3099
 
 
 
 
 
 
 
d1ff550
d2de66b
 
 
 
 
9cd3099
 
 
d2de66b
ebf0183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9cd3099
 
 
 
 
 
 
ebf0183
9cd3099
8ff98ca
9cd3099
8ff98ca
 
ebf0183
8ff98ca
ebf0183
9cd3099
8ff98ca
 
ebf0183
2ad076a
ebf0183
d2de66b
ebf0183
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
---
dataset_info:
  features:
  - name: output
    dtype: string
  - name: instruction
    dtype: string
  splits:
  - name: arithmetic.float2_train
    num_bytes: 645500.3
    num_examples: 19000
  - name: arithmetic.float2_valid
    num_bytes: 33973.7
    num_examples: 1000
  - name: arithmetic.float3_train
    num_bytes: 1890863.85
    num_examples: 47500
  - name: arithmetic.float3_valid
    num_bytes: 99519.15
    num_examples: 2500
  - name: arithmetic.float34_train
    num_bytes: 9321513.05
    num_examples: 218500
  - name: arithmetic.float34_valid
    num_bytes: 490605.95
    num_examples: 11500
  - name: arithmetic.float4_train
    num_bytes: 21671996.6
    num_examples: 475000
  - name: arithmetic.float4_valid
    num_bytes: 1140631.4
    num_examples: 25000
  download_size: 27928049
  dataset_size: 35294604
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
  - split: test
    path: data/test-*
tags:
- math
- finance
license: cc-by-nc-nd-4.0
task_categories:
- text-generation
- question-answering
pretty_name: Simple Math
size_categories:
- 100K<n<1M
---

# Simple Math

Just like my teacher gave me homework, i thought maybe we can also add some of these basics on the trainings of our models.

It was created with very simple code that is in the repo, if you add more complex operations and so.. **please share the code** :D thank you

Current Code Version: 20240127.fblgit (A modification over @win10 for progressive and DPO operation)

## Does it Works?
### 34BEAGLES Evaluation:
```
hf (pretrained=/data/models/UNA-34Beagles-v1-final,dtype=bfloat16,trust_remote_code=True), gen_kwargs: (None), limit: None, num_fewshot: None, batch_size: auto (8)
|    Tasks     |Version|Filter|n-shot| Metric |Value |   |Stderr|
|--------------|-------|------|-----:|--------|-----:|---|-----:|
|arc_challenge |Yaml   |none  |    25|acc     |0.7039|±  |0.0133|
|              |       |none  |    25|acc_norm|0.7321|±  |0.0129|
|truthfulqa_mc2|Yaml   |none  |     0|acc     |0.7387|±  |0.0141|

hf (pretrained=/data/models/UNA-34Beagles-v1-final,dtype=bfloat16,trust_remote_code=True), gen_kwargs: (None), limit: None, num_fewshot: None, batch_size: auto
|Tasks|Version|  Filter  |n-shot|  Metric   |Value |   |Stderr|
|-----|-------|----------|-----:|-----------|-----:|---|-----:|
|gsm8k|Yaml   |get-answer|     5|exact_match|0.6399|±  |0.0132|

|      Groups      |Version|Filter|n-shot|Metric|Value |   |Stderr|
|------------------|-------|------|-----:|------|-----:|---|-----:|
|mmlu              |N/A    |none  |     0|acc   |0.7477|±  |0.1079|
| - humanities     |N/A    |none  |     0|acc   |0.7188|±  |0.0855|
| - other          |N/A    |none  |     0|acc   |0.7950|±  |0.1057|
| - social_sciences|N/A    |none  |     0|acc   |0.8297|±  |0.0664|
| - stem           |N/A    |none  |     0|acc   |0.6641|±  |0.1291|
```

### 34BEAGLES-MATH Evaluation
```
hf (pretrained=/data/models/34BeaglesMath-v1,dtype=bfloat16,trust_remote_code=True), gen_kwargs: (None), limit: None, num_fewshot: None, batch_size: auto
|Tasks|Version|  Filter  |n-shot|  Metric   |Value |   |Stderr|
|-----|-------|----------|-----:|-----------|-----:|---|-----:|
|gsm8k|Yaml   |get-answer|     5|exact_match|0.6505|±  |0.0131|

hf (pretrained=/data/models/34BeaglesMath-v1,dtype=bfloat16,trust_remote_code=True), gen_kwargs: (None), limit: None, num_fewshot: None, batch_size: auto (8)
|    Tasks     |Version|Filter|n-shot| Metric |Value |   |Stderr|
|--------------|-------|------|-----:|--------|-----:|---|-----:|
|arc_challenge |Yaml   |none  |    25|acc     |0.7090|±  |0.0133|
|              |       |none  |    25|acc_norm|0.7329|±  |0.0129|
|truthfulqa_mc2|Yaml   |none  |     0|acc     |0.7378|±  |0.0141|

|      Groups      |Version|Filter|n-shot|Metric|Value |   |Stderr|
|------------------|-------|------|-----:|------|-----:|---|-----:|
|mmlu              |N/A    |none  |     0|acc   |0.7524|±  |0.1045|
| - humanities     |N/A    |none  |     0|acc   |0.7307|±  |0.0846|
| - other          |N/A    |none  |     0|acc   |0.7937|±  |0.1029|
| - social_sciences|N/A    |none  |     0|acc   |0.8274|±  |0.0667|
| - stem           |N/A    |none  |     0|acc   |0.6708|±  |0.1236|
```

But it gets better, because when increasing length and complexity, the marks are even superior:
```
|Tasks|Version|  Filter  |n-shot|  Metric   |Value |   |Stderr|
|-----|-------|----------|-----:|-----------|-----:|---|-----:|
|gsm8k|Yaml   |get-answer|     5|exact_match|0.6611|±  | 0.013|
```
On a 3.20% GSM Improvement compared to its base model.

## Note to contributors:
**thank you to those contributing on the experiment with beautiful commits and good spirit**

* Feel free to contribute on the readme Evaluation tests.
* Lets aim to build an ablation & paper together. All contributors will be cited.

## Versions
```
27.01.24 Added new code to generate the dataset, seed 42 and now also generates DPO.
24.01.24 Added gradual complexity on a separate script
20-23.01.24 Multiple contributions with operations and increased complexity on the main generator script.
```

## Citations
If you use Simple Math o train your model, please cite on the modelcard or the paper.

```
@misc{simplemath,
  title={Simple-Math: 2+2=4 4-1=3}, 
  author={Xavier Murias},
  year={2024},
  publisher = {Juanako.AI},
  journal = {HuggingFace repository},
  howpublished = {\url{https://huggingface.co/datasets/fblgit/simple-math}},
}
```