munish0838
commited on
Commit
•
b20cc05
1
Parent(s):
e62fa3d
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
|
4 |
+
license: llama3.1
|
5 |
+
base_model:
|
6 |
+
- meta-llama/Llama-3.1-8B
|
7 |
+
datasets:
|
8 |
+
- nvidia/OpenMathInstruct-2
|
9 |
+
language:
|
10 |
+
- en
|
11 |
+
tags:
|
12 |
+
- nvidia
|
13 |
+
- math
|
14 |
+
|
15 |
+
---
|
16 |
+
|
17 |
+
[![QuantFactory Banner](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)](https://hf.co/QuantFactory)
|
18 |
+
|
19 |
+
|
20 |
+
# QuantFactory/OpenMath2-Llama3.1-8B-GGUF
|
21 |
+
This is quantized version of [nvidia/OpenMath2-Llama3.1-8B](https://huggingface.co/nvidia/OpenMath2-Llama3.1-8B) created using llama.cpp
|
22 |
+
|
23 |
+
# Original Model Card
|
24 |
+
|
25 |
+
|
26 |
+
# OpenMath2-Llama3.1-8B
|
27 |
+
|
28 |
+
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).
|
29 |
+
|
30 |
+
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%.
|
31 |
+
|
32 |
+
<!-- <p align="center">
|
33 |
+
<img src="scaling_plot.jpg" width="350"><img src="math_level_comp.jpg" width="350">
|
34 |
+
</p> -->
|
35 |
+
|
36 |
+
<style>
|
37 |
+
.image-container {
|
38 |
+
display: flex;
|
39 |
+
justify-content: center;
|
40 |
+
align-items: center;
|
41 |
+
gap: 20px;
|
42 |
+
}
|
43 |
+
.image-container img {
|
44 |
+
width: 350px;
|
45 |
+
height: auto;
|
46 |
+
}
|
47 |
+
</style>
|
48 |
+
|
49 |
+
<div class="image-container">
|
50 |
+
<img src="scaling_plot.jpg" title="Performance of Llama-3.1-8B-Instruct as it is trained on increasing proportions of OpenMathInstruct-2">
|
51 |
+
<img src="math_level_comp.jpg" title="Comparison of OpenMath2-Llama3.1-8B vs. Llama-3.1-8B-Instruct across MATH levels">
|
52 |
+
</div>
|
53 |
+
|
54 |
+
| Model | GSM8K | MATH | AMC 2023 | AIME 2024 | Omni-MATH |
|
55 |
+
|:---|:---:|:---:|:---:|:---:|:---:|
|
56 |
+
| Llama3.1-8B-Instruct | 84.5 | 51.9 | 9/40 | 2/30 | 12.7 |
|
57 |
+
| **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 |
|
58 |
+
| + majority@256 | 94.1 | 76.1 | 23/40 | 3/30 | 24.6 |
|
59 |
+
| Llama3.1-70B-Instruct | 95.8 | 67.9 | 19/40 | 6/30 | 19.0 |
|
60 |
+
| 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 |
|
61 |
+
| + majority@256 | 96.0 | 79.6 | 24/40 | 6/30 | 27.6 |
|
62 |
+
|
63 |
+
The pipeline we used to produce the data and models is fully open-sourced!
|
64 |
+
|
65 |
+
- [Code](https://github.com/Kipok/NeMo-Skills)
|
66 |
+
- [Models](https://huggingface.co/collections/nvidia/openmath-2-66fb142317d86400783d2c7b)
|
67 |
+
- [Dataset](https://huggingface.co/datasets/nvidia/OpenMathInstruct-2)
|
68 |
+
|
69 |
+
See our [paper](https://arxiv.org/abs/2410.01560) to learn more details!
|
70 |
+
|
71 |
+
# How to use the models?
|
72 |
+
|
73 |
+
Our models are trained with the same "chat format" as Llama3.1-instruct models (same system/user/assistant tokens).
|
74 |
+
Please note that these models have not been instruction tuned on general data and thus might not provide good answers outside of math domain.
|
75 |
+
|
76 |
+
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
|
77 |
+
an example of how to do it through transformers api:
|
78 |
+
|
79 |
+
```python
|
80 |
+
import transformers
|
81 |
+
import torch
|
82 |
+
|
83 |
+
model_id = "nvidia/OpenMath2-Llama3.1-8B"
|
84 |
+
|
85 |
+
pipeline = transformers.pipeline(
|
86 |
+
"text-generation",
|
87 |
+
model=model_id,
|
88 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
89 |
+
device_map="auto",
|
90 |
+
)
|
91 |
+
|
92 |
+
messages = [
|
93 |
+
{
|
94 |
+
"role": "user",
|
95 |
+
"content": "Solve the following math problem. Make sure to put the answer (and only answer) inside \\boxed{}.\n\n" +
|
96 |
+
"What is the minimum value of $a^2+6a-7$?"},
|
97 |
+
]
|
98 |
+
|
99 |
+
outputs = pipeline(
|
100 |
+
messages,
|
101 |
+
max_new_tokens=4096,
|
102 |
+
)
|
103 |
+
print(outputs[0]["generated_text"][-1]['content'])
|
104 |
+
```
|
105 |
+
|
106 |
+
# Reproducing our results
|
107 |
+
|
108 |
+
We provide [all instructions](https://github.com/Kipok/NeMo-Skills/blob/main/docs/reproducing-results.md) to fully reproduce our results.
|
109 |
+
|
110 |
+
## Citation
|
111 |
+
|
112 |
+
If you find our work useful, please consider citing us!
|
113 |
+
|
114 |
+
```bibtex
|
115 |
+
@article{toshniwal2024openmath2,
|
116 |
+
title = {OpenMathInstruct-2: Accelerating AI for Math with Massive Open-Source Instruction Data},
|
117 |
+
author = {Shubham Toshniwal and Wei Du and Ivan Moshkov and Branislav Kisacanin and Alexan Ayrapetyan and Igor Gitman},
|
118 |
+
year = {2024},
|
119 |
+
journal = {arXiv preprint arXiv:2410.01560}
|
120 |
+
}
|
121 |
+
```
|
122 |
+
|
123 |
+
## Terms of use
|
124 |
+
|
125 |
+
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/)
|
126 |
+
|