Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +114 -0
- openmath2-llama3.1-8b.Q4_0.gguf +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
openmath2-llama3.1-8b.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: llama3.1
|
3 |
+
base_model:
|
4 |
+
- meta-llama/Llama-3.1-8B
|
5 |
+
datasets:
|
6 |
+
- nvidia/OpenMathInstruct-2
|
7 |
+
language:
|
8 |
+
- en
|
9 |
+
tags:
|
10 |
+
- nvidia
|
11 |
+
- math
|
12 |
+
library_name: transformers
|
13 |
+
---
|
14 |
+
|
15 |
+
# OpenMath2-Llama3.1-8B
|
16 |
+
|
17 |
+
OpenMath2-Llama3.1-8B is obtained by finetuning [Llama3.1-8B-Base](https://huggingface.co/meta-llama/Llama-3.1-8B) with [OpenMathInstruct-2](https://huggingface.co/datasets/nvidia/OpenMathInstruct-2).
|
18 |
+
|
19 |
+
The model outperforms [Llama3.1-8B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct) on all the popular math benchmarks we evaluate on, especially on [MATH](https://github.com/hendrycks/math) by 15.9%.
|
20 |
+
|
21 |
+
<!-- <p align="center">
|
22 |
+
<img src="scaling_plot.jpg" width="350"><img src="math_level_comp.jpg" width="350">
|
23 |
+
</p> -->
|
24 |
+
|
25 |
+
<style>
|
26 |
+
.image-container {
|
27 |
+
display: flex;
|
28 |
+
justify-content: center;
|
29 |
+
align-items: center;
|
30 |
+
gap: 20px;
|
31 |
+
}
|
32 |
+
.image-container img {
|
33 |
+
width: 350px;
|
34 |
+
height: auto;
|
35 |
+
}
|
36 |
+
</style>
|
37 |
+
|
38 |
+
<div class="image-container">
|
39 |
+
<img src="scaling_plot.jpg" title="Performance of Llama-3.1-8B-Instruct as it is trained on increasing proportions of OpenMathInstruct-2">
|
40 |
+
<img src="math_level_comp.jpg" title="Comparison of OpenMath2-Llama3.1-8B vs. Llama-3.1-8B-Instruct across MATH levels">
|
41 |
+
</div>
|
42 |
+
|
43 |
+
| Model | GSM8K | MATH | AMC 2023 | AIME 2024 | Omni-MATH |
|
44 |
+
|:---|:---:|:---:|:---:|:---:|:---:|
|
45 |
+
| Llama3.1-8B-Instruct | 84.5 | 51.9 | 9/40 | 2/30 | 12.7 |
|
46 |
+
| **OpenMath2-Llama3.1-8B** ([nemo](https://huggingface.co/nvidia/OpenMath2-Llama3.1-8B-nemo) \| [HF](https://huggingface.co/nvidia/OpenMath2-Llama3.1-8B)) | 91.7 | 67.8 | 16/40 | 3/30 | 22.0 |
|
47 |
+
| + majority@256 | 94.1 | 76.1 | 23/40 | 3/30 | 24.6 |
|
48 |
+
| Llama3.1-70B-Instruct | 95.8 | 67.9 | 19/40 | 6/30 | 19.0 |
|
49 |
+
| OpenMath2-Llama3.1-70B ([nemo](https://huggingface.co/nvidia/OpenMath2-Llama3.1-70B-nemo) \| [HF](https://huggingface.co/nvidia/OpenMath2-Llama3.1-70B)) | 94.9 | 71.9 | 20/40 | 4/30 | 23.1 |
|
50 |
+
| + majority@256 | 96.0 | 79.6 | 24/40 | 6/30 | 27.6 |
|
51 |
+
|
52 |
+
The pipeline we used to produce the data and models is fully open-sourced!
|
53 |
+
|
54 |
+
- [Code](https://github.com/Kipok/NeMo-Skills)
|
55 |
+
- [Models](https://huggingface.co/collections/nvidia/openmath-2-66fb142317d86400783d2c7b)
|
56 |
+
- [Dataset](https://huggingface.co/datasets/nvidia/OpenMathInstruct-2)
|
57 |
+
|
58 |
+
See our [paper](https://arxiv.org/abs/2410.01560) to learn more details!
|
59 |
+
|
60 |
+
# How to use the models?
|
61 |
+
|
62 |
+
Our models are trained with the same "chat format" as Llama3.1-instruct models (same system/user/assistant tokens).
|
63 |
+
Please note that these models have not been instruction tuned on general data and thus might not provide good answers outside of math domain.
|
64 |
+
|
65 |
+
We recommend using [instructions in our repo](https://github.com/Kipok/NeMo-Skills/blob/main/docs/inference.md) to run inference with these models, but here is
|
66 |
+
an example of how to do it through transformers api:
|
67 |
+
|
68 |
+
```python
|
69 |
+
import transformers
|
70 |
+
import torch
|
71 |
+
|
72 |
+
model_id = "nvidia/OpenMath2-Llama3.1-8B"
|
73 |
+
|
74 |
+
pipeline = transformers.pipeline(
|
75 |
+
"text-generation",
|
76 |
+
model=model_id,
|
77 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
78 |
+
device_map="auto",
|
79 |
+
)
|
80 |
+
|
81 |
+
messages = [
|
82 |
+
{
|
83 |
+
"role": "user",
|
84 |
+
"content": "Solve the following math problem. Make sure to put the answer (and only answer) inside \\boxed{}.\n\n" +
|
85 |
+
"What is the minimum value of $a^2+6a-7$?"},
|
86 |
+
]
|
87 |
+
|
88 |
+
outputs = pipeline(
|
89 |
+
messages,
|
90 |
+
max_new_tokens=4096,
|
91 |
+
)
|
92 |
+
print(outputs[0]["generated_text"][-1]['content'])
|
93 |
+
```
|
94 |
+
|
95 |
+
# Reproducing our results
|
96 |
+
|
97 |
+
We provide [all instructions](https://github.com/Kipok/NeMo-Skills/blob/main/docs/reproducing-results.md) to fully reproduce our results.
|
98 |
+
|
99 |
+
## Citation
|
100 |
+
|
101 |
+
If you find our work useful, please consider citing us!
|
102 |
+
|
103 |
+
```bibtex
|
104 |
+
@article{toshniwal2024openmath2,
|
105 |
+
title = {OpenMathInstruct-2: Accelerating AI for Math with Massive Open-Source Instruction Data},
|
106 |
+
author = {Shubham Toshniwal and Wei Du and Ivan Moshkov and Branislav Kisacanin and Alexan Ayrapetyan and Igor Gitman},
|
107 |
+
year = {2024},
|
108 |
+
journal = {arXiv preprint arXiv:2410.01560}
|
109 |
+
}
|
110 |
+
```
|
111 |
+
|
112 |
+
## Terms of use
|
113 |
+
|
114 |
+
By accessing this model, you are agreeing to the LLama 3.1 terms and conditions of the [license](https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE), [acceptable use policy](https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/USE_POLICY.md) and [Meta’s privacy policy](https://www.facebook.com/privacy/policy/)
|
openmath2-llama3.1-8b.Q4_0.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:73b0aba7191bfc3270a736fcef179d1066aaf3bd316fd48eb7a660b091d32bbc
|
3 |
+
size 4661216416
|