aashish1904 commited on
Commit
8e008ce
·
verified ·
1 Parent(s): 563d189

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +341 -0
README.md ADDED
@@ -0,0 +1,341 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ library_name: transformers
5
+ license: other
6
+ license_name: nvidia-open-model-license
7
+ license_link: >-
8
+ https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/
9
+
10
+ pipeline_tag: text-generation
11
+ language:
12
+ - en
13
+ tags:
14
+ - nvidia
15
+ - llama-3
16
+ - pytorch
17
+
18
+ ---
19
+
20
+ [![QuantFactory Banner](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)](https://hf.co/QuantFactory)
21
+
22
+
23
+ # QuantFactory/Llama-3.1-Nemotron-Nano-8B-v1-GGUF
24
+ This is quantized version of [nvidia/Llama-3.1-Nemotron-Nano-8B-v1](https://huggingface.co/nvidia/Llama-3.1-Nemotron-Nano-8B-v1) created using llama.cpp
25
+
26
+ # Original Model Card
27
+
28
+
29
+ # Llama-3.1-Nemotron-Nano-8B-v1
30
+
31
+
32
+ ## Model Overview
33
+
34
+ Llama-3.1-Nemotron-Nano-8B-v1 is a large language model (LLM) which is a derivative of [Meta Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct) (AKA the reference model). It is a reasoning model that is post trained for reasoning, human chat preferences, and tasks, such as RAG and tool calling.
35
+
36
+ Llama-3.1-Nemotron-Nano-8B-v1 is a model which offers a great tradeoff between model accuracy and efficiency. It is created from Llama 3.1 8B Instruct and offers improvements in model accuracy. The model fits on a single RTX GPU and can be used locally. The model supports a context length of 128K.
37
+
38
+ This model underwent a multi-phase post-training process to enhance both its reasoning and non-reasoning capabilities. This includes a supervised fine-tuning stage for Math, Code, Reasoning, and Tool Calling as well as multiple reinforcement learning (RL) stages using REINFORCE (RLOO) and Online Reward-aware Preference Optimization (RPO) algorithms for both chat and instruction-following. The final model checkpoint is obtained after merging the final SFT and Online RPO checkpoints. Improved using Qwen.
39
+
40
+ This model is part of the Llama Nemotron Collection. You can find the other model(s) in this family here:
41
+ [Llama-3.3-Nemotron-Super-49B-v1](https://huggingface.co/nvidia/Llama-3.3-Nemotron-Super-49B-v1)
42
+
43
+ This model is ready for commercial use.
44
+
45
+ ## License/Terms of Use
46
+
47
+ GOVERNING TERMS: Your use of this model is governed by the [NVIDIA Open Model License](https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/). Additional Information: [Llama 3.1 Community License Agreement](https://www.llama.com/llama3_1/license/). Built with Llama.
48
+
49
+ **Model Developer:** NVIDIA
50
+
51
+ **Model Dates:** Trained between August 2024 and March 2025
52
+
53
+ **Data Freshness:** The pretraining data has a cutoff of 2023 per Meta Llama 3.1 8B
54
+
55
+
56
+ ## Use Case:
57
+
58
+ Developers designing AI Agent systems, chatbots, RAG systems, and other AI-powered applications. Also suitable for typical instruction-following tasks. Balance of model accuracy and compute efficiency (the model fits on a single RTX GPU and can be used locally).
59
+
60
+ ## Release Date: <br>
61
+ 3/18/2025 <br>
62
+
63
+ ## References
64
+
65
+ - [\[2502.00203\] Reward-aware Preference Optimization: A Unified Mathematical Framework for Model Alignment](https://arxiv.org/abs/2502.00203)
66
+
67
+
68
+ ## Model Architecture
69
+
70
+ **Architecture Type:** Dense decoder-only Transformer model
71
+
72
+ **Network Architecture:** Llama 3.1 8B Instruct
73
+
74
+ ## Intended use
75
+
76
+ Llama-3.1-Nemotron-Nano-8B-v1 is a general purpose reasoning and chat model intended to be used in English and coding languages. Other non-English languages (German, French, Italian, Portuguese, Hindi, Spanish, and Thai) are also supported.
77
+
78
+ # Input:
79
+ - **Input Type:** Text
80
+ - **Input Format:** String
81
+ - **Input Parameters:** One-Dimensional (1D)
82
+ - **Other Properties Related to Input:** Context length up to 131,072 tokens
83
+
84
+ ## Output:
85
+ - **Output Type:** Text
86
+ - **Output Format:** String
87
+ - **Output Parameters:** One-Dimensional (1D)
88
+ - **Other Properties Related to Output:** Context length up to 131,072 tokens
89
+
90
+ ## Model Version:
91
+ 1.0 (3/18/2025)
92
+
93
+ ## Software Integration
94
+ - **Runtime Engine:** NeMo 24.12 <br>
95
+ - **Recommended Hardware Microarchitecture Compatibility:**
96
+ - NVIDIA Hopper
97
+ - NVIDIA Ampere
98
+
99
+ ## Quick Start and Usage Recommendations:
100
+
101
+ 1. Reasoning mode (ON/OFF) is controlled via the system prompt, which must be set as shown in the example below. All instructions should be contained within the user prompt
102
+ 2. We recommend setting temperature to `0.6`, and Top P to `0.95` for Reasoning ON mode
103
+ 3. We recommend using greedy decoding for Reasoning OFF mode
104
+ 4. We have provided a list of prompts to use for evaluation for each benchmark where a specific template is required
105
+
106
+ You can try this model out through the preview API, using this link: [Llama-3.1-Nemotron-Nano-8B-v1](https://build.nvidia.com/nvidia/llama-3_1-nemotron-nano-8b-v1).
107
+
108
+ See the snippet below for usage with Hugging Face Transformers library. Reasoning mode (ON/OFF) is controlled via system prompt. Please see the example below.
109
+ Our code requires the transformers package version to be `4.44.2` or higher.
110
+
111
+
112
+ ### Example of “Reasoning On:”
113
+
114
+ ```python
115
+ import torch
116
+ import transformers
117
+
118
+ model_id = "nvidia/Llama-3.1-Nemotron-Nano-8B-v1"
119
+ model_kwargs = {"torch_dtype": torch.bfloat16, "device_map": "auto"}
120
+ tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
121
+ tokenizer.pad_token_id = tokenizer.eos_token_id
122
+
123
+ pipeline = transformers.pipeline(
124
+ "text-generation",
125
+ model=model_id,
126
+ tokenizer=tokenizer,
127
+ max_new_tokens=32768,
128
+ temperature=0.6,
129
+ top_p=0.95,
130
+ **model_kwargs
131
+ )
132
+
133
+ # Thinking can be "on" or "off"
134
+ thinking = "on"
135
+
136
+ print(pipeline([{"role": "system", "content": f"detailed thinking {thinking}"}, {"role": "user", "content": "Solve x*(sin(x)+2)=0"}]))
137
+ ```
138
+
139
+
140
+ ### Example of “Reasoning Off:”
141
+
142
+ ```python
143
+ import torch
144
+ import transformers
145
+
146
+ model_id = "nvidia/Llama-3.1-Nemotron-Nano-8B-v1"
147
+ model_kwargs = {"torch_dtype": torch.bfloat16, "device_map": "auto"}
148
+ tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
149
+ tokenizer.pad_token_id = tokenizer.eos_token_id
150
+
151
+ pipeline = transformers.pipeline(
152
+ "text-generation",
153
+ model=model_id,
154
+ tokenizer=tokenizer,
155
+ max_new_tokens=32768,
156
+ do_sample=False,
157
+ **model_kwargs
158
+ )
159
+
160
+ # Thinking can be "on" or "off"
161
+ thinking = "off"
162
+
163
+ print(pipeline([{"role": "system", "content": f"detailed thinking {thinking}"}, {"role": "user", "content": "Solve x*(sin(x)+2)=0"}]))
164
+ ```
165
+
166
+ For some prompts, even though thinking is disabled, the model emergently prefers to think before responding. But if desired, the users can prevent it by pre-filling the assistant response.
167
+
168
+ ```python
169
+ import torch
170
+ import transformers
171
+
172
+ model_id = "nvidia/Llama-3.1-Nemotron-Nano-8B-v1"
173
+ model_kwargs = {"torch_dtype": torch.bfloat16, "device_map": "auto"}
174
+ tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
175
+ tokenizer.pad_token_id = tokenizer.eos_token_id
176
+
177
+ # Thinking can be "on" or "off"
178
+ thinking = "off"
179
+
180
+ pipeline = transformers.pipeline(
181
+ "text-generation",
182
+ model=model_id,
183
+ tokenizer=tokenizer,
184
+ max_new_tokens=32768,
185
+ do_sample=False,
186
+ **model_kwargs
187
+ )
188
+
189
+ print(pipeline([{"role": "system", "content": f"detailed thinking {thinking}"}, {"role": "user", "content": "Solve x*(sin(x)+2)=0"}, {"role":"assistant", "content":"<think>\n</think>"}]))
190
+ ```
191
+
192
+ ## Inference:
193
+ **Engine:** Transformers
194
+ **Test Hardware:**
195
+
196
+ - BF16:
197
+ - 1x RTX 50 Series GPUs
198
+ - 1x RTX 40 Series GPUs
199
+ - 1x RTX 30 Series GPUs
200
+ - 1x H100-80GB GPU
201
+ - 1x A100-80GB GPU
202
+
203
+
204
+ **Preferred/Supported] Operating System(s):** Linux <br>
205
+
206
+ ## Training Datasets
207
+
208
+ A large variety of training data was used for the post-training pipeline, including manually annotated data and synthetic data.
209
+
210
+ The data for the multi-stage post-training phases for improvements in Code, Math, and Reasoning is a compilation of SFT and RL data that supports improvements of math, code, general reasoning, and instruction following capabilities of the original Llama instruct model.
211
+
212
+ Prompts have been sourced from either public and open corpus or synthetically generated. Responses were synthetically generated by a variety of models, with some prompts containing responses for both Reasoning On and Off modes, to train the model to distinguish between two modes.
213
+
214
+ **Data Collection for Training Datasets:** <br>
215
+ * Hybrid: Automated, Human, Synthetic <br>
216
+
217
+ **Data Labeling for Training Datasets:** <br>
218
+ * N/A <br>
219
+
220
+ ## Evaluation Datasets
221
+
222
+ We used the datasets listed below to evaluate Llama-3.1-Nemotron-Nano-8B-v1.
223
+
224
+ **Data Collection for Evaluation Datasets:** Hybrid: Human/Synthetic
225
+
226
+ **Data Labeling for Evaluation Datasets:** Hybrid: Human/Synthetic/Automatic
227
+
228
+ ## Evaluation Results
229
+
230
+ These results contain both “Reasoning On”, and “Reasoning Off”. We recommend using temperature=`0.6`, top_p=`0.95` for “Reasoning On” mode, and greedy decoding for “Reasoning Off” mode. All evaluations are done with 32k sequence length. We run the benchmarks up to 16 times and average the scores to be more accurate.
231
+
232
+ > NOTE: Where applicable, a Prompt Template will be provided. While completing benchmarks, please ensure that you are parsing for the correct output format as per the provided prompt in order to reproduce the benchmarks seen below.
233
+
234
+ ### MT-Bench
235
+
236
+ | Reasoning Mode | Score |
237
+ |--------------|------------|
238
+ | Reasoning Off | 7.9 |
239
+ | Reasoning On | 8.1 |
240
+
241
+
242
+ ### MATH500
243
+
244
+ | Reasoning Mode | pass@1 |
245
+ |--------------|------------|
246
+ | Reasoning Off | 36.6% |
247
+ | Reasoning On | 95.4% |
248
+
249
+ User Prompt Template:
250
+
251
+ ```
252
+ "Below is a math question. I want you to reason through the steps and then give a final answer. Your final answer should be in \boxed{}.\nQuestion: {question}"
253
+ ```
254
+
255
+
256
+ ### AIME25
257
+
258
+ | Reasoning Mode | pass@1 |
259
+ |--------------|------------|
260
+ | Reasoning Off | 0% |
261
+ | Reasoning On | 47.1% |
262
+
263
+ User Prompt Template:
264
+
265
+ ```
266
+ "Below is a math question. I want you to reason through the steps and then give a final answer. Your final answer should be in \boxed{}.\nQuestion: {question}"
267
+ ```
268
+
269
+
270
+ ### GPQA-D
271
+
272
+ | Reasoning Mode | pass@1 |
273
+ |--------------|------------|
274
+ | Reasoning Off | 39.4% |
275
+ | Reasoning On | 54.1% |
276
+
277
+ User Prompt Template:
278
+
279
+
280
+ ```
281
+ "What is the correct answer to this question: {question}\nChoices:\nA. {option_A}\nB. {option_B}\nC. {option_C}\nD. {option_D}\nLet's think step by step, and put the final answer (should be a single letter A, B, C, or D) into a \boxed{}"
282
+ ```
283
+
284
+
285
+ ### IFEval Average
286
+
287
+ | Reasoning Mode | Strict:Prompt | Strict:Instruction |
288
+ |--------------|------------|------------|
289
+ | Reasoning Off | 74.7% | 82.1% |
290
+ | Reasoning On | 71.9% | 79.3% |
291
+
292
+ ### BFCL v2 Live
293
+
294
+ | Reasoning Mode | Score |
295
+ |--------------|------------|
296
+ | Reasoning Off | 63.9% |
297
+ | Reasoning On | 63.6% |
298
+
299
+ User Prompt Template:
300
+
301
+
302
+ ```
303
+ <AVAILABLE_TOOLS>{functions}</AVAILABLE_TOOLS>
304
+
305
+ {user_prompt}
306
+ ```
307
+
308
+
309
+ ### MBPP 0-shot
310
+
311
+ | Reasoning Mode | pass@1 |
312
+ |--------------|------------|
313
+ | Reasoning Off | 66.1% |
314
+ | Reasoning On | 84.6% |
315
+
316
+ User Prompt Template:
317
+
318
+
319
+ ````
320
+ You are an exceptionally intelligent coding assistant that consistently delivers accurate and reliable responses to user instructions.
321
+
322
+ @@ Instruction
323
+ Here is the given problem and test examples:
324
+ {prompt}
325
+ Please use the python programming language to solve this problem.
326
+ Please make sure that your code includes the functions from the test samples and that the input and output formats of these functions match the test samples.
327
+ Please return all completed codes in one code block.
328
+ This code block should be in the following format:
329
+ ```python
330
+ # Your codes here
331
+ ```
332
+ ````
333
+
334
+
335
+ ## Ethical Considerations:
336
+
337
+ NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
338
+
339
+ For more detailed information on ethical considerations for this model, please see the Model Card++ [Explainability](explainability.md), [Bias](bias.md), [Safety & Security](safety.md), and [Privacy](privacy.md) Subcards.
340
+
341
+ Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).