uploaded readme
Browse files
README.md
ADDED
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Quantization made by Richard Erkhov.
|
2 |
+
|
3 |
+
[Github](https://github.com/RichardErkhov)
|
4 |
+
|
5 |
+
[Discord](https://discord.gg/pvy7H8DZMG)
|
6 |
+
|
7 |
+
[Request more models](https://github.com/RichardErkhov/quant_request)
|
8 |
+
|
9 |
+
|
10 |
+
OpenMath2-Llama3.1-8B - GGUF
|
11 |
+
- Model creator: https://huggingface.co/nvidia/
|
12 |
+
- Original model: https://huggingface.co/nvidia/OpenMath2-Llama3.1-8B/
|
13 |
+
|
14 |
+
|
15 |
+
| Name | Quant method | Size |
|
16 |
+
| ---- | ---- | ---- |
|
17 |
+
| [OpenMath2-Llama3.1-8B.Q2_K.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q2_K.gguf) | Q2_K | 2.96GB |
|
18 |
+
| [OpenMath2-Llama3.1-8B.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.IQ3_XS.gguf) | IQ3_XS | 3.28GB |
|
19 |
+
| [OpenMath2-Llama3.1-8B.IQ3_S.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.IQ3_S.gguf) | IQ3_S | 3.43GB |
|
20 |
+
| [OpenMath2-Llama3.1-8B.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q3_K_S.gguf) | Q3_K_S | 3.41GB |
|
21 |
+
| [OpenMath2-Llama3.1-8B.IQ3_M.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.IQ3_M.gguf) | IQ3_M | 3.52GB |
|
22 |
+
| [OpenMath2-Llama3.1-8B.Q3_K.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q3_K.gguf) | Q3_K | 3.74GB |
|
23 |
+
| [OpenMath2-Llama3.1-8B.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q3_K_M.gguf) | Q3_K_M | 3.74GB |
|
24 |
+
| [OpenMath2-Llama3.1-8B.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q3_K_L.gguf) | Q3_K_L | 4.03GB |
|
25 |
+
| [OpenMath2-Llama3.1-8B.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.IQ4_XS.gguf) | IQ4_XS | 4.18GB |
|
26 |
+
| [OpenMath2-Llama3.1-8B.Q4_0.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q4_0.gguf) | Q4_0 | 4.34GB |
|
27 |
+
| [OpenMath2-Llama3.1-8B.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.IQ4_NL.gguf) | IQ4_NL | 4.38GB |
|
28 |
+
| [OpenMath2-Llama3.1-8B.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q4_K_S.gguf) | Q4_K_S | 4.37GB |
|
29 |
+
| [OpenMath2-Llama3.1-8B.Q4_K.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q4_K.gguf) | Q4_K | 4.58GB |
|
30 |
+
| [OpenMath2-Llama3.1-8B.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q4_K_M.gguf) | Q4_K_M | 4.58GB |
|
31 |
+
| [OpenMath2-Llama3.1-8B.Q4_1.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q4_1.gguf) | Q4_1 | 4.78GB |
|
32 |
+
| [OpenMath2-Llama3.1-8B.Q5_0.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q5_0.gguf) | Q5_0 | 5.21GB |
|
33 |
+
| [OpenMath2-Llama3.1-8B.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q5_K_S.gguf) | Q5_K_S | 5.21GB |
|
34 |
+
| [OpenMath2-Llama3.1-8B.Q5_K.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q5_K.gguf) | Q5_K | 5.34GB |
|
35 |
+
| [OpenMath2-Llama3.1-8B.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q5_K_M.gguf) | Q5_K_M | 5.34GB |
|
36 |
+
| [OpenMath2-Llama3.1-8B.Q5_1.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q5_1.gguf) | Q5_1 | 5.65GB |
|
37 |
+
| [OpenMath2-Llama3.1-8B.Q6_K.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q6_K.gguf) | Q6_K | 6.14GB |
|
38 |
+
| [OpenMath2-Llama3.1-8B.Q8_0.gguf](https://huggingface.co/RichardErkhov/nvidia_-_OpenMath2-Llama3.1-8B-gguf/blob/main/OpenMath2-Llama3.1-8B.Q8_0.gguf) | Q8_0 | 7.95GB |
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
Original model description:
|
44 |
+
---
|
45 |
+
license: llama3.1
|
46 |
+
base_model:
|
47 |
+
- meta-llama/Llama-3.1-8B
|
48 |
+
datasets:
|
49 |
+
- nvidia/OpenMathInstruct-2
|
50 |
+
language:
|
51 |
+
- en
|
52 |
+
tags:
|
53 |
+
- nvidia
|
54 |
+
- math
|
55 |
+
library_name: transformers
|
56 |
+
---
|
57 |
+
|
58 |
+
# OpenMath2-Llama3.1-8B
|
59 |
+
|
60 |
+
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).
|
61 |
+
|
62 |
+
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%.
|
63 |
+
|
64 |
+
<!-- <p align="center">
|
65 |
+
<img src="scaling_plot.jpg" width="350"><img src="math_level_comp.jpg" width="350">
|
66 |
+
</p> -->
|
67 |
+
|
68 |
+
<style>
|
69 |
+
.image-container {
|
70 |
+
display: flex;
|
71 |
+
justify-content: center;
|
72 |
+
align-items: center;
|
73 |
+
gap: 20px;
|
74 |
+
}
|
75 |
+
.image-container img {
|
76 |
+
width: 350px;
|
77 |
+
height: auto;
|
78 |
+
}
|
79 |
+
</style>
|
80 |
+
|
81 |
+
<div class="image-container">
|
82 |
+
<img src="scaling_plot.jpg" title="Performance of Llama-3.1-8B-Instruct as it is trained on increasing proportions of OpenMathInstruct-2">
|
83 |
+
<img src="math_level_comp.jpg" title="Comparison of OpenMath2-Llama3.1-8B vs. Llama-3.1-8B-Instruct across MATH levels">
|
84 |
+
</div>
|
85 |
+
|
86 |
+
| Model | GSM8K | MATH | AMC 2023 | AIME 2024 | Omni-MATH |
|
87 |
+
|:---|:---:|:---:|:---:|:---:|:---:|
|
88 |
+
| Llama3.1-8B-Instruct | 84.5 | 51.9 | 9/40 | 2/30 | 12.7 |
|
89 |
+
| **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 |
|
90 |
+
| + majority@256 | 94.1 | 76.1 | 23/40 | 3/30 | 24.6 |
|
91 |
+
| Llama3.1-70B-Instruct | 95.8 | 67.9 | 19/40 | 6/30 | 19.0 |
|
92 |
+
| 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 |
|
93 |
+
| + majority@256 | 96.0 | 79.6 | 24/40 | 6/30 | 27.6 |
|
94 |
+
|
95 |
+
The pipeline we used to produce the data and models is fully open-sourced!
|
96 |
+
|
97 |
+
- [Code](https://github.com/Kipok/NeMo-Skills)
|
98 |
+
- [Models](https://huggingface.co/collections/nvidia/openmath-2-66fb142317d86400783d2c7b)
|
99 |
+
- [Dataset](https://huggingface.co/datasets/nvidia/OpenMathInstruct-2)
|
100 |
+
|
101 |
+
See our [paper](https://arxiv.org/abs/2410.01560) to learn more details!
|
102 |
+
|
103 |
+
# How to use the models?
|
104 |
+
|
105 |
+
Our models are trained with the same "chat format" as Llama3.1-instruct models (same system/user/assistant tokens).
|
106 |
+
Please note that these models have not been instruction tuned on general data and thus might not provide good answers outside of math domain.
|
107 |
+
|
108 |
+
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
|
109 |
+
an example of how to do it through transformers api:
|
110 |
+
|
111 |
+
```python
|
112 |
+
import transformers
|
113 |
+
import torch
|
114 |
+
|
115 |
+
model_id = "nvidia/OpenMath2-Llama3.1-8B"
|
116 |
+
|
117 |
+
pipeline = transformers.pipeline(
|
118 |
+
"text-generation",
|
119 |
+
model=model_id,
|
120 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
121 |
+
device_map="auto",
|
122 |
+
)
|
123 |
+
|
124 |
+
messages = [
|
125 |
+
{
|
126 |
+
"role": "user",
|
127 |
+
"content": "Solve the following math problem. Make sure to put the answer (and only answer) inside \\boxed{}.\n\n" +
|
128 |
+
"What is the minimum value of $a^2+6a-7$?"},
|
129 |
+
]
|
130 |
+
|
131 |
+
outputs = pipeline(
|
132 |
+
messages,
|
133 |
+
max_new_tokens=4096,
|
134 |
+
)
|
135 |
+
print(outputs[0]["generated_text"][-1]['content'])
|
136 |
+
```
|
137 |
+
|
138 |
+
# Reproducing our results
|
139 |
+
|
140 |
+
We provide [all instructions](https://github.com/Kipok/NeMo-Skills/blob/main/docs/reproducing-results.md) to fully reproduce our results.
|
141 |
+
|
142 |
+
## Citation
|
143 |
+
|
144 |
+
If you find our work useful, please consider citing us!
|
145 |
+
|
146 |
+
```bibtex
|
147 |
+
@article{toshniwal2024openmath2,
|
148 |
+
title = {OpenMathInstruct-2: Accelerating AI for Math with Massive Open-Source Instruction Data},
|
149 |
+
author = {Shubham Toshniwal and Wei Du and Ivan Moshkov and Branislav Kisacanin and Alexan Ayrapetyan and Igor Gitman},
|
150 |
+
year = {2024},
|
151 |
+
journal = {arXiv preprint arXiv:2410.01560}
|
152 |
+
}
|
153 |
+
```
|
154 |
+
|
155 |
+
## Terms of use
|
156 |
+
|
157 |
+
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/)
|
158 |
+
|