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- en
|
9 |
+
tags:
|
10 |
+
- nvidia
|
11 |
+
- math
|
12 |
+
library_name: transformers
|
13 |
+
---
|
14 |
+
|
15 |
+
# <span style="color: #7FFF7F;">OpenMath2-Llama3.1-8B GGUF Models</span>
|
16 |
+
|
17 |
+
|
18 |
+
## <span style="color: #7F7FFF;">Model Generation Details</span>
|
19 |
+
|
20 |
+
This model was generated using [llama.cpp](https://github.com/ggerganov/llama.cpp) at commit [`b9c3eefd`](https://github.com/ggerganov/llama.cpp/commit/b9c3eefde1b67104bd993485ff38dd62abe9d70c).
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
---
|
27 |
+
|
28 |
+
## <span style="color: #7FFF7F;">Quantization Beyond the IMatrix</span>
|
29 |
+
|
30 |
+
I've been experimenting with a new quantization approach that selectively elevates the precision of key layers beyond what the default IMatrix configuration provides.
|
31 |
+
|
32 |
+
In my testing, standard IMatrix quantization underperforms at lower bit depths, especially with Mixture of Experts (MoE) models. To address this, I'm using the `--tensor-type` option in `llama.cpp` to manually "bump" important layers to higher precision. You can see the implementation here:
|
33 |
+
👉 [Layer bumping with llama.cpp](https://github.com/Mungert69/GGUFModelBuilder/blob/main/model-converter/tensor_list_builder.py)
|
34 |
+
|
35 |
+
While this does increase model file size, it significantly improves precision for a given quantization level.
|
36 |
+
|
37 |
+
### **I'd love your feedback—have you tried this? How does it perform for you?**
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
---
|
43 |
+
|
44 |
+
<a href="https://readyforquantum.com/huggingface_gguf_selection_guide.html" style="color: #7FFF7F;">
|
45 |
+
Click here to get info on choosing the right GGUF model format
|
46 |
+
</a>
|
47 |
+
|
48 |
+
---
|
49 |
+
|
50 |
+
|
51 |
+
|
52 |
+
<!--Begin Original Model Card-->
|
53 |
+
|
54 |
+
|
55 |
+
# OpenMath2-Llama3.1-8B
|
56 |
+
|
57 |
+
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).
|
58 |
+
|
59 |
+
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%.
|
60 |
+
|
61 |
+
<!-- <p align="center">
|
62 |
+
<img src="scaling_plot.jpg" width="350"><img src="math_level_comp.jpg" width="350">
|
63 |
+
</p> -->
|
64 |
+
|
65 |
+
<style>
|
66 |
+
.image-container {
|
67 |
+
display: flex;
|
68 |
+
justify-content: center;
|
69 |
+
align-items: center;
|
70 |
+
gap: 20px;
|
71 |
+
}
|
72 |
+
.image-container img {
|
73 |
+
width: 350px;
|
74 |
+
height: auto;
|
75 |
+
}
|
76 |
+
</style>
|
77 |
+
|
78 |
+
<div class="image-container">
|
79 |
+
<img src="scaling_plot.jpg" title="Performance of Llama-3.1-8B-Instruct as it is trained on increasing proportions of OpenMathInstruct-2">
|
80 |
+
<img src="math_level_comp.jpg" title="Comparison of OpenMath2-Llama3.1-8B vs. Llama-3.1-8B-Instruct across MATH levels">
|
81 |
+
</div>
|
82 |
+
|
83 |
+
| Model | GSM8K | MATH | AMC 2023 | AIME 2024 | Omni-MATH |
|
84 |
+
|:---|:---:|:---:|:---:|:---:|:---:|
|
85 |
+
| Llama3.1-8B-Instruct | 84.5 | 51.9 | 9/40 | 2/30 | 12.7 |
|
86 |
+
| **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 |
|
87 |
+
| + majority@256 | 94.1 | 76.1 | 23/40 | 3/30 | 24.6 |
|
88 |
+
| Llama3.1-70B-Instruct | 95.8 | 67.9 | 19/40 | 6/30 | 19.0 |
|
89 |
+
| 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 |
|
90 |
+
| + majority@256 | 96.0 | 79.6 | 24/40 | 6/30 | 27.6 |
|
91 |
+
|
92 |
+
The pipeline we used to produce the data and models is fully open-sourced!
|
93 |
+
|
94 |
+
- [Code](https://github.com/NVIDIA/NeMo-Skills)
|
95 |
+
- [Models](https://huggingface.co/collections/nvidia/openmath-2-66fb142317d86400783d2c7b)
|
96 |
+
- [Dataset](https://huggingface.co/datasets/nvidia/OpenMathInstruct-2)
|
97 |
+
|
98 |
+
See our [paper](https://arxiv.org/abs/2410.01560) to learn more details!
|
99 |
+
|
100 |
+
# How to use the models?
|
101 |
+
|
102 |
+
Our models are trained with the same "chat format" as Llama3.1-instruct models (same system/user/assistant tokens).
|
103 |
+
Please note that these models have not been instruction tuned on general data and thus might not provide good answers outside of math domain.
|
104 |
+
|
105 |
+
We recommend using [instructions in our repo](https://github.com/NVIDIA/NeMo-Skills/blob/main/docs/basics/inference.md) to run inference with these models, but here is
|
106 |
+
an example of how to do it through transformers api:
|
107 |
+
|
108 |
+
```python
|
109 |
+
import transformers
|
110 |
+
import torch
|
111 |
+
|
112 |
+
model_id = "nvidia/OpenMath2-Llama3.1-8B"
|
113 |
+
|
114 |
+
pipeline = transformers.pipeline(
|
115 |
+
"text-generation",
|
116 |
+
model=model_id,
|
117 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
118 |
+
device_map="auto",
|
119 |
+
)
|
120 |
+
|
121 |
+
messages = [
|
122 |
+
{
|
123 |
+
"role": "user",
|
124 |
+
"content": "Solve the following math problem. Make sure to put the answer (and only answer) inside \\boxed{}.\n\n" +
|
125 |
+
"What is the minimum value of $a^2+6a-7$?"},
|
126 |
+
]
|
127 |
+
|
128 |
+
outputs = pipeline(
|
129 |
+
messages,
|
130 |
+
max_new_tokens=4096,
|
131 |
+
)
|
132 |
+
print(outputs[0]["generated_text"][-1]['content'])
|
133 |
+
```
|
134 |
+
|
135 |
+
# Reproducing our results
|
136 |
+
|
137 |
+
We provide [all instructions](https://nvidia.github.io/NeMo-Skills/openmathinstruct2/) to fully reproduce our results.
|
138 |
+
|
139 |
+
## Citation
|
140 |
+
|
141 |
+
If you find our work useful, please consider citing us!
|
142 |
+
|
143 |
+
```bibtex
|
144 |
+
@article{toshniwal2024openmath2,
|
145 |
+
title = {OpenMathInstruct-2: Accelerating AI for Math with Massive Open-Source Instruction Data},
|
146 |
+
author = {Shubham Toshniwal and Wei Du and Ivan Moshkov and Branislav Kisacanin and Alexan Ayrapetyan and Igor Gitman},
|
147 |
+
year = {2024},
|
148 |
+
journal = {arXiv preprint arXiv:2410.01560}
|
149 |
+
}
|
150 |
+
```
|
151 |
+
|
152 |
+
## Terms of use
|
153 |
+
|
154 |
+
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/)
|
155 |
+
|
156 |
+
<!--End Original Model Card-->
|
157 |
+
|
158 |
+
---
|
159 |
+
|
160 |
+
# <span id="testllm" style="color: #7F7FFF;">🚀 If you find these models useful</span>
|
161 |
+
|
162 |
+
Help me test my **AI-Powered Quantum Network Monitor Assistant** with **quantum-ready security checks**:
|
163 |
+
|
164 |
+
👉 [Quantum Network Monitor](https://readyforquantum.com/?assistant=open&utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme)
|
165 |
+
|
166 |
+
|
167 |
+
The full Open Source Code for the Quantum Network Monitor Service available at my github repos ( repos with NetworkMonitor in the name) : [Source Code Quantum Network Monitor](https://github.com/Mungert69). You will also find the code I use to quantize the models if you want to do it yourself [GGUFModelBuilder](https://github.com/Mungert69/GGUFModelBuilder)
|
168 |
+
|
169 |
+
💬 **How to test**:
|
170 |
+
Choose an **AI assistant type**:
|
171 |
+
- `TurboLLM` (GPT-4.1-mini)
|
172 |
+
- `HugLLM` (Hugginface Open-source models)
|
173 |
+
- `TestLLM` (Experimental CPU-only)
|
174 |
+
|
175 |
+
### **What I’m Testing**
|
176 |
+
I’m pushing the limits of **small open-source models for AI network monitoring**, specifically:
|
177 |
+
- **Function calling** against live network services
|
178 |
+
- **How small can a model go** while still handling:
|
179 |
+
- Automated **Nmap security scans**
|
180 |
+
- **Quantum-readiness checks**
|
181 |
+
- **Network Monitoring tasks**
|
182 |
+
|
183 |
+
🟡 **TestLLM** – Current experimental model (llama.cpp on 2 CPU threads on huggingface docker space):
|
184 |
+
- ✅ **Zero-configuration setup**
|
185 |
+
- ⏳ 30s load time (slow inference but **no API costs**) . No token limited as the cost is low.
|
186 |
+
- 🔧 **Help wanted!** If you’re into **edge-device AI**, let’s collaborate!
|
187 |
+
|
188 |
+
### **Other Assistants**
|
189 |
+
🟢 **TurboLLM** – Uses **gpt-4.1-mini** :
|
190 |
+
- **It performs very well but unfortunatly OpenAI charges per token. For this reason tokens usage is limited.
|
191 |
+
- **Create custom cmd processors to run .net code on Quantum Network Monitor Agents**
|
192 |
+
- **Real-time network diagnostics and monitoring**
|
193 |
+
- **Security Audits**
|
194 |
+
- **Penetration testing** (Nmap/Metasploit)
|
195 |
+
|
196 |
+
🔵 **HugLLM** – Latest Open-source models:
|
197 |
+
- 🌐 Runs on Hugging Face Inference API. Performs pretty well using the lastest models hosted on Novita.
|
198 |
+
|
199 |
+
### 💡 **Example commands you could test**:
|
200 |
+
1. `"Give me info on my websites SSL certificate"`
|
201 |
+
2. `"Check if my server is using quantum safe encyption for communication"`
|
202 |
+
3. `"Run a comprehensive security audit on my server"`
|
203 |
+
4. '"Create a cmd processor to .. (what ever you want)" Note you need to install a [Quantum Network Monitor Agent](https://readyforquantum.com/Download/?utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme) to run the .net code on. This is a very flexible and powerful feature. Use with caution!
|
204 |
+
|
205 |
+
### Final Word
|
206 |
+
|
207 |
+
I fund the servers used to create these model files, run the Quantum Network Monitor service, and pay for inference from Novita and OpenAI—all out of my own pocket. All the code behind the model creation and the Quantum Network Monitor project is [open source](https://github.com/Mungert69). Feel free to use whatever you find helpful.
|
208 |
+
|
209 |
+
If you appreciate the work, please consider [buying me a coffee](https://www.buymeacoffee.com/mahadeva) ☕. Your support helps cover service costs and allows me to raise token limits for everyone.
|
210 |
+
|
211 |
+
I'm also open to job opportunities or sponsorship.
|
212 |
+
|
213 |
+
Thank you! 😊
|