CoolFace
Modelpublic

nvidia/OpenCodeReasoning-Nemotron-32B-IOI

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
26likes175downloads
README.md223 linesDownload Raw Back to root
1---2base_model:3- Qwen/Qwen2.5-32B-Instruct4datasets:5- nvidia/OpenCodeReasoning6language:7- en8library_name: transformers9license: apache-2.010tags:11- nvidia12- code13pipeline_tag: text-generation14---15 16# OpenCodeReasoning-Nemotron-32B-IOI Overview17 18## Description: <br>19OpenCodeReasoning-Nemotron-32B-IOI 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>20 21This model is ready for commercial/non-commercial use. <br>22 23![Evaluation Results](./results.png)24 25 26## Results from [OpenCodeReasoning](https://arxiv.org/abs/2504.01943)27 28Below results are the average of **64 evaluations** on each benchmark.29 30| Model                     | Dataset Size Python | C++    | LiveCodeBench (pass@1) | CodeContests (pass@1) | IOI (Total Score) |31|---------------------------|---------------------|--------|------------------------|-----------------------|-------------------|32| OlympicCoder-7B           | 0                   | 100K   | 40.9                   | 10.6                  | 127               |33| OlympicCoder-32B          | 0                   | 100K   | 57.4                   | 18.0                  | 153.5             |34| QWQ-32B                   | -                   | -      | 61.3                   | 20.2                  | 175.5             |35|  |  |  |  |  |  |36| **OpenCodeReasoning-IOI** |  |  |  |  |  |37|  |  |  |  |  |  |38| **OCR-Qwen-32B-Instruct** | **736K** | **356K**| **61.5** | **25.5** | **175.5** |39 40 41## Reproducing our results42 43* [Models](https://huggingface.co/collections/nvidia/opencodereasoning-2-68168f37cd7c6beb1e3f92e7)44* [Dataset](https://huggingface.co/datasets/nvidia/OpenCodeReasoning)45* [Paper](https://arxiv.org/abs/2504.01943)46 47 48## How to use the models?49 50To run inference on coding problems for IOI Benchmark:51 52````python53import transformers54import torch55 56model_id = "nvidia/OpenCodeReasoning-Nemotron-32B-IOI"57 58pipeline = transformers.pipeline(59    "text-generation",60    model=model_id,61    model_kwargs={"torch_dtype": torch.bfloat16},62    device_map="auto",63)64 65prompt = """You are a helpful and harmless assistant. You should think step-by-step before responding to the instruction below.66 67Please use c++ programming language only.68 69You must use ```cpp for just the final solution code block with the following format:70```cpp71// Your code here72```73 74{user}75"""76 77messages = [78    {79        "role": "user",80        "content": prompt.format(user="Write a program to calculate the sum of the first $N$ fibonacci numbers")},81]82 83outputs = pipeline(84    messages,85    max_new_tokens=32768,86)87print(outputs[0]["generated_text"][-1]['content'])88````89 90To run inference on coding problems for python programs:91 92````python93import transformers94import torch95 96model_id = "nvidia/OpenCodeReasoning-Nemotron-32B"97 98pipeline = transformers.pipeline(99    "text-generation",100    model=model_id,101    model_kwargs={"torch_dtype": torch.bfloat16},102    device_map="auto",103)104 105prompt = """You are a helpful and harmless assistant. You should think step-by-step before responding to the instruction below.106 107Please use python programming language only.108 109You must use ```python for just the final solution code block with the following format:110```python111# Your code here112```113 114{user}115"""116 117messages = [118    {119        "role": "user",120        "content": prompt.format(user="Write a program to calculate the sum of the first $N$ fibonacci numbers")},121]122 123outputs = pipeline(124    messages,125    max_new_tokens=32768,126)127print(outputs[0]["generated_text"][-1]['content'])128````129 130 131 132## Citation133 134If you find the data useful, please cite:135```136@article{ahmad2025opencodereasoning,137      title={OpenCodeReasoning: Advancing Data Distillation for Competitive Coding}, 138      author={Wasi Uddin Ahmad, Sean Narenthiran, Somshubra Majumdar, Aleksander Ficek, Siddhartha Jain, Jocelyn Huang, Vahid Noroozi, Boris Ginsburg},139      year={2025},140      eprint={2504.01943},141      archivePrefix={arXiv},142      primaryClass={cs.CL},143      url={https://arxiv.org/abs/2504.01943}, 144}145```146 147## Additional Information148 149## Model Architecture: <br>150Architecture Type: Dense decoder-only Transformer model151Network Architecture: Qwen-32B-Instruct 152<br>153**This model was developed based on Qwen2.5-32B-Instruct and has 32B model parameters. <br>**154**OpenCodeReasoning-Nemotron-32B was developed based on Qwen2.5-32B-Instruct and has 32B model parameters. <br>**155 156## Input: <br>157**Input Type(s):** Text <br>158**Input Format(s):** String <br>159**Input Parameters:** One-Dimensional (1D) <br>160**Other Properties Related to Input:** Context length up to 32,768 tokens <br>161 162## Output: <br>163**Output Type(s):** Text <br>164**Output Format:** String <br>165**Output Parameters:** One-Dimensional (1D) <br>166**Other Properties Related to Output:** Context length up to 32,768 tokens <br> 167 168Our 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>   169 170## Software Integration : <br>171* Runtime Engine: NeMo 2.3.0 <br>172* Recommended Hardware Microarchitecture Compatibility: <br>173NVIDIA Ampere <br>174NVIDIA Hopper <br>175* Preferred/Supported Operating System(s): Linux <br> 176 177## Model Version(s): 1781.0 (4/25/2025)  <br>179OpenCodeReasoning-Nemotron-7B<br>180OpenCodeReasoning-Nemotron-14B<br>181OpenCodeReasoning-Nemotron-32B<br>182OpenCodeReasoning-Nemotron-32B-IOI<br>183 184 185# Training and Evaluation Datasets: <br>   186 187## Training Dataset:188 189The 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. 190 191Data Collection Method: Hybrid: Automated, Human, Synthetic <br>192Labeling Method: Hybrid: Automated, Human, Synthetic <br>193Properties: 736k samples from OpenCodeReasoning (https://huggingface.co/datasets/nvidia/OpenCodeReasoning)194 195## Evaluation Dataset:196We used the datasets listed in the next section to evaluate OpenCodeReasoning-Nemotron-32B. <br>197**Data Collection Method: Hybrid: Automated, Human, Synthetic <br>**198**Labeling Method: Hybrid: Automated, Human, Synthetic <br>**199 200### License/Terms of Use: <br> 201GOVERNING TERMS: Use of this model is governed by [Apache 2.0](https://huggingface.co/nvidia/OpenCode-Nemotron-2-7B/blob/main/LICENSE).202 203### Deployment Geography:204Global<br>205 206### Use Case: <br>207This model is intended for developers and researchers building LLMs. <br>208 209### Release Date:  <br>210Huggingface [04/25/2025] via https://huggingface.co/nvidia/OpenCodeReasoning-Nemotron-32B/ <br> 211 212## Reference(s):213[2504.01943] OpenCodeReasoning: Advancing Data Distillation for Competitive Coding214<br>215 216## Inference:217**Engine:** vLLM <br>218**Test Hardware** NVIDIA H100-80GB <br>219 220## Ethical Considerations:221NVIDIA 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.  222 223Please report security vulnerabilities or NVIDIA AI Concerns here.