empero-ai commited on
Commit
6d3ef83
·
verified ·
1 Parent(s): 726a566

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +73 -726
README.md CHANGED
@@ -35,780 +35,127 @@ base_model:
35
  **Model Developer:** NVIDIA Corporation
36
 
37
  **Model Dates:**
38
-
39
  June 2025 \- August 2025
40
 
41
  **Data Freshness:**
42
-
43
  September 2024
44
 
45
  The pretraining data has a cutoff date of September 2024.
 
46
 
47
- ## Model Overview
48
-
49
- NVIDIA-Nemotron-Nano-9B-v2 is a large language model (LLM) trained from scratch by NVIDIA, and designed as a unified model for both reasoning and non-reasoning tasks. It responds to user queries and tasks by first generating a reasoning trace and then concluding with a final response. The model's reasoning capabilities can be controlled via a system prompt. If the user prefers the model to provide its final answer without intermediate reasoning traces, it can be configured to do so, albeit with a slight decrease in accuracy for harder prompts that require reasoning. Conversely, allowing the model to generate reasoning traces first generally results in higher-quality final solutions to queries and tasks.
50
-
51
- The model uses a hybrid architecture consisting primarily of Mamba-2 and MLP layers combined with just four Attention layers. For the architecture, please refer to the [Nemotron-H tech report](https://arxiv.org/abs/2504.03624).
52
- The model was trained using [Megatron-LM](https://github.com/NVIDIA/Megatron-LM) and [NeMo-RL](https://github.com/NVIDIA-NeMo/RL).
53
-
54
- The supported languages include: English, German, Spanish, French, Italian, and Japanese. Improved using Qwen.
55
-
56
- This model is ready for commercial use.
57
-
58
- ## Feature Voting
59
-
60
- We want to hear from you! Share your ideas, vote on what matters, and help [shape the future of Nemotron](https://nemotron.ideas.nvidia.com/).
61
-
62
- ## License/Terms of Use
63
-
64
- Governing Terms: Use of this model is governed by the [NVIDIA Open Model License Agreement](https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/).
65
-
66
- ## Evaluation Results
67
-
68
- ### Benchmark Results (Reasoning On)
69
-
70
- We evaluated our model in **Reasoning-On** mode across all benchmarks, except RULER, which is evaluated in **Reasoning-Off** mode.
71
-
72
-
73
- | Benchmark | Qwen3-8B | NVIDIA-Nemotron-Nano-9B-v2 |
74
- | :---- | ----: | ----: |
75
- | AIME25 | 69.3% | 72.1% |
76
- | MATH500 | 96.3% | 97.8% |
77
- | GPQA | 59.6% | 64.0% |
78
- | LCB | 59.5% | 71.1% |
79
- | BFCL v3 | 66.3% | 66.9% |
80
- | IFEval (Instruction Strict) | 89.4% | 90.3% |
81
- | HLE | 4.4% | 6.5% |
82
- | RULER (128K) | 74.1% | 78.9% |
83
-
84
-
85
- All evaluations were done using [NeMo-Skills](https://github.com/NVIDIA/NeMo-Skills). We published a [tutorial](https://nvidia.github.io/NeMo-Skills/tutorials/2025/08/22/reproducing-nvidia-nemotron-nano-9b-v2-evals/) with all details necessary to reproduce our evaluation results.
86
-
87
-
88
- ## Reasoning Budget Control
89
-
90
- This model supports runtime “thinking” budget control. During inference, the user can specify how many tokens the model is allowed to "think".
91
-
92
- ![](./acc-vs-budget.png)
93
-
94
-
95
- ## Model Architecture
96
-
97
- - Architecture Type: Mamba2-Transformer Hybrid
98
- - Network Architecture: Nemotron-Hybrid
99
-
100
- ### Deployment Geography: Global
101
 
102
- ### Use Case
103
 
104
- NVIDIA-Nemotron-Nano-9B-v2 is a general purpose reasoning and chat model intended to be used in English and coding languages. Other non-English languages (German, French, Italian, Spanish and Japanese) are also supported. Developers designing AI Agent systems, chatbots, RAG systems, and other AI-powered applications. Also suitable for typical instruction-following tasks.
105
 
106
- ### Release Date: 08/18/2025
107
-
108
- - Huggingface 08/18/2025 via https://huggingface.co/nvidia/NVIDIA-Nemotron-Nano-9B-v2
109
- - API Catalog 08/18/2025 via https://build.nvidia.com/nvidia/nvidia-nemotron-nano-9b-v2
110
-
111
- ## References
112
-
113
- - [NVIDIA Nemotron Nano 2: An Accurate and Efficient Hybrid Mamba-Transformer Reasoning Model](https://arxiv.org/abs/2508.14444)
114
-
115
-
116
- ## Input
117
-
118
- - Input Type(s): Text
119
- - Input Format(s): String
120
- - Input Parameters: One-Dimensional (1D): Sequences
121
- - Other Properties Related to Input: Context length up to 128K. Supported languages include German, Spanish, French, Italian, Korean, Portuguese, Russian, Japanese, Chinese and English.
122
 
123
- ## Output
124
 
125
- - Output Type(s): Text
126
- - Output Format: String
127
- - Output Parameters: One-Dimensional (1D): Sequences up to 128K
128
 
129
- Our models are designed and optimized to run on NVIDIA GPU-accelerated systems. By leveraging NVIDIA’s hardware (e.g. GPU cores) and software frameworks (e.g., CUDA libraries), the model achieves faster training and inference times compared to CPU-only solutions.
 
 
130
 
131
- ## Software Integration
132
 
133
- - Runtime Engine(s): NeMo 25.07.nemotron-nano-v2
134
- - Supported Hardware Microarchitecture Compatibility: NVIDIA A10G, NVIDIA H100-80GB, NVIDIA A100, Jetson AGX Thor
135
- - Operating System(s): Linux
136
 
 
 
 
 
 
 
 
 
137
 
138
- ### **Use it with Transformers**
139
 
140
- The snippet below shows how to use this model with Huggingface Transformers (tested on version 4.48.3).
141
 
142
- ```
143
  import torch
144
- from transformers import AutoTokenizer, AutoModelForCausalLM
145
-
146
- # Load tokenizer and model
147
- tokenizer = AutoTokenizer.from_pretrained("nvidia/NVIDIA-Nemotron-Nano-9B-v2")
148
- model = AutoModelForCausalLM.from_pretrained(
149
- "nvidia/NVIDIA-Nemotron-Nano-9B-v2",
150
- torch_dtype=torch.bfloat16,
151
- trust_remote_code=True,
152
- device_map="auto"
153
- )
154
- ```
155
-
156
- Case 1: `/think` or no reasoning signal is provided in the system prompt, reasoning will be set to `True`
157
-
158
- ```
159
- messages = [
160
- {"role": "system", "content": "/think"},
161
- {"role": "user", "content": "Write a haiku about GPUs"},
162
- ]
163
- ```
164
-
165
- Case 2: `/no_think` is provided, reasoning will be set to `False`
166
-
167
- ```
168
- messages = [
169
- {"role": "system", "content": "/no_think"},
170
- {"role": "user", "content": "Write a haiku about GPUs"},
171
- ]
172
- ```
173
-
174
- Note: `/think` or `/no_think` keywords can also be provided in “user” messages for turn-level reasoning control.
175
-
176
- The rest of the inference snippet remains the same
177
-
178
- ```
179
- tokenized_chat = tokenizer.apply_chat_template(
180
- messages,
181
- tokenize=True,
182
- add_generation_prompt=True,
183
- return_tensors="pt"
184
- ).to(model.device)
185
-
186
- outputs = model.generate(
187
- tokenized_chat,
188
- max_new_tokens=32,
189
- eos_token_id=tokenizer.eos_token_id
190
- )
191
- print(tokenizer.decode(outputs[0]))
192
- ```
193
-
194
- We recommend setting `temperature` to `0.6`, `top_p` to `0.95` for reasoning True and greedy search for reasoning False, and increase `max_new_tokens` to `1024` or higher for reasoning True.
195
-
196
- ### **Use it with TRT-LLM**
197
 
198
- The snippet below shows how to use this model with TRT-LLM. We tested this on the following [commit](https://github.com/NVIDIA/TensorRT-LLM/tree/46c5a564446673cdd0f56bcda938d53025b6d04e) and followed these [instructions](https://github.com/NVIDIA/TensorRT-LLM/blob/46c5a564446673cdd0f56bcda938d53025b6d04e/docs/source/installation/build-from-source-linux.md#option-2-build-tensorrt-llm-step-by-step) to build and install TRT-LLM in a docker container.
199
-
200
- ```
201
- from tensorrt_llm import SamplingParams
202
- from tensorrt_llm._torch import LLM
203
- from tensorrt_llm._torch.pyexecutor.config import PyTorchConfig
204
- from tensorrt_llm.llmapi import KvCacheConfig
205
- from transformers import AutoTokenizer
206
- pytorch_config = PyTorchConfig(
207
- disable_overlap_scheduler=True, enable_trtllm_decoder=True
208
- )
209
- kv_cache_config = KvCacheConfig(
210
- enable_block_reuse=False,
211
  )
212
- ```
213
 
214
- ```
215
- model_id = "nvidia/NVIDIA-Nemotron-Nano-9B-v2"
216
- tokenizer = AutoTokenizer.from_pretrained(model_id)
217
-
218
- llm = LLM(
219
- model=model_id,
220
- max_seq_len=32678,
221
- max_batch_size=4,
222
- pytorch_backend_config=pytorch_config,
223
- kv_cache_config=kv_cache_config,
224
- tensor_parallel_size=8,
225
- )
226
- messages = [
227
- {"role": "system", "content": "/think"},
228
- {"role": "user", "content": "Write a haiku about GPUs"},
229
- ]
230
- prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
231
- sampling_params = SamplingParams(
232
- max_tokens=512,
233
- temperature=0.6,
234
- top_p=0.95,
235
- add_special_tokens=False,
236
  )
237
- outputs = llm.generate([prompt], sampling_params)
238
- print(outputs[0].outputs[0].text)
239
- ```
240
 
241
- ### **Use it with vLLM**
242
-
243
- The snippet below shows how to use this model with vLLM. Use the latest version of vLLM and follow these instructions to build and install vLLM.
244
-
245
- ```shell
246
- pip install -U "vllm>=0.10.1"
247
- ```
248
-
249
- Now you can run run the server with:
250
-
251
- ```shell
252
- vllm serve nvidia/NVIDIA-Nemotron-Nano-9B-v2 \
253
- --trust-remote-code \
254
- --max-num-seqs 64 \
255
- --mamba_ssm_cache_dtype float32
256
- ```
257
-
258
- Note:
259
- - Remember to add \`--mamba\_ssm\_cache\_dtype float32\` for accurate quality. Without this option, the model’s accuracy may degrade.
260
- - If you encounter a CUDA OOM issue, try `--max-num-seqs 64` and consider lower the value further if the error persists.
261
-
262
-
263
-
264
- Alternativly, you can use Docker to launch a vLLM server.
265
-
266
- ```
267
- export TP_SIZE=1 # Adjust this value based on the number of GPUs you want to use
268
- docker run --runtime nvidia --gpus all \
269
- -v ~/.cache/huggingface:/root/.cache/huggingface \
270
- --env "HUGGING_FACE_HUB_TOKEN=$HF_TOKEN" \
271
- -p 8000:8000 \
272
- --ipc=host \
273
- vllm/vllm-openai:v0.10.1 \
274
- --model nvidia/NVIDIA-Nemotron-Nano-9B-v2 \
275
- --tensor-parallel-size ${TP_SIZE} \
276
- --max-num-seqs 64 \
277
- --max-model-len 131072 \
278
- --trust-remote-code \
279
- --mamba_ssm_cache_dtype float32
280
  ```
281
 
282
- For Jetson AGX Thor, please use [this vLLM container](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/vllm?version=25.09-py3).
283
 
 
284
 
285
- #### Using Budget Control with a vLLM Server
 
286
 
287
- The thinking budget allows developers to keep accuracy high and meet response‑time targets \- which is especially crucial for customer support, autonomous agent steps, and edge devices where every millisecond counts.
288
-
289
- With budget control, you can set a limit for internal reasoning:
290
-
291
- * `max_thinking_tokens`: This is a threshold that will attempt to end the reasoning trace at the next newline encountered in the reasoning trace. If no newline is encountered within 500 tokens, it will abruptly end the reasoning trace at \`max\_thinking\_tokens \+ 500\`.
292
-
293
- Start a vLLM server:
294
-
295
- ```shell
296
- vllm serve nvidia/NVIDIA-Nemotron-Nano-9B-v2 \
297
- --trust-remote-code \
298
- --mamba_ssm_cache_dtype float32
299
- ```
300
-
301
- Client for supporting budget control:
302
-
303
- ```py
304
- from typing import Any, Dict, List
305
-
306
- import openai
307
- from transformers import AutoTokenizer
308
-
309
-
310
- class ThinkingBudgetClient:
311
- def __init__(self, base_url: str, api_key: str, tokenizer_name_or_path: str):
312
- self.base_url = base_url
313
- self.api_key = api_key
314
- self.tokenizer = AutoTokenizer.from_pretrained(tokenizer_name_or_path)
315
- self.client = openai.OpenAI(base_url=self.base_url, api_key=self.api_key)
316
-
317
-
318
- def chat_completion(
319
- self,
320
- model: str,
321
- messages: List[Dict[str, Any]],
322
- max_thinking_budget: int = 512,
323
- max_tokens: int = 1024,
324
- **kwargs,
325
- ) -> Dict[str, Any]:
326
- assert (
327
- max_tokens > max_thinking_budget
328
- ), f"thinking budget must be smaller than maximum new tokens. Given {max_tokens=} and {max_thinking_budget=}"
329
-
330
-
331
- # 1. first call chat completion to get reasoning content
332
- response = self.client.chat.completions.create(
333
- model=model, messages=messages, max_tokens=max_thinking_budget, **kwargs
334
- )
335
- content = response.choices[0].message.content
336
-
337
-
338
- reasoning_content = content
339
- if not "</think>" in reasoning_content:
340
- # reasoning content is too long, closed with a period (.)
341
- reasoning_content = f"{reasoning_content}.\n</think>\n\n"
342
- reasoning_tokens_len = len(
343
- self.tokenizer.encode(reasoning_content, add_special_tokens=False)
344
- )
345
- remaining_tokens = max_tokens - reasoning_tokens_len
346
- assert (
347
- remaining_tokens > 0
348
- ), f"remaining tokens must be positive. Given {remaining_tokens=}. Increase the max_tokens or lower the max_thinking_budget."
349
-
350
-
351
- # 2. append reasoning content to messages and call completion
352
- messages.append({"role": "assistant", "content": reasoning_content})
353
- prompt = self.tokenizer.apply_chat_template(
354
- messages,
355
- tokenize=False,
356
- continue_final_message=True,
357
- )
358
- response = self.client.completions.create(
359
- model=model, prompt=prompt, max_tokens=remaining_tokens, **kwargs
360
- )
361
-
362
-
363
- response_data = {
364
- "reasoning_content": reasoning_content.strip().strip("</think>").strip(),
365
- "content": response.choices[0].text,
366
- "finish_reason": response.choices[0].finish_reason,
367
- }
368
- return response_data
369
- ```
370
-
371
- Calling the server with a budget (Restricted to 32 tokens here as an example)
372
-
373
- ```py
374
- tokenizer_name_or_path = "nvidia/NVIDIA-Nemotron-Nano-9B-v2"
375
- client = ThinkingBudgetClient(
376
- base_url="http://localhost:8000/v1", # Nano 9B v2 deployed in thinking mode
377
- api_key="EMPTY",
378
- tokenizer_name_or_path=tokenizer_name_or_path,
379
  )
380
 
381
-
382
- result = client.chat_completion(
383
- model="nvidia/NVIDIA-Nemotron-Nano-9B-v2",
384
- messages=[
385
- {"role": "system", "content": "You are a helpful assistant. /think"},
386
- {"role": "user", "content": "What is 2+2?"},
387
- ],
388
- max_thinking_budget=32,
389
- max_tokens=512,
390
- temperature=0.6,
391
- top_p=0.95,
392
- )
393
- print(result)
394
  ```
395
 
396
- You should see output similar to the following:
397
 
398
  ```
399
- {'reasoning_content': "Okay, the user asked, What is 2+2? Let me think. Well, 2 plus 2 equals 4. That's a basic.", 'content': '2 + 2 equals **4**.\n', 'finish_reason': 'stop'}
 
 
 
400
  ```
401
 
402
- #### Using Tool-Calling with a vLLM Server
403
 
404
- Start a vLLM server with native tool-calling:
405
 
406
- ```shell
407
- git clone https://huggingface.co/nvidia/NVIDIA-Nemotron-Nano-9B-v2
408
 
409
- vllm serve nvidia/NVIDIA-Nemotron-Nano-9B-v2 \
410
- --trust-remote-code \
411
- --mamba_ssm_cache_dtype float32 \
412
- --enable-auto-tool-choice \
413
- --tool-parser-plugin "NVIDIA-Nemotron-Nano-9B-v2/nemotron_toolcall_parser_no_streaming.py" \
414
- --tool-call-parser "nemotron_json"
415
  ```
416
-
417
- ## After launching a vLLM server, you can call the server with tool-call support using a Python script like below:
418
-
419
- ```py
420
- from openai import OpenAI
421
-
422
- client = OpenAI(
423
- base_url="http://0.0.0.0:5000/v1",
424
- api_key="dummy",
425
- )
426
-
427
- completion = client.chat.completions.create(
428
- model="nvidia/NVIDIA-Nemotron-Nano-9B-v2",
429
- messages=[
430
- {"role": "system", "content": ""},
431
- {"role": "user", "content": "My bill is $100. What will be the amount for 18% tip?"}
432
- ],
433
- tools=[
434
- {
435
- "type": "function",
436
- "function": {
437
- "name": "calculate_tip",
438
- "parameters": {
439
- "type": "object",
440
- "properties": {
441
- "bill_total": {
442
- "type": "integer",
443
- "description": "The total amount of the bill"
444
- },
445
- "tip_percentage": {
446
- "type": "integer",
447
- "description": "The percentage of tip to be applied"
448
- }
449
- },
450
- "required": ["bill_total", "tip_percentage"]
451
- }
452
- }
453
- },
454
- {
455
- "type": "function",
456
- "function": {
457
- "name": "convert_currency",
458
- "parameters": {
459
- "type": "object",
460
- "properties": {
461
- "amount": {
462
- "type": "integer",
463
- "description": "The amount to be converted"
464
- },
465
- "from_currency": {
466
- "type": "string",
467
- "description": "The currency code to convert from"
468
- },
469
- "to_currency": {
470
- "type": "string",
471
- "description": "The currency code to convert to"
472
- }
473
- },
474
- "required": ["from_currency", "amount", "to_currency"]
475
- }
476
- }
477
- }
478
- ],
479
- temperature=0.6,
480
- top_p=0.95,
481
- max_tokens=32768,
482
- stream=False
483
- )
484
-
485
- print(completion.choices[0].message.content)
486
- print(completion.choices[0].message.tool_calls)
487
- ```
488
-
489
- You should see output similar to the following:
490
-
491
  ```
492
- <think>
493
- Okay, let's see. The user has a bill of $100 and wants to know the amount for an 18% tip. Hmm, I need to calculate the tip based on the bill total and the percentage. The tools provided include calculate_tip, which takes bill_total and tip_percentage as parameters. So the bill_total here is 100, and the tip_percentage is 18. I should call the calculate_tip function with these values. Wait, do I need to check if the parameters are integers? The bill is $100, which is an integer, and 18% is also an integer. So that fits the function's requirements. I don't need to convert any currency here because the user is asking about a tip in the same currency. So the correct tool to use is calculate_tip with those parameters.
494
- </think>
495
 
496
- [ChatCompletionMessageToolCall(id='chatcmpl-tool-e341c6954d2c48c2a0e9071c7bdefd8b', function=Function(arguments='{"bill_total": 100, "tip_percentage": 18}', name='calculate_tip'), type='function')]
497
- ```
 
498
 
499
- ## Model Version
500
 
501
- - v1.0
502
 
503
- ## Prompt Format
 
 
 
 
504
 
505
- We follow the jinja chat template provided below. This template conditionally adds `<think>\n` to the start of the Assistant response if `/think` is found in either the system prompt or any user message. If no reasoning signal is added, the model defaults to reasoning "on" mode. The chat template adds `<think></think>` to the start of the Assistant response if `/no_think` is found in the system prompt. Thus enforcing reasoning on/off behavior.
506
 
507
- ```
508
- {%- set ns = namespace(enable_thinking = true) %}
509
-
510
- {%- for message in messages -%}
511
- {%- set content = message['content'] -%}
512
- {%- if message['role'] == 'user' or message['role'] == 'system' -%}
513
- {%- if '/think' in content -%}
514
- {%- set ns.enable_thinking = true -%}
515
- {%- elif '/no_think' in content -%}
516
- {%- set ns.enable_thinking = false -%}
517
- {%- endif -%}
518
- {%- endif -%}
519
- {%- endfor -%}
520
-
521
- {%- if messages[0]['role'] != 'system' -%}
522
- {%- set ns.non_tool_system_content = '' -%}
523
- {{- '<SPECIAL_10>System\n' -}}
524
- {%- else -%}
525
- {%- set ns.non_tool_system_content = messages[0]['content']
526
- .replace('/think', '')
527
- .replace('/no_think', '')
528
- .strip()
529
- -%}
530
- {{- '<SPECIAL_10>System\n' + ns.non_tool_system_content }}
531
- {%- endif -%}
532
-
533
- {%- if tools -%}
534
- {%- if ns.non_tool_system_content is defined and ns.non_tool_system_content != '' -%}
535
- {{- '\n\n' -}}
536
- {%- endif -%}
537
-
538
- {{- 'You can use the following tools to assist the user if required:' -}}
539
- {{- '\n<AVAILABLE_TOOLS>[' -}}
540
- {%- for tool in tools -%}
541
- {{- (tool.function if tool.function is defined else tool) | tojson -}}
542
- {{- ', ' if not loop.last else '' -}}
543
- {%- endfor -%}
544
- {{- ']</AVAILABLE_TOOLS>\n\n' -}}
545
-
546
- {{- 'If you decide to call any tool(s), use the following format:\n' -}}
547
- {{- '<TOOLCALL>[{{"name": "tool_name1", "arguments": "tool_args1"}}, ' -}}
548
- {{- '{{"name": "tool_name2", "arguments": "tool_args2"}}]</TOOLCALL>\n\n' -}}
549
-
550
- {{- 'The user will execute tool-calls and return responses from tool(s) in this format:\n' -}}
551
- {{- '<TOOL_RESPONSE>[{{"tool_response1"}}, {{"tool_response2"}}]</TOOL_RESPONSE>\n\n' -}}
552
-
553
- {{- 'Based on the tool responses, you can call additional tools if needed, correct tool calls if any errors are found, or just respond to the user.' -}}
554
- {%- endif -%}
555
-
556
- {{- '\n' -}}
557
-
558
- {%- set messages = messages[1:] if messages[0]['role'] == 'system' else messages -%}
559
-
560
- {%- if messages[-1]['role'] == 'assistant' -%}
561
- {%- set ns.last_turn_assistant_content = messages[-1]['content'].strip() -%}
562
- {%- set messages = messages[:-1] -%}
563
- {%- endif -%}
564
-
565
- {%- for message in messages -%}
566
- {%- set content = message['content'] -%}
567
-
568
- {%- if message['role'] == 'user' -%}
569
- {{- '<SPECIAL_11>User\n' + content.replace('/think', '').replace('/no_think', '').strip() + '\n' }}
570
-
571
- {%- elif message['role'] == 'tool' -%}
572
- {%- if loop.first or (messages[loop.index0 - 1].role != 'tool') -%}
573
- {{- '<SPECIAL_11>User\n' + '<TOOL_RESPONSE>[' }}
574
- {%- endif -%}
575
- {{- message['content'] -}}
576
- {{- ', ' if not loop.last and (messages[loop.index0 + 1].role == 'tool') else '' -}}
577
- {%- if loop.last or (messages[loop.index0 + 1].role != 'tool') -%}
578
- {{- ']</TOOL_RESPONSE>\n' -}}
579
- {%- endif -%}
580
-
581
- {%- elif message['role'] == 'assistant' -%}
582
- {%- if '</think>' in content -%}
583
- {%- set content = content.split('</think>')[1].strip() %}
584
- {%- endif -%}
585
-
586
- {{- '<SPECIAL_11>Assistant\n' + content.strip() }}
587
-
588
- {%- if message.tool_calls -%}
589
- {%- if content.strip() != '' -%}
590
- {{- '\n\n' -}}
591
- {%- endif -%}
592
- {{- '<TOOLCALL>[' -}}
593
- {%- for call in message.tool_calls -%}
594
- {%- set fn = call.function if call.function is defined else call -%}
595
- {{- '{"name": "' + fn.name + '", "arguments": ' -}}
596
- {%- if fn.arguments is string -%}
597
- {{- fn.arguments -}}
598
- {%- else -%}
599
- {{- fn.arguments | tojson -}}
600
- {%- endif -%}
601
- {{- '}' + (', ' if not loop.last else '') -}}
602
- {%- endfor -%}
603
- {{- ']</TOOLCALL>' -}}
604
- {%- endif -%}
605
-
606
- {{- '\n<SPECIAL_12>\n' -}}
607
- {%- endif -%}
608
- {%- endfor -%}
609
-
610
- {%- if add_generation_prompt -%}
611
- {{- '<SPECIAL_11>Assistant\n' -}}
612
- {%- if ns.enable_thinking is defined and ns.enable_thinking is false -%}
613
- {{- '<think></think>' -}}
614
- {%- else -%}
615
- {{- '<think>\n' -}}
616
- {%- endif -%}
617
- {%- if ns.last_turn_assistant_content is defined and ns.last_turn_assistant_content != '' -%}
618
- {{- ns.last_turn_assistant_content -}}
619
- {%- endif -%}
620
-
621
- {%- else -%}
622
- {%- if ns.last_turn_assistant_content is defined and ns.last_turn_assistant_content != '' -%}
623
- {{- '<SPECIAL_11>Assistant\n' -}}
624
- {%- if ns.enable_thinking is defined and ns.enable_thinking is false -%}
625
- {{- '<think></think>' -}}
626
- {%- else -%}
627
- {{- '<think>\n' -}}
628
- {%- endif -%}
629
- {{- ns.last_turn_assistant_content -}}
630
-
631
- {%- if continue_final_message is defined -%}
632
- {%- if continue_final_message is false -%}
633
- {{- '\n<SPECIAL_12>\n' -}}
634
- {%- endif -%}
635
- {%- else -%}
636
- {{- '\n<SPECIAL_12>\n' -}}
637
- {%- endif -%}
638
- {%- endif -%}
639
- {%- endif -%}
640
- ```
641
 
642
- ##
643
-
644
- ## Training, Testing, and Evaluation Datasets
645
-
646
- ### Training datasets
647
-
648
- * Data Modality: Text
649
- * Text Training Data Size: More than 10 Trillion Tokens
650
- * Train/Test/Valid Split: We used 100% of the corpus for pre-training and relied on external benchmarks for testing.
651
- * Data Collection Method by dataset: Hybrid: Automated, Human, Synthetic
652
- * Labeling Method by dataset: Hybrid: Automated, Human, Synthetic
653
-
654
-
655
- **Properties:** The post-training corpus for NVIDIA-Nemotron-Nano-9B-v2 consists of English and multilingual text (German, Spanish, French, Italian, Korean, Portuguese, Russian, Japanese, Chinese and English). Our sources cover a variety of document types such as: webpages, dialogue, articles, and other written materials. The corpus spans domains including code, legal, math, science, finance, and more. We also include a small portion of question-answering, and alignment style data to improve model accuracies. For several of the domains listed above we used synthetic data, specifically reasoning traces, from DeepSeek R1/R1-0528, Qwen3-235B-A22B, Nemotron 4 340B, Qwen2.5-32B-Instruct-AWQ, Qwen2.5-14B-Instruct, Qwen 2.5 72B.
656
-
657
- The pre-training corpus for NVIDIA-Nemotron-Nano-9B-v2 consists of high-quality curated and synthetically-generated data. It is trained in the English language, as well as 15 multilingual languages and 43 programming languages. Our sources cover a variety of document types such as: webpages, dialogue, articles, and other written materials. The corpus spans domains including legal, math, science, finance, and more. We also include a small portion of question-answering, and alignment style data to improve model accuracy. The model was pre-trained for approximately twenty trillion tokens.
658
-
659
- Alongside the model, we release our [final pretraining data](https://huggingface.co/collections/nvidia/nemotron-pre-training-dataset-689d9de36f84279d83786b35), as outlined in this section. For ease of analysis, there is a sample set that is ungated. For all remaining code, math and multilingual data, gating and approval is required, and the dataset is permissively licensed for model training purposes.
660
-
661
- More details on the datasets and synthetic data generation methods can be found in the technical report [NVIDIA Nemotron Nano 2: An Accurate and Efficient Hybrid Mamba-Transformer Reasoning Model](https://research.nvidia.com/labs/adlr/files/NVIDIA-Nemotron-Nano-2-Technical-Report.pdf) .
662
-
663
-
664
- ## Public Datasets
665
-
666
- | Dataset | Collection Period |
667
- | :---- | :---- |
668
- | [Problems in Elementary Mathematics for Home Study](https://archive.org/details/AntonovVygodskyNikitinSankinProblemsInElementaryMathematicsForHomeStudyMir1982) | 4/23/2025 |
669
- | [GSM8K](https://github.com/openai/grade-school-math) | 4/23/2025 |
670
- | [PRM800K](https://github.com/openai/prm800k) | 4/23/2025 |
671
- | [CC-NEWS](https://commoncrawl.org/blog/news-dataset-available) | 4/23/2025 |
672
- | [Common Crawl](https://commoncrawl.org/) | 4/23/2025 |
673
- | [Wikimedia](https://dumps.wikimedia.org/) | 4/23/2025 |
674
- | [Bespoke-Stratos-17k](https://huggingface.co/datasets/bespokelabs/Bespoke-Stratos-17k) | 4/23/2025 |
675
- | [tigerbot-kaggle-leetcodesolutions-en-2k](https://huggingface.co/datasets/TigerResearch/tigerbot-kaggle-leetcodesolutions-en-2k) | 4/23/2025 |
676
- | [glaive-function-calling-v2](https://huggingface.co/datasets/glaiveai/glaive-function-calling-v2) | 4/23/2025 |
677
- | [APIGen Function-Calling](https://huggingface.co/datasets/Salesforce/xlam-function-calling-60k) | 4/23/2025 |
678
- | [LMSYS-Chat-1M](https://huggingface.co/datasets/lmsys/lmsys-chat-1m) | 4/23/2025 |
679
- | [Open Textbook Library \- CC BY-SA & GNU subset](https://open.umn.edu/opentextbooks/textbooks/) and [OpenStax \- CC BY-SA subset](https://openstax.org/) | 4/23/2025 |
680
- | [Advanced Reasoning Benchmark](https://github.com/TheDuckAI/arb), [tigerbot-kaggle-leetcodesolutions-en-2k](https://huggingface.co/datasets/TigerResearch/tigerbot-kaggle-leetcodesolutions-en-2k), [PRM800K](https://github.com/openai/prm800k), and [SciBench](https://github.com/mandyyyyii/scibench) | 4/23/2025 |
681
- | [FineWeb-2](https://huggingface.co/datasets/HuggingFaceFW/fineweb-2) | 4/23/2025 |
682
- | [Court Listener](https://www.courtlistener.com/help/api/bulk-data/) | Legacy Download |
683
- | [peS2o](https://huggingface.co/datasets/allenai/peS2o) | Legacy Download |
684
- | [OpenWebMath](https://huggingface.co/datasets/open-web-math/open-web-math) | Legacy Download |
685
- | [BioRxiv](https://www.biorxiv.org/tdm) | Legacy Download |
686
- | [PMC Open Access Subset](https://pmc.ncbi.nlm.nih.gov/tools/openftlist/) | Legacy Download |
687
- | [OpenWebText2](https://openwebtext2.readthedocs.io/en/latest/) | Legacy Download |
688
- | [Stack Exchange Data Dump](https://archive.org/details/stackexchange) | Legacy Download |
689
- | [PubMed Abstracts](https://github.com/thoppe/The-Pile-PubMed) | Legacy Download |
690
- | [NIH ExPorter](https://exporter.nih.gov/ExPORTER_Catalog.aspx) | Legacy Download |
691
- | [arXiv](https://info.arxiv.org/help/bulk_data/index.html) | Legacy Download |
692
- | [BigScience Workshop Datasets](https://github.com/bigscience-workshop/bigscience/tree/master/train/tr11-176B-ml#datasets) | Legacy Download |
693
- | [Reddit Dataset](https://files.pushshift.io/reddit/) | Legacy Download |
694
- | [SEC's Electronic Data Gathering, Analysis, and Retrieval (EDGAR)](https://www.sec.gov/search-filings) | Legacy Download |
695
- | [Public Software Heritage S3](https://docs.softwareheritage.org/devel/swh-export/graph/dataset.html#summary-of-dataset-versions) | Legacy Download |
696
- | [The Stack](https://huggingface.co/datasets/bigcode/the-stack) | Legacy Download |
697
- | [mC4](https://huggingface.co/datasets/legacy-datasets/mc4) | Legacy Download |
698
- | [Advanced Mathematical Problem Solving](https://github.com/hendrycks/math?tab=readme-ov-file) | Legacy Download |
699
- | [MathPile](https://github.com/GAIR-NLP/MathPile/) | Legacy Download |
700
- | [NuminaMath CoT](https://huggingface.co/datasets/AI-MO/NuminaMath-CoT) | Legacy Download |
701
- | [PMC Article](https://pmc.ncbi.nlm.nih.gov/tools/textmining/) | Legacy Download |
702
- | [FLAN](https://github.com/google-research/FLAN) | Legacy Download |
703
- | [Advanced Reasoning Benchmark](https://github.com/TheDuckAI/arb) | Legacy Download |
704
- | [SciBench](https://github.com/mandyyyyii/scibench) | Legacy Download |
705
- | [WikiTableQuestions](https://huggingface.co/datasets/wikitablequestions) | Legacy Download |
706
- | [FinQA](https://finqasite.github.io/) | Legacy Download |
707
- | [Riddles](https://github.com/crawsome/riddles) | Legacy Download |
708
- | [Problems in Elementary Mathematics for Home Study](https://archive.org/details/AntonovVygodskyNikitinSankinProblemsInElementaryMathematicsForHomeStudyMir1982) | Legacy Download |
709
- | [MedMCQA](https://huggingface.co/datasets/openlifescienceai/medmcqa) | Legacy Download |
710
- | [Cosmos QA](https://huggingface.co/datasets/allenai/cosmos_qa) | Legacy Download |
711
- | [MCTest](https://huggingface.co/datasets/sagnikrayc/mctest) | Legacy Download |
712
- | [AI2's Reasoning Challenge](https://huggingface.co/datasets/ai2_arc) | Legacy Download |
713
- | [OpenBookQA](https://github.com/allenai/OpenBookQA) | Legacy Download |
714
- | [MMLU Auxiliary Train](https://huggingface.co/datasets/cais/mmlu/viewer/all/auxiliary_train) | Legacy Download |
715
- | [social-chemestry-101](https://huggingface.co/datasets/tasksource/social-chemestry-101) | Legacy Download |
716
- | [Moral Stories](https://huggingface.co/datasets/demelin/moral_stories) | Legacy Download |
717
- | [The Common Pile v0.1](https://huggingface.co/common-pile) | Legacy Download |
718
- | [FineMath](https://huggingface.co/datasets/HuggingFaceTB/finemath) | Legacy Download |
719
- | [MegaMath](https://huggingface.co/datasets/LLM360/MegaMath) | Legacy Download |
720
- | [FastChat](https://github.com/lm-sys/FastChat) | 6/30/2025 |
721
-
722
- ## Private Non-publicly Accessible Datasets of Third Parties
723
-
724
- | Dataset |
725
- | :---- |
726
- | Global Regulation |
727
- | Workbench |
728
-
729
- ## Online Dataset Sources
730
-
731
- The English Common Crawl data was downloaded from the Common Crawl Foundation (see their [FAQ](https://commoncrawl.org/faq) for details on their crawling) and includes the snapshots CC-MAIN-2013-20 through CC-MAIN-2025-13. The data was subsequently deduplicated and filtered in various ways described in the [Nemotron-CC paper](https://arxiv.org/abs/2412.02595).
732
-
733
- Additionally, we extracted data for fifteen languages from the following three Common Crawl snapshots: CC-MAIN-2024-51, CC-MAIN-2025-08, CC-MAIN-2025-18. The fifteen languages included were Arabic, Chinese, Danish, Dutch, French, German, Italian, Japanese, Korean, Polish, Portuguese, Russian, Spanish, Swedish, and Thai. As we did not have reliable multilingual model-based quality classifiers available, we applied just heuristic filtering instead—similar to what we did for lower quality English data in the Nemotron-CC pipeline, but selectively removing some filters for some languages that did not work well. Deduplication was done in the same way as for Nemotron-CC.
734
-
735
- The GitHub Crawl was collected using the GitHub REST API and the Amazon S3 API. Each crawl was operated in accordance with the rate limits set by its respective source, either GitHub or S3. We collect raw source code and subsequently remove any having a license which does not exist in our permissive-license set (for additional details, refer to the technical report).
736
-
737
- | Dataset | Modality | Dataset Size (Tokens) | Collection Period |
738
- | :---- | :---- | :---- | :---- |
739
- | English Common Crawl | Text | 3.360T | 4/8/2025 |
740
- | Multilingual Common Crawl | Text | 812.7B | 5/1/2025 |
741
- | GitHub Crawl | Text | 747.4B | 4/29/2025 |
742
-
743
- ## NVIDIA-Sourced Synthetic Datasets
744
-
745
- | Dataset | Modality | Dataset Size (Tokens) | Seed Dataset | Model(s) used for generation |
746
- | :---- | :---- | :---- | :---- | :---- |
747
- | Synthetic Art of Problem Solving from DeepSeek-R1 | Text | 25.5B | [Art of Problem Solving](https://artofproblemsolving.com/company); [American Mathematics Competitions 8](https://artofproblemsolving.com/wiki/index.php/AMC_8_Problems_and_Solutions); [American Mathematics Competitions 10](https://artofproblemsolving.com/wiki/index.php/AMC_10_Problems_and_Solutions); | [DeepSeek-R1](https://huggingface.co/deepseek-ai/DeepSeek-R1) |
748
- | Synthetic Moral Stories and Social Chemistry from Mixtral-8x22B-v0.1 | Text | 327M | [social-chemestry-101](https://huggingface.co/datasets/tasksource/social-chemestry-101); [Moral Stories](https://huggingface.co/datasets/demelin/moral_stories) | [Mixtral-8x22B-v0.1](https://huggingface.co/mistralai/Mixtral-8x22B-v0.1) |
749
- | Synthetic Social Sciences seeded with OpenStax from DeepSeek-V3, Mixtral-8x22B-v0.1, and Qwen2.5-72B | Text | 83.6M | [OpenStax \- CC BY-SA subset](https://openstax.org/) | [DeepSeek-V3](https://huggingface.co/deepseek-ai/DeepSeek-V3); [Mixtral-8x22B-v0.1](https://huggingface.co/mistralai/Mixtral-8x22B-v0.1); [Qwen2.5-72B](https://huggingface.co/Qwen/Qwen2.5-72B) |
750
- | Synthetic Health Sciences seeded with OpenStax from DeepSeek-V3, Mixtral-8x22B-v0.1, and Qwen2.5-72B | Text | 9.7M | [OpenStax \- CC BY-SA subset](https://openstax.org/) | [DeepSeek-V3](https://huggingface.co/deepseek-ai/DeepSeek-V3); [Mixtral-8x22B-v0.1](https://huggingface.co/mistralai/Mixtral-8x22B-v0.1); [Qwen2.5-72B](https://huggingface.co/Qwen/Qwen2.5-72B) |
751
- | Synthetic STEM seeded with OpenStax, Open Textbook Library, and GSM8K from DeepSeek-R1, DeepSeek-V3, DeepSeek-V3-0324, and Qwen2.5-72B | Text | 175M | [OpenStax \- CC BY-SA subset](https://openstax.org/); [GSM8K](https://github.com/openai/grade-school-math); [Open Textbook Library \- CC BY-SA & GNU subset](https://open.umn.edu/opentextbooks/textbooks/) | [DeepSeek-R1](https://huggingface.co/deepseek-ai/DeepSeek-R1), [DeepSeek-V3](https://huggingface.co/deepseek-ai/DeepSeek-V3); [DeepSeek-V3-0324](https://huggingface.co/deepseek-ai/DeepSeek-V3-0324); [Qwen2.5-72B](https://huggingface.co/Qwen/Qwen2.5-72B) |
752
- | [Nemotron-PrismMath](https://huggingface.co/datasets/nvidia/Nemotron-PrismMath) | Text | 4.6B | [Big-Math-RL-Verified](https://huggingface.co/datasets/SynthLabsAI/Big-Math-RL-Verified); [OpenR1-Math-220k](https://huggingface.co/datasets/open-r1/OpenR1-Math-220k) | [Qwen2.5-0.5B-instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct), [Qwen2.5-72B-Instruct](https://huggingface.co/Qwen/Qwen2.5-72B-Instruct); [DeepSeek-R1-Distill-Qwen-32B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B) |
753
- | Synthetic Question Answering Data from Papers and Permissible Books from Qwen2.5-72B-Instruct | Text | 350M | [arXiv](https://info.arxiv.org/help/bulk_data/index.html); [National Institutes of Health ExPorter](https://www.nih.gov/); [BioRxiv](https://www.biorxiv.org/tdm); [PMC Article](https://pmc.ncbi.nlm.nih.gov/tools/textmining/); [USPTO Backgrounds](https://data.uspto.gov/apis/transition-guide/bdss#pats); [peS2o](https://huggingface.co/datasets/allenai/peS2o); Global Regulation; [CORE](https://core.ac.uk/documentation/dataset); [PG-19](https://github.com/google-deepmind/pg19); [DOAB CC BY & CC BY-SA subset](https://www.doabooks.org/en); [NDLTD](https://ndltd.org/thesis-resources/global-etd-search/) | [Qwen2.5-72B-Instruct](https://huggingface.co/Qwen/Qwen2.5-72B-Instruct) |
754
- | Synthetic FineMath-4+ Reprocessed from DeepSeek-V3 | Text | 9.2B | [Common Crawl](https://commoncrawl.org/latest-crawl) | [DeepSeek-V3](https://huggingface.co/deepseek-ai/DeepSeek-V3) |
755
- | Synthetic FineMath-3+ Reprocessed from phi-4 | Text | 27.6B | [Common Crawl](https://commoncrawl.org/latest-crawl) | [phi-4](https://huggingface.co/microsoft/phi-4) |
756
- | Synthetic Union-3+ Reprocessed from phi-4 | Text | 93.1B | [Common Crawl](https://commoncrawl.org/latest-crawl) | [phi-4](https://huggingface.co/microsoft/phi-4) |
757
- | Refreshed [Nemotron-MIND](https://huggingface.co/datasets/nvidia/Nemotron-MIND) from phi-4 | Text | 73B | [Common Crawl](https://commoncrawl.org/latest-crawl) | [phi-4](https://huggingface.co/microsoft/phi-4) |
758
- | Synthetic Union-4+ Reprocessed from phi-4 | Text | 14.12B | [Common Crawl](https://commoncrawl.org/latest-crawl) | [phi-4](https://huggingface.co/microsoft/phi-4) |
759
- | Synthetic Union-3+ minus 4+ Reprocessed from phi-4 | Text | 78.95B | [Common Crawl](https://commoncrawl.org/latest-crawl) | [phi-4](https://huggingface.co/microsoft/phi-4) |
760
- | Synthetic Union-3 Refreshed from phi-4 | Text | 80.94B | [Common Crawl](https://commoncrawl.org/latest-crawl) | [phi-4](https://huggingface.co/microsoft/phi-4) |
761
- | Synthetic Union-4+ Refreshed from phi-4 | Text | 52.32B | [Common Crawl](https://commoncrawl.org/latest-crawl) | [phi-4](https://huggingface.co/microsoft/phi-4) |
762
- | Synthetic AGIEval seeded with AQUA-RAT, LogiQA, and AR-LSAT from DeepSeek-V3 and DeepSeek-V3-0324 | Text | 4.0B | [AQUA-RAT](https://huggingface.co/datasets/deepmind/aqua_rat); [LogiQA](https://huggingface.co/datasets/lucasmccabe/logiqa); [AR-LSAT](https://github.com/zhongwanjun/AR-LSAT) | [DeepSeek-V3](https://huggingface.co/deepseek-ai/DeepSeek-V3); [DeepSeek-V3-0324](https://huggingface.co/deepseek-ai/DeepSeek-V3-0324) |
763
- | Synthetic AGIEval seeded with AQUA-RAT, LogiQA, and AR-LSAT from Qwen3-30B-A3B | Text | 4.2B | [AQUA-RAT](https://huggingface.co/datasets/deepmind/aqua_rat); [LogiQA](https://huggingface.co/datasets/lucasmccabe/logiqa); [AR-LSAT](https://github.com/zhongwanjun/AR-LSAT) | [Qwen3-30B-A3B](https://huggingface.co/Qwen/Qwen3-30B-A3B) |
764
- | Synthetic Art of Problem Solving from Qwen2.5-32B-Instruct, Qwen2.5-Math-72B, Qwen2.5-Math-7B, and Qwen2.5-72B-Instruct | Text | 83.1B | [Art of Problem Solving](https://artofproblemsolving.com/company); [American Mathematics Competitions 8](https://artofproblemsolving.com/wiki/index.php/AMC_8_Problems_and_Solutions); [American Mathematics Competitions 10](https://artofproblemsolving.com/wiki/index.php/AMC_10_Problems_and_Solutions); [GSM8K](https://github.com/openai/grade-school-math); [PRM800K](https://github.com/openai/prm800k) | [Qwen2.5-32B-Instruct](https://huggingface.co/Qwen/Qwen2.5-32B-Instruct); [Qwen2.5-Math-72B](https://huggingface.co/Qwen/Qwen2.5-Math-72B); [Qwen2.5-Math-7B](https://huggingface.co/Qwen/Qwen2.5-Math-7B); [Qwen2.5-72B-Instruct](https://huggingface.co/Qwen/Qwen2.5-72B-Instruct) |
765
- | Synthetic MMLU Auxiliary Train from DeepSeek-R1 | Text | 0.5B | [MMLU Auxiliary Train](https://huggingface.co/datasets/cais/mmlu/viewer/all/auxiliary_train) | [DeepSeek-R1](https://huggingface.co/deepseek-ai/DeepSeek-R1) |
766
- | Synthetic Long Context Continued Post-Training Data from Papers and Permissible Books from Qwen2.5-72B-Instruct | Text | 5.4B | [arXiv](https://info.arxiv.org/help/bulk_data/index.html); [National Institutes of Health ExPorter](https://www.nih.gov/); [BioRxiv](https://www.biorxiv.org/tdm); [PMC Article](https://pmc.ncbi.nlm.nih.gov/tools/textmining/); [USPTO Backgrounds](https://data.uspto.gov/apis/transition-guide/bdss#pats); [peS2o](https://huggingface.co/datasets/allenai/peS2o); Global Regulation; [CORE](https://core.ac.uk/documentation/dataset); [PG-19](https://github.com/google-deepmind/pg19); [DOAB CC BY & CC BY-SA subset](https://www.doabooks.org/en); [NDLTD](https://ndltd.org/thesis-resources/global-etd-search/) | [Qwen2.5-72B-Instruct](https://huggingface.co/Qwen/Qwen2.5-72B-Instruct) |
767
- | Synthetic Common Crawl from Qwen3-30B-A3B and Mistral-Nemo-12B-Instruct | Text | 1.949T | [Common Crawl](https://commoncrawl.org/) | [Qwen3-30B-A3B](https://huggingface.co/Qwen/Qwen3-30B-A3B); [Mistral-NeMo-12B-Instruct](https://huggingface.co/nvidia/Mistral-NeMo-12B-Instruct) |
768
- | Synthetic Multilingual Data from Common Crawl from Qwen3-30B-A3B | Text | 997.3B | [Common Crawl](https://commoncrawl.org/) | [Qwen3-30B-A3B](https://huggingface.co/Qwen/Qwen3-30B-A3B) |
769
- | Synthetic Multilingual Data from Wikimedia from Qwen3-30B-A3B | Text | 55.1B | [Wikimedia](https://dumps.wikimedia.org/) | [Qwen3-30B-A3B](https://huggingface.co/Qwen/Qwen3-30B-A3B) |
770
- | Synthetic OpenMathReasoning from DeepSeek-R1-0528 | Text | 1.5M | [OpenMathReasoning](https://huggingface.co/datasets/nvidia/OpenMathReasoning) | [DeepSeek-R1-0528](https://huggingface.co/deepseek-ai/DeepSeek-R1-0528) |
771
- | Synthetic OpenCodeReasoning from DeepSeek-R1-0528 | Text | 1.1M | [OpenCodeReasoning](https://huggingface.co/datasets/nvidia/OpenCodeReasoning) | [DeepSeek-R1-0528](https://huggingface.co/deepseek-ai/DeepSeek-R1-0528) |
772
- | Synthetic Science Data from DeepSeek-R1-0528 | Text | 1.5M | \- | [DeepSeek-R1-0528](https://huggingface.co/deepseek-ai/DeepSeek-R1-0528) |
773
- | Synthetic Humanity's Last Exam from DeepSeek-R1-0528 | Text | 460K | [Humanity's Last Exam](https://huggingface.co/datasets/cais/hle) | [DeepSeek-R1-0528](https://huggingface.co/deepseek-ai/DeepSeek-R1-0528) |
774
- | Synthetic ToolBench from Qwen3-235B-A22B | Text | 400K | [ToolBench](https://github.com/OpenBMB/ToolBench) | [Qwen3-235B-A22B](https://huggingface.co/Qwen/Qwen3-235B-A22B) |
775
- | Synthetic Nemotron Content Safety Dataset V2, eval-safety, Gretel Synthetic Safety Alignment, and RedTeam\_2K from DeepSeek-R1-0528 | Text | 52K | [Nemotron Content Safety Dataset V2](https://huggingface.co/datasets/nvidia/Aegis-AI-Content-Safety-Dataset-2.0); [eval-safety](https://github.com/CrystalEye42/eval-safety/blob/main/malicious_tasks_dataset.yaml); [Gretel Synthetic Safety Alignment](https://huggingface.co/datasets/gretelai/gretel-safety-alignment-en-v1); [RedTeam\_2K](https://huggingface.co/datasets/JailbreakV-28K/JailBreakV-28k/viewer/RedTeam_2K) | [DeepSeek-R1-0528](https://huggingface.co/deepseek-ai/DeepSeek-R1-0528) |
776
- | Synthetic HelpSteer from Qwen3-235B-A22B | Text | 120K | [HelpSteer3](https://huggingface.co/datasets/nvidia/HelpSteer3); [HelpSteer2](https://huggingface.co/datasets/nvidia/HelpSteer2) | [Qwen3-235B-A22B](https://huggingface.co/Qwen/Qwen3-235B-A22B) |
777
- | Synthetic Alignment data from Mixtral-8x22B-Instruct-v0.1, Mixtral-8x7B-Instruct-v0.1, and Nemotron-4 Family | Text | 400K | [HelpSteer2](https://huggingface.co/datasets/nvidia/HelpSteer2); [C4](https://huggingface.co/datasets/allenai/c4); [LMSYS-Chat-1M](https://huggingface.co/datasets/lmsys/lmsys-chat-1m); [ShareGPT52K](https://huggingface.co/datasets/RyokoAI/ShareGPT52K); [tigerbot-kaggle-leetcodesolutions-en-2k](https://huggingface.co/datasets/TigerResearch/tigerbot-kaggle-leetcodesolutions-en-2k); [GSM8K](https://github.com/openai/grade-school-math); [PRM800K](https://github.com/openai/prm800k); lm\_identity (NVIDIA internal); [FinQA](https://finqasite.github.io/); [WikiTableQuestions](https://huggingface.co/datasets/wikitablequestions); [Riddles](https://github.com/crawsome/riddles); ChatQA nvolve-multiturn (NVIDIA internal); [glaive-function-calling-v2](https://huggingface.co/datasets/glaiveai/glaive-function-calling-v2); [SciBench](https://github.com/mandyyyyii/scibench); [OpenBookQA](https://github.com/allenai/OpenBookQA); [Advanced Reasoning Benchmark](https://github.com/TheDuckAI/arb); [Public Software Heritage S3](https://docs.softwareheritage.org/devel/swh-export/graph/dataset.html#summary-of-dataset-versions); [Khan Academy Math Keywords](https://www.khanacademy.org/math) | Nemotron-4-15B-Base (NVIDIA internal); Nemotron-4-15B-Instruct (NVIDIA internal); [Nemotron-4-340B-Base](https://huggingface.co/nvidia/Nemotron-4-340B-Base); [Nemotron-4-340B-Instruct](https://huggingface.co/nvidia/Nemotron-4-340B-Instruct); [Nemotron-4-340B-Reward](https://huggingface.co/nvidia/Nemotron-4-340B-Reward); [Mixtral-8x7B-Instruct-v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1); [Mixtral-8x22B-Instruct-v0.1](https://huggingface.co/mistralai/Mixtral-8x22B-Instruct-v0.1) |
778
- | Synthetic LMSYS-Chat-1M from Qwen3-235B-A22B | Text | 1M | [LMSYS-Chat-1M](https://huggingface.co/datasets/lmsys/lmsys-chat-1m) | [Qwen3-235B-A22B](https://huggingface.co/Qwen/Qwen3-235B-A22B) |
779
- | Synthetic Multilingual Reasoning data from DeepSeek-R1-0528, Qwen2.5-32B-Instruct-AWQ, and Qwen2.5-14B-Instruct | Text | 25M | [OpenMathReasoning](https://huggingface.co/datasets/nvidia/OpenMathReasoning); [OpenCodeReasoning](https://huggingface.co/datasets/nvidia/OpenCodeReasoning) | [DeepSeek-R1-0528](https://huggingface.co/deepseek-ai/DeepSeek-R1-0528); [Qwen2.5-32B-Instruct-AWQ](https://huggingface.co/Qwen/Qwen2.5-32B-Instruct-AWQ) (translation); [Qwen2.5-14B-Instruct](https://huggingface.co/Qwen/Qwen2.5-14B-Instruct) (translation); |
780
- | Synthetic Multilingual Reasoning data from Qwen3-235B-A22B and Gemma 3 Post-Trained models | Text | 5M | [WildChat](https://huggingface.co/datasets/allenai/WildChat-1M) | [Qwen3-235B-A22B](https://huggingface.co/Qwen/Qwen3-235B-A22B); [Gemma 3 PT 12B](https://huggingface.co/google/gemma-3-12b-it); [Gemma 3 PT 27B](https://huggingface.co/google/gemma-3-27b-it) |
781
-
782
- ### Evaluation Dataset:
783
-
784
- * Data Collection Method by dataset: Hybrid: Human, Synthetic
785
- * Labeling Method by dataset: Hybrid: Automated, Human, Synthetic
786
-
787
- ## Inference
788
-
789
- - ## Engines: HF, vLLM, TRT-LLM
790
-
791
- - ## Test Hardware NVIDIA A10G 24GB, H100 80GB, Jetson AGX Thor
792
-
793
- ## Ethical Considerations
794
-
795
- 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 [Trustworthy AI terms of service](https://www.nvidia.com/en-us/agreements/trustworthy-ai/terms/), 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.
796
-
797
- For more detailed information on ethical considerations for this model, please see the Model Card++ [Bias](./bias.md), [Explainability](./explainability.md), [Safety & Security](./safety.md), and [Privacy](./privacy.md) Subcards.
798
-
799
- Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
800
-
801
-
802
- ## Citation
803
 
804
- ```
805
- @misc{nvidia2025nvidianemotronnano2,
806
- title={NVIDIA Nemotron Nano 2: An Accurate and Efficient Hybrid Mamba-Transformer Reasoning Model},
807
- author={NVIDIA},
808
- year={2025},
809
- eprint={2508.14444},
810
- archivePrefix={arXiv},
811
- primaryClass={cs.CL},
812
- url={https://arxiv.org/abs/2508.14444},
813
- }
814
- ```
 
35
  **Model Developer:** NVIDIA Corporation
36
 
37
  **Model Dates:**
 
38
  June 2025 \- August 2025
39
 
40
  **Data Freshness:**
 
41
  September 2024
42
 
43
  The pretraining data has a cutoff date of September 2024.
44
+ # openNemo
45
 
46
+ **Pure-PyTorch drop-in replacement for NVIDIA's Nemotron-H architecture.**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
+ Removes all external CUDA kernel dependencies (`mamba-ssm`, `causal-conv1d`) and replaces them with native PyTorch operations, making the model fully compatible with **bitsandbytes quantization** (4-bit / 8-bit) and **QLoRA fine-tuning** on consumer GPUs.
49
 
50
+ By **[Empero AI](https://empero.org)**
51
 
52
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
+ ## Why?
55
 
56
+ NVIDIA's Nemotron-H is a hybrid Mamba2 + Transformer architecture — one of the most promising open model designs. But the original implementation depends on `mamba-ssm` and `causal-conv1d`, which ship pre-compiled Triton/CUDA kernels that:
 
 
57
 
58
+ - **Break bitsandbytes quantization** — the kernels call `F.linear` directly, which collides with bnb's `__torch_function__` hook on quantized weights (4-bit weights are stored as flat 1D blobs, causing shape mismatches)
59
+ - **Require specific CUDA versions** — kernel compilation failures are common on consumer setups
60
+ - **Cannot be pip-installed cleanly** on many systems without manual builds
61
 
62
+ This means you **can't** load Nemotron-H in 4-bit, you **can't** use QLoRA, and you **can't** train it efficiently on a single GPU. openNemo fixes all of that.
63
 
64
+ ## What Changed
 
 
65
 
66
+ | Component | Original (NVIDIA) | openNemo |
67
+ |---|---|---|
68
+ | `rmsnorm_fn` | `mamba_ssm.ops.triton.layer_norm` | Pure PyTorch group-wise RMSNorm + SiLU gating |
69
+ | `mamba_split_conv1d_scan_combined` | `mamba_ssm.ops.triton.ssd_combined` | Removed — replaced by chunked `torch_forward` |
70
+ | `selective_state_update` | `mamba_ssm.ops.triton.selective_state_update` | Pure PyTorch SSM step |
71
+ | `causal_conv1d_fn` / `causal_conv1d_update` | `causal_conv1d` package | `nn.Conv1d` with causal padding / manual cache update |
72
+ | Forward routing | Fast path (kernels) vs slow path | Always uses optimized torch path |
73
+ | `.model` accessor | Only `.backbone` | `.model` property alias (PEFT/LoRA compatible) |
74
 
75
+ **All weight names are preserved** — load original NVIDIA checkpoints directly with zero conversion.
76
 
77
+ ## Quickstart
78
 
79
+ ```python
80
  import torch
81
+ from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
 
83
+ bnb_config = BitsAndBytesConfig(
84
+ load_in_4bit=True,
85
+ bnb_4bit_quant_type="nf4",
86
+ bnb_4bit_compute_dtype=torch.bfloat16,
87
+ bnb_4bit_use_double_quant=True,
 
 
 
 
 
 
 
 
88
  )
 
89
 
90
+ model = AutoModelForCausalLM.from_pretrained(
91
+ "empero-ai/openNemo-9B",
92
+ quantization_config=bnb_config,
93
+ trust_remote_code=True,
94
+ device_map="auto",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  )
 
 
 
96
 
97
+ tokenizer = AutoTokenizer.from_pretrained("empero-ai/openNemo-9B")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  ```
99
 
100
+ No `mamba-ssm` install needed. Just `pip install transformers bitsandbytes` and go.
101
 
102
+ ### QLoRA Fine-Tuning
103
 
104
+ ```python
105
+ from peft import LoraConfig, get_peft_model
106
 
107
+ lora_config = LoraConfig(
108
+ r=64,
109
+ lora_alpha=32,
110
+ target_modules=["q_proj", "k_proj", "v_proj", "o_proj",
111
+ "gate_proj", "up_proj", "down_proj"],
112
+ lora_dropout=0.05,
113
+ bias="none",
114
+ task_type="CAUSAL_LM",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  )
116
 
117
+ model = get_peft_model(model, lora_config)
118
+ model.print_trainable_parameters()
 
 
 
 
 
 
 
 
 
 
 
119
  ```
120
 
121
+ ## Requirements
122
 
123
  ```
124
+ torch>=2.1
125
+ transformers>=4.40
126
+ bitsandbytes>=0.43 # for 4-bit quantization
127
+ peft>=0.10 # for LoRA/QLoRA
128
  ```
129
 
130
+ That's it. No `mamba-ssm`. No `causal-conv1d`. No CUDA kernel compilation.
131
 
132
+ ## Architecture
133
 
134
+ Nemotron-H is a 52-layer hybrid model with three block types defined by the pattern:
 
135
 
 
 
 
 
 
 
136
  ```
137
+ M-M-M-M*-M-M-M-M-M*-M-M-M-M-M*-M-M-M-M-M*-M-M-M-M-M-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  ```
 
 
 
139
 
140
+ - **M** — Mamba2 SSM block (majority of layers)
141
+ - **\*** — Grouped Query Attention block (5 layers total)
142
+ - **-** — MLP block (feed-forward)
143
 
144
+ openNemo preserves this exact architecture. The Mamba2 blocks use a chunked structured state-space duality (SSD) scan implemented in pure PyTorch, with the same algorithmic approach as the original `torch_forward` path.
145
 
146
+ ## Files
147
 
148
+ | File | Description |
149
+ |---|---|
150
+ | `modeling_nemotron_h.py` | Full model implementation — all Mamba2/Attention/MLP blocks |
151
+ | `configuration_nemotron_h.py` | Model config (unchanged from NVIDIA's original) |
152
+ | `__init__.py` | Module exports |
153
 
154
+ ## License
155
 
156
+ Apache 2.0 — same as the original NVIDIA release.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
 
158
+ ## Acknowledgments
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
 
160
+ Based on NVIDIA's [Nemotron-H](https://huggingface.co/nvidia/NVIDIA-Nemotron-Nano-9B-v2) architecture.
161
+ Original Mamba2 by Albert Gu and Tri Dao.