smajumdar94 commited on
Commit
f6f7b94
·
verified ·
1 Parent(s): d988089

Update README.md

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