smajumdar94 commited on
Commit
4f8ac7b
·
verified ·
1 Parent(s): cf78f22

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +154 -76
README.md CHANGED
@@ -1,109 +1,108 @@
1
  ---
2
  library_name: transformers
3
  license: other
4
- license_name: nvidia-internal-scientific-research-and-development-model-license
5
- license_link: >-
6
- https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-internal-scientific-research-and-development-model-license/
7
  pipeline_tag: text-generation
8
  tags:
9
- - nvidia
10
- - pytorch
 
 
11
  ---
12
 
13
  # OpenCodeReasoning-Nemotron-32B Overview
14
 
15
- ## Description
 
16
 
17
- OpenCodeReasoning-Nemotron-32B is a large language model (LLM) which is a derivative of [Qwen2.5-32B-Instruct](https://huggingface.co/Qwen/Qwen2.5-32B-Instruct) (AKA the *reference model*).
18
- It is a reasoning model that is post trained for reasoning while code generation. The model supports a context length of 32K tokens.
19
 
20
- This model is ready for commercial use.
21
 
22
- ### License/Terms of Use
23
- GOVERNING TERMS: Your use of this model is governed by the [NVIDIA Internal Scientific Research and Development Model License.](https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-internal-scientific-research-and-development-model-license/)
24
-
25
- ### Deployment Geography:
26
- Global<br>
27
-
28
- ### Use Case: <br>
29
- This model is intended for developers and researchers building LLMs. <br>
30
-
31
- ### Release Date: <br>
32
- Huggingface [04/25/2025] via https://huggingface.co/nvidia/OpenCodeReasoning-Nemotron-32B/ <br>
33
-
34
-
35
- ## References
36
- - [\[2504.01943\] OpenCodeReasoning: Advancing Data Distillation for Competitive Coding](https://arxiv.org/abs/2504.01943)
37
-
38
-
39
- ## Model Architecture
40
- - Architecture Type: Dense decoder-only Transformer model
41
- - Network Architecture: Qwen2.5-32B-Instruct
42
-
43
-
44
- ## Input
45
- - **Input Type(s):** Text <br>
46
- - **Input Format(s):** String <br>
47
- - **Input Parameters:** One-Dimensional (1D) <br>
48
- - **Other Properties Related to Input:** Context length up to 32,768 tokens <br>
49
 
 
50
 
51
- ## Output
52
- - **Output Type(s):** Text <br>
53
- - **Output Format:** String <br>
54
- - **Output Parameters:** One-Dimensional (1D) <br>
55
- - **Other Properties Related to Output:** Context length up to 32,768 tokens <br>
56
 
57
- Our AI models are designed and/or 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. <br>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
 
59
 
60
- ## Software Integration
61
- * Runtime Engine: Transformers, vLLM <br>
62
- * Recommended Hardware Microarchitecture Compatibility: <br>
63
- - NVIDIA Ampere
64
- - NVIDIA Hopper
65
- * Preferred/Supported Operating System(s): Linux <br>
66
 
67
 
68
- ## Model Version(s)
69
- 1.0 (4/25/2025) <br>
70
-
71
 
72
- ## Training Dataset
73
- The training corpus for OpenCodeReasoning-Nemotron-32B is [OpenCodeReasoning](https://huggingface.co/datasets/nvidia/OpenCodeReasoning) dataset, which is composed of competitive programming questions and DeepSeek-R1 generated responses.
74
- * Data Collection Method: Hybrid: Automated, Human, Synthetic <br>
75
- * Data Labeling Method: Hybrid: Automated, Human, Synthetic <br>
76
-
77
-
78
- ## Evaluation Dataset
79
- We used the datasets listed in the next section to evaluate OpenCodeReasoning-Nemotron-32B. <br>
80
- * Data Collection Method: Hybrid: Automated, Human, Synthetic <br>
81
- * Data Labeling Method: Hybrid: Automated, Human, Synthetic <br>
82
 
 
 
 
83
 
84
- ### [LiveCodeBench](https://huggingface.co/datasets/livecodebench/code_generation_lite)
85
- | Easy | Medium | Hard | Avg. |
86
- |:------|:------|:------|:-----|
87
- | 98.4 | 77.2 | 30.4 | 61.7 |
88
 
89
- ### [CodeContests](https://huggingface.co/datasets/deepmind/code_contests)
90
- | Public | Private | Generated | All |
91
- |:--------|:--------|:----------|:----|
92
- | 60.3 | 36.6 | 42.7 | 24.4|
 
 
93
 
 
94
 
95
- ## Inference
96
- - **Engine:** vLLM <br>
97
- - **Test Hardware** NVIDIA H100-80GB <br>
98
 
 
 
 
 
99
 
100
- ## Ethical Considerations:
 
101
 
102
- 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.
 
 
 
 
103
 
104
- For more detailed information on ethical considerations for this model, please see the Model Card++ [Explainability](./EXPLAINABILITY.md), [Bias](./BIAS.md), [Safety & Security](./SAFETY_and_SECURITY.md), and [Privacy](./PRIVACY.md) Subcards.
 
 
 
 
105
 
106
- Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
107
 
108
 
109
  ## Citation
@@ -119,3 +118,82 @@ If you find the data useful, please cite:
119
  primaryClass={cs.CL},
120
  url={https://arxiv.org/abs/2504.01943},
121
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  library_name: transformers
3
  license: other
4
+ license_name: apache-2.0
5
+ license_link: https://huggingface.co/nvidia/OpenCodeReasoning-Nemotron-7B/blob/main/LICENSE
 
6
  pipeline_tag: text-generation
7
  tags:
8
+ - nvidia
9
+ - pytorch
10
+ base_model:
11
+ - Qwen/Qwen2.5-32B-Instruct
12
  ---
13
 
14
  # OpenCodeReasoning-Nemotron-32B Overview
15
 
16
+ ## Description: <br>
17
+ OpenCodeReasoning-Nemotron-32B is a large language model (LLM) which is a derivative of Qwen2.5-32B-Instruct (AKA the reference model). It is a reasoning model that is post-trained for reasoning for code generation. The model supports a context length of 32K tokens. <br>
18
 
19
+ This model is ready for commercial/non-commercial use. <br>
 
20
 
21
+ ![Evaluation Results](./results.png)
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
+ ## Results from [OpenCodeReasoning](https://arxiv.org/abs/2504.01943)
25
 
26
+ Below results are the average of **64 evaluations** on each benchmark.
 
 
 
 
27
 
28
+ | Model | LiveCodeBench Avg. | CodeContest All |
29
+ |------------------------|--------------------|-----------------|
30
+ | DeepSeek-R1 | 65.6 | 26.2 |
31
+ | QwQ-32B | 61.3 | 20.2 |
32
+ | | | |
33
+ | **Distilled 7B+ Models** | | |
34
+ | | | |
35
+ | Bespoke-Stratos-7B | 14.7 | 2.0 |
36
+ | OpenThinker-7B | 25.5 | 5.0 |
37
+ | R1-Distill-Qwen-7B | 38.0 | 11.1 |
38
+ | OlympicCoder-7B | 40.9 | 10.6 |
39
+ | **OCR-Qwen-7B** | **48.5** | **16.3** |
40
+ | **OCR-Qwen-7B-Instruct** | **51.3** | **18.1** |
41
+ | | | |
42
+ | **Distilled 14B+ Models**| | |
43
+ | | | |
44
+ | R1-Distill-Qwen-14B | 51.3 | 17.6 |
45
+ | **OCR-Qwen-14B** | **57.7** | **22.6** |
46
+ | **OCR-Qwen-14B-Instruct**| **59.4** | **23.6** |
47
+ | | | |
48
+ | **Distilled 32B+ Models**| | |
49
+ | | | |
50
+ | Bespoke-Stratos-32B | 30.1 | 6.3 |
51
+ | OpenThinker-32B | 54.1 | 16.4 |
52
+ | R1-Distill-Qwen-32B | 58.1 | 18.3 |
53
+ | OlympicCoder-32B | 57.4 | 18.0 |
54
+ | **OCR-Qwen-32B** | **61.8** | **24.6** |
55
+ | **OCR-Qwen-32B-Instruct**| **61.7** | **24.4** |
56
 
57
+ ## Reproducing our results
58
 
59
+ * [Models](https://huggingface.co/collections/nvidia/opencodereasoning-2-68168f37cd7c6beb1e3f92e7)
60
+ * [Dataset](https://huggingface.co/datasets/nvidia/OpenCodeReasoning)
61
+ * [Paper](https://arxiv.org/abs/2504.01943)
 
 
 
62
 
63
 
64
+ ## How to use the models?
 
 
65
 
66
+ To run inference on coding problems:
 
 
 
 
 
 
 
 
 
67
 
68
+ ```python
69
+ import transformers
70
+ import torch
71
 
72
+ model_id = "nvidia/OpenCodeReasoning-Nemotron-32B"
 
 
 
73
 
74
+ pipeline = transformers.pipeline(
75
+ "text-generation",
76
+ model=model_id,
77
+ model_kwargs={"torch_dtype": torch.bfloat16},
78
+ device_map="auto",
79
+ )
80
 
81
+ prompt = """You are a helpful and harmless assistant. You should think step-by-step before responding to the instruction below.
82
 
83
+ Please use python programming language only.
 
 
84
 
85
+ You must use ```python for just the final solution code block with the following format:
86
+ ```python
87
+ # Your code here
88
+ ```
89
 
90
+ {user}
91
+ """
92
 
93
+ messages = [
94
+ {
95
+ "role": "user",
96
+ "content": prompt.format(user="Write a program to calculate the sum of the first $N$ fibonacci numbers")},
97
+ ]
98
 
99
+ outputs = pipeline(
100
+ messages,
101
+ max_new_tokens=32768,
102
+ )
103
+ print(outputs[0]["generated_text"][-1]['content'])
104
 
105
+ ```
106
 
107
 
108
  ## Citation
 
118
  primaryClass={cs.CL},
119
  url={https://arxiv.org/abs/2504.01943},
120
  }
121
+
122
+
123
+ ## Additional Information
124
+
125
+ ## Model Architecture: <br>
126
+ Architecture Type: Dense decoder-only Transformer model
127
+ Network Architecture: Qwen-32B-Instruct
128
+ <br>
129
+ **This model was developed based on Qwen2.5-32B-Instruct and has 32B model parameters. <br>**
130
+ **OpenCodeReasoning-Nemotron-32B was developed based on Qwen2.5-32B-Instruct and has 32B model parameters. <br>**
131
+
132
+ ## Input: <br>
133
+ **Input Type(s):** Text <br>
134
+ **Input Format(s):** String <br>
135
+ **Input Parameters:** One-Dimensional (1D) <br>
136
+ **Other Properties Related to Input:** Context length up to 32,768 tokens <br>
137
+
138
+ ## Output: <br>
139
+ **Output Type(s):** Text <br>
140
+ **Output Format:** String <br>
141
+ **Output Parameters:** One-Dimensional (1D) <br>
142
+ **Other Properties Related to Output:** Context length up to 32,768 tokens <br>
143
+
144
+ Our AI models are designed and/or 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. <br>
145
+
146
+ ## Software Integration : <br>
147
+ * Runtime Engine: NeMo 2.3.0 <br>
148
+ * Recommended Hardware Microarchitecture Compatibility: <br>
149
+ NVIDIA Ampere <br>
150
+ NVIDIA Hopper <br>
151
+ * Preferred/Supported Operating System(s): Linux <br>
152
+
153
+ ## Model Version(s):
154
+ 1.0 (4/25/2025) <br>
155
+ OpenCodeReasoning-Nemotron-7B<br>
156
+ OpenCodeReasoning-Nemotron-14B<br>
157
+ OpenCodeReasoning-Nemotron-32B<br>
158
+ OpenCodeReasoning-Nemotron-32B-IOI<br>
159
+
160
+
161
+ # Training and Evaluation Datasets: <br>
162
+
163
+ ## Training Dataset:
164
+
165
+ The training corpus for OpenCodeReasoning-Nemotron-32B is [OpenCodeReasoning](https://huggingface.co/datasets/nvidia/OpenCodeReasoning) dataset, which is composed of competitive programming questions and DeepSeek-R1 generated responses.
166
+
167
+ Data Collection Method: Hybrid: Automated, Human, Synthetic <br>
168
+ Labeling Method: Hybrid: Automated, Human, Synthetic <br>
169
+ Properties: 736k samples from OpenCodeReasoning (https://huggingface.co/datasets/nvidia/OpenCodeReasoning)
170
+
171
+ ## Evaluation Dataset:
172
+ We used the datasets listed in the next section to evaluate OpenCodeReasoning-Nemotron-32B. <br>
173
+ **Data Collection Method: Hybrid: Automated, Human, Synthetic <br>**
174
+ **Labeling Method: Hybrid: Automated, Human, Synthetic <br>**
175
+
176
+ ### License/Terms of Use: <br>
177
+ GOVERNING TERMS: Use of this model is governed by [Apache 2.0](https://huggingface.co/nvidia/OpenCode-Nemotron-2-7B/blob/main/LICENSE).
178
+
179
+ ### Deployment Geography:
180
+ Global<br>
181
+
182
+ ### Use Case: <br>
183
+ This model is intended for developers and researchers building LLMs. <br>
184
+
185
+ ### Release Date: <br>
186
+ Huggingface [04/25/2025] via https://huggingface.co/nvidia/OpenCodeReasoning-Nemotron-32B/ <br>
187
+
188
+ ## Reference(s):
189
+ [2504.01943] OpenCodeReasoning: Advancing Data Distillation for Competitive Coding
190
+ <br>
191
+
192
+ ## Inference:
193
+ **Engine:** vLLM <br>
194
+ **Test Hardware** NVIDIA H100-80GB <br>
195
+
196
+ ## Ethical Considerations:
197
+ 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.
198
+
199
+ Please report security vulnerabilities or NVIDIA AI Concerns here.