🚀 OpenCodeReasoning-Nemotron-32B-IOI
OpenCodeReasoning-Nemotron-32B-IOI 是一個大語言模型(LLM),它基於 Qwen2.5-32B-Instruct(即參考模型)衍生而來。這是一個經過後訓練的推理模型,用於代碼生成推理,支持 32K 令牌的上下文長度。該模型可用於商業或非商業用途。

🚀 快速開始
復現結果
使用模型
對 IOI 基準測試的編碼問題進行推理
import transformers
import torch
model_id = "nvidia/OpenCodeReasoning-Nemotron-32B-IOI"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device_map="auto",
)
prompt = """You are a helpful and harmless assistant. You should think step-by-step before responding to the instruction below.
Please use c++ programming language only.
You must use ```cpp for just the final solution code block with the following format:
```cpp
// Your code here
{user}
"""
messages = [
{
"role": "user",
"content": prompt.format(user="Write a program to calculate the sum of the first $N$ fibonacci numbers")},
]
outputs = pipeline(
messages,
max_new_tokens=32768,
)
print(outputs[0]["generated_text"][-1]['content'])
#### 對 Python 程序的編碼問題進行推理
```python
import transformers
import torch
model_id = "nvidia/OpenCodeReasoning-Nemotron-32B"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device_map="auto",
)
prompt = """You are a helpful and harmless assistant. You should think step-by-step before responding to the instruction below.
Please use python programming language only.
You must use ```python for just the final solution code block with the following format:
```python
# Your code here
{user}
"""
messages = [
{
"role": "user",
"content": prompt.format(user="Write a program to calculate the sum of the first $N$ fibonacci numbers")},
]
outputs = pipeline(
messages,
max_new_tokens=32768,
)
print(outputs[0]["generated_text"][-1]['content'])
## ✨ 主要特性
- 基於 Qwen2.5-32B-Instruct 開發,具有 32B 模型參數。
- 支持 32K 令牌的上下文長度。
- 可用於商業或非商業用途。
## 📦 安裝指南
文檔未提及安裝步驟,故跳過。
## 💻 使用示例
### 基礎用法
上述“對 IOI 基準測試的編碼問題進行推理”和“對 Python 程序的編碼問題進行推理”的代碼示例展示了基礎的使用方法。
## 📚 詳細文檔
### 評估結果
以下結果是在每個基準測試上進行 **64 次評估**的平均值。
| 模型 | 數據集規模(Python) | 數據集規模(C++) | LiveCodeBench (pass@1) | CodeContests (pass@1) | IOI(總分) |
|---------------------------|---------------------|------------------|------------------------|-----------------------|-------------------|
| OlympicCoder-7B | 0 | 100K | 40.9 | 10.6 | 127 |
| OlympicCoder-32B | 0 | 100K | 57.4 | 18.0 | 153.5 |
| QWQ-32B | - | - | 61.3 | 20.2 | 175.5 |
| **OpenCodeReasoning-IOI** | | | | | |
| **OCR-Qwen-32B-Instruct** | **736K** | **356K** | **61.5** | **25.5** | **175.5** |
### 模型架構
- 架構類型:密集解碼器 Transformer 模型
- 網絡架構:Qwen-32B-Instruct
本模型基於 Qwen2.5-32B-Instruct 開發,具有 32B 模型參數。OpenCodeReasoning-Nemotron-32B 同樣基於 Qwen2.5-32B-Instruct 開發,也具有 32B 模型參數。
### 輸入
- **輸入類型**:文本
- **輸入格式**:字符串
- **輸入參數**:一維(1D)
- **其他輸入相關屬性**:上下文長度可達 32,768 個令牌
### 輸出
- **輸出類型**:文本
- **輸出格式**:字符串
- **輸出參數**:一維(1D)
- **其他輸出相關屬性**:上下文長度可達 32,768 個令牌
我們的 AI 模型設計和/或優化為在 NVIDIA GPU 加速系統上運行。通過利用 NVIDIA 的硬件(如 GPU 核心)和軟件框架(如 CUDA 庫),該模型與僅使用 CPU 的解決方案相比,實現了更快的訓練和推理時間。
### 軟件集成
- 運行時引擎:NeMo 2.3.0
- 推薦的硬件微架構兼容性:
- NVIDIA Ampere
- NVIDIA Hopper
- 首選/支持的操作系統:Linux
### 模型版本
- 1.0 (4/25/2025)
- OpenCodeReasoning-Nemotron-7B
- OpenCodeReasoning-Nemotron-14B
- OpenCodeReasoning-Nemotron-32B
- OpenCodeReasoning-Nemotron-32B-IOI
### 訓練和評估數據集
#### 訓練數據集
OpenCodeReasoning-Nemotron-32B 的訓練語料庫是 [OpenCodeReasoning](https://huggingface.co/datasets/nvidia/OpenCodeReasoning) 數據集,它由競賽編程問題和 DeepSeek-R1 生成的響應組成。
- 數據收集方法:混合(自動化、人工、合成)
- 標註方法:混合(自動化、人工、合成)
- 屬性:來自 OpenCodeReasoning 的 736k 個樣本
#### 評估數據集
我們使用下一節列出的數據集來評估 OpenCodeReasoning-Nemotron-32B。
- 數據收集方法:混合(自動化、人工、合成)
- 標註方法:混合(自動化、人工、合成)
### 許可證
使用本模型受 [Apache 2.0](https://huggingface.co/nvidia/OpenCode-Nemotron-2-7B/blob/main/LICENSE) 許可協議的約束。
### 部署地域
全球
### 使用場景
本模型適用於構建大語言模型的開發者和研究人員。
### 發佈日期
Huggingface [04/25/2025],通過 https://huggingface.co/nvidia/OpenCodeReasoning-Nemotron-32B/ 發佈
### 參考資料
[2504.01943] OpenCodeReasoning: Advancing Data Distillation for Competitive Coding
### 推理
- **引擎**:vLLM
- **測試硬件**:NVIDIA H100 - 80GB
### 倫理考量
NVIDIA 認為可信 AI 是一項共同責任,我們已經制定了政策和實踐,以支持廣泛的 AI 應用開發。當按照我們的服務條款下載或使用時,開發者應與他們的內部模型團隊合作,確保該模型滿足相關行業和用例的要求,並解決意外的產品濫用問題。請在此報告安全漏洞或 NVIDIA AI 相關問題。
## 🔧 技術細節
文檔未提及技術實現細節,故跳過。
## 📄 許可證
使用本模型受 [Apache 2.0](https://huggingface.co/nvidia/OpenCode-Nemotron-2-7B/blob/main/LICENSE) 許可協議的約束。
## 引用
如果您發現這些數據有用,請引用:
@article{ahmad2025opencodereasoning,
title={OpenCodeReasoning: Advancing Data Distillation for Competitive Coding},
author={Wasi Uddin Ahmad, Sean Narenthiran, Somshubra Majumdar, Aleksander Ficek, Siddhartha Jain, Jocelyn Huang, Vahid Noroozi, Boris Ginsburg},
year={2025},
eprint={2504.01943},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2504.01943},
}