smajumdar94 commited on
Commit
5148e71
·
verified ·
1 Parent(s): 1ab1f7b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +153 -75
README.md CHANGED
@@ -1,121 +1,199 @@
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-14B Overview
14
 
15
- ## Description
 
16
 
17
- OpenCodeReasoning-Nemotron-14B is a large language model (LLM) which is a derivative of [Qwen2.5-14B-Instruct](https://huggingface.co/Qwen/Qwen2.5-14B-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-14B/ <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-14B-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-14B 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-14B. <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
- | 97.6 | 74.4 | 27.6 | 59.4 |
88
 
89
- ### [CodeContests](https://huggingface.co/datasets/deepmind/code_contests)
90
- | Public | Private | Generated | All |
91
- |:--------|:--------|:----------|:----|
92
- | 57.1 | 34.5 | 40.2 | 23.6|
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
 
110
 
111
- If you find the data useful, please cite:
112
- ```
113
- @article{ahmad2025opencodereasoning,
114
- title={OpenCodeReasoning: Advancing Data Distillation for Competitive Coding},
115
- author={Wasi Uddin Ahmad, Sean Narenthiran, Somshubra Majumdar, Aleksander Ficek, Siddhartha Jain, Jocelyn Huang, Vahid Noroozi, Boris Ginsburg},
116
- year={2025},
117
- eprint={2504.01943},
118
- archivePrefix={arXiv},
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-14B/blob/main/LICENSE
 
6
  pipeline_tag: text-generation
7
  tags:
8
+ - nvidia
9
+ - pytorch
10
+ base_model:
11
+ - Qwen/Qwen2.5-14B-Instruct
12
  ---
13
 
14
  # OpenCodeReasoning-Nemotron-14B Overview
15
 
16
+ ## Description: <br>
17
+ OpenCodeReasoning-Nemotron-14B is a large language model (LLM) which is a derivative of Qwen2.5-14B-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
 
22
+ ## Results from [OpenCodeReasoning](https://arxiv.org/abs/2504.01943)
 
23
 
24
+ Below results are the average of **64 evaluations** on each benchmark.
 
25
 
26
+ | Model | LiveCodeBench Avg. | CodeContest All |
27
+ |------------------------|--------------------|-----------------|
28
+ | DeepSeek-R1 | 65.6 | 26.2 |
29
+ | QwQ-32B | 61.3 | 20.2 |
30
+ | | | |
31
+ | **Distilled 7B+ Models** | | |
32
+ | | | |
33
+ | Bespoke-Stratos-7B | 14.7 | 2.0 |
34
+ | OpenThinker-7B | 25.5 | 5.0 |
35
+ | R1-Distill-Qwen-7B | 38.0 | 11.1 |
36
+ | OlympicCoder-7B | 40.9 | 10.6 |
37
+ | **OCR-Qwen-7B** | **48.5** | **16.3** |
38
+ | **OCR-Qwen-7B-Instruct** | **51.3** | **18.1** |
39
+ | | | |
40
+ | **Distilled 14B+ Models**| | |
41
+ | | | |
42
+ | R1-Distill-Qwen-14B | 51.3 | 17.6 |
43
+ | **OCR-Qwen-14B** | **57.7** | **22.6** |
44
+ | **OCR-Qwen-14B-Instruct**| **59.4** | **23.6** |
45
+ | | | |
46
+ | **Distilled 32B+ Models**| | |
47
+ | | | |
48
+ | Bespoke-Stratos-32B | 30.1 | 6.3 |
49
+ | OpenThinker-32B | 54.1 | 16.4 |
50
+ | R1-Distill-Qwen-32B | 58.1 | 18.3 |
51
+ | OlympicCoder-32B | 57.4 | 18.0 |
52
+ | **OCR-Qwen-32B** | **61.8** | **24.6** |
53
+ | **OCR-Qwen-32B-Instruct**| **61.7** | **24.4** |
54
+
55
+ ## Reproducing our results
56
+
57
+ * [Models](https://huggingface.co/collections/nvidia/opencodereasoning-2-68168f37cd7c6beb1e3f92e7)
58
+ * [Dataset](https://huggingface.co/datasets/nvidia/OpenCodeReasoning)
59
+ * [Paper](https://arxiv.org/abs/2504.01943)
60
 
 
 
61
 
62
+ ## How to use the models?
63
 
64
+ To run inference on coding problems:
 
65
 
66
+ ```python
67
+ import transformers
68
+ import torch
69
 
70
+ model_id = "nvidia/OpenCodeReasoning-Nemotron-14B"
 
 
71
 
72
+ pipeline = transformers.pipeline(
73
+ "text-generation",
74
+ model=model_id,
75
+ model_kwargs={"torch_dtype": torch.bfloat16},
76
+ device_map="auto",
77
+ )
78
 
79
+ prompt = """You are a helpful and harmless assistant. You should think step-by-step before responding to the instruction below.
 
 
 
 
80
 
81
+ Please use python programming language only.
82
+
83
+ You must use ```python for just the final solution code block with the following format:
84
+ ```python
85
+ # Your code here
86
+ ```
87
+
88
+ {user}
89
+ """
90
+
91
+ messages = [
92
+ {
93
+ "role": "user",
94
+ "content": prompt.format(user="Write a program to calculate the sum of the first $N$ fibonacci numbers")},
95
+ ]
96
+
97
+ outputs = pipeline(
98
+ messages,
99
+ max_new_tokens=32768,
100
+ )
101
+ print(outputs[0]["generated_text"][-1]['content'])
102
+
103
+ ```
104
 
 
 
 
 
 
105
 
106
+ ## Citation
107
+
108
+ If you find the data useful, please cite:
109
+ ```
110
+ @article{ahmad2025opencodereasoning,
111
+ title={OpenCodeReasoning: Advancing Data Distillation for Competitive Coding},
112
+ author={Wasi Uddin Ahmad, Sean Narenthiran, Somshubra Majumdar, Aleksander Ficek, Siddhartha Jain, Jocelyn Huang, Vahid Noroozi, Boris Ginsburg},
113
+ year={2025},
114
+ eprint={2504.01943},
115
+ archivePrefix={arXiv},
116
+ primaryClass={cs.CL},
117
+ url={https://arxiv.org/abs/2504.01943},
118
+ }
119
+
120
 
121
+ ## Additional Information
122
 
123
+ ## Model Architecture: <br>
124
+ Architecture Type: Dense decoder-only Transformer model
125
+ Network Architecture: Qwen-14B-Instruct
126
+ <br>
127
+ **This model was developed based on Qwen2.5-14B-Instruct and has 14B model parameters. <br>**
128
+ **OpenCodeReasoning-Nemotron-14B was developed based on Qwen2.5-14B-Instruct and has 14B model parameters. <br>**
129
+
130
+ ## Input: <br>
131
+ **Input Type(s):** Text <br>
132
+ **Input Format(s):** String <br>
133
+ **Input Parameters:** One-Dimensional (1D) <br>
134
+ **Other Properties Related to Input:** Context length up to 32,768 tokens <br>
135
+
136
+ ## Output: <br>
137
+ **Output Type(s):** Text <br>
138
+ **Output Format:** String <br>
139
+ **Output Parameters:** One-Dimensional (1D) <br>
140
+ **Other Properties Related to Output:** Context length up to 32,768 tokens <br>
141
+
142
+ 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>
143
+
144
+ ## Software Integration : <br>
145
+ * Runtime Engine: NeMo 2.3.0 <br>
146
  * Recommended Hardware Microarchitecture Compatibility: <br>
147
+ NVIDIA Ampere <br>
148
+ NVIDIA Hopper <br>
149
  * Preferred/Supported Operating System(s): Linux <br>
150
 
151
+ ## Model Version(s):
 
152
  1.0 (4/25/2025) <br>
153
+ OpenCodeReasoning-Nemotron-7B<br>
154
+ OpenCodeReasoning-Nemotron-14B<br>
155
+ OpenCodeReasoning-Nemotron-32B<br>
156
+ OpenCodeReasoning-Nemotron-32B-IOI<br>
157
 
158
 
159
+ # Training and Evaluation Datasets: <br>
 
 
 
 
160
 
161
+ ## Training Dataset:
 
 
 
162
 
163
+ The training corpus for OpenCodeReasoning-Nemotron-14B is [OpenCodeReasoning](https://huggingface.co/datasets/nvidia/OpenCodeReasoning) dataset, which is composed of competitive programming questions and DeepSeek-R1 generated responses.
164
 
165
+ Data Collection Method: Hybrid: Automated, Human, Synthetic <br>
166
+ Labeling Method: Hybrid: Automated, Human, Synthetic <br>
167
+ Properties: 736k samples from OpenCodeReasoning (https://huggingface.co/datasets/nvidia/OpenCodeReasoning)
 
168
 
169
+ ## Evaluation Dataset:
170
+ We used the datasets listed in the next section to evaluate OpenCodeReasoning-Nemotron-14B. <br>
171
+ **Data Collection Method: Hybrid: Automated, Human, Synthetic <br>**
172
+ **Labeling Method: Hybrid: Automated, Human, Synthetic <br>**
173
 
174
 
 
 
 
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-14B/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-7B/ <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.