File size: 3,029 Bytes
c4d024d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26624a9
 
 
 
 
 
c4d024d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b689a9c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
base_model: h2oai/h2o-danube2-1.8b-base
datasets:
- TIGER-Lab/MathInstruct
language:
- en
library_name: transformers
tags:
- llama-factory
- unsloth
---
# h2o-danube2 with ChatML template

This model was first fine-tuned with [BAdam](https://arxiv.org/abs/2404.02827 "BAdam: A Memory Efficient Full Parameter Optimization Method for Large Language Models") on [TIGER-Lab/MathInstruct](https://huggingface.co/datasets/TIGER-Lab/MathInstruct) using LLama-Factory.

## Quants

Mad props, [mradermacher](https://huggingface.co/mradermacher)!

- [mradermacher/danube2-1.8b-MathInstruct-GGUF](https://huggingface.co/mradermacher/danube2-1.8b-MathInstruct-GGUF)

## Template

```jinja
<|im_start|>system
You are a helpful assistant specialised in mathematics.<|im_end|>
<|im_start|>user
{{instruction}}<|im_end|>
<|im_start|>assistant
{{response}}<|im_end|>
```

## BAdam config

```yaml
### model
model_name_or_path: danube2-base-chatml

### method
stage: sft
do_train: true
finetuning_type: full
use_badam: true
badam_switch_mode: ascending
badam_switch_interval: 50
badam_verbose: 1
badam_start_block: 7
seed: 5772

### dataset
dataset: mathinstruct
template: ninja_chatml
cutoff_len: 8192
overwrite_cache: false
preprocessing_num_workers: 12

### output
output_dir: mathinstruct-chatml-badam
logging_steps: 5
save_steps: 1
save_strategy: epoch
plot_loss: true
overwrite_output_dir: false

### train
per_device_train_batch_size: 4
gradient_accumulation_steps: 4
learning_rate: 0.000005
num_train_epochs: 1
lr_scheduler_type: cosine
warmup_ratio: 0.01
pure_bf16: true
flash_attn: fa2

### eval
val_size: 0.01
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 1000
```

### BAdam training results

| Training Loss | Epoch  | Step  | Validation Loss |
|:-------------:|:------:|:-----:|:---------------:|
| 0.2748        | 0.0617 | 1000  | 0.2788          |
| 0.2786        | 0.1234 | 2000  | 0.2503          |
| 0.18          | 0.1850 | 3000  | 0.2144          |
| 0.2015        | 0.2467 | 4000  | 0.1926          |
| 0.2044        | 0.3084 | 5000  | 0.1777          |
| 0.142         | 0.3701 | 6000  | 0.1661          |
| 0.1813        | 0.4317 | 7000  | 0.1570          |
| 0.1413        | 0.4934 | 8000  | 0.1529          |
| 0.1805        | 0.5551 | 9000  | 0.1462          |
| 0.1431        | 0.6168 | 10000 | 0.1410          |
| 0.1693        | 0.6784 | 11000 | 0.1375          |
| 0.1291        | 0.7401 | 12000 | 0.1357          |
| 0.1501        | 0.8018 | 13000 | 0.1348          |
| 0.1521        | 0.8635 | 14000 | 0.1345          |
| 0.1279        | 0.9251 | 15000 | 0.1346          |
| 0.1351        | 0.9868 | 16000 | 0.1344          |

### GSM8K results

|Tasks|Version|     Filter     |n-shot|  Metric   |Value |   |Stderr|
|-----|------:|----------------|-----:|-----------|-----:|---|-----:|
|gsm8k|      3|strict-match    |     5|exact_match|0.2691|±  |0.0122|
|     |       |flexible-extract|     5|exact_match|0.2752|±  |0.0123|

It matches the chat trained model from h2o.